Bridges-C++  3.4.4
Bridges(C++ API)
Public Member Functions | List of all members
bridges::datastructure::Edge< K, E2 > Class Template Reference

#include <Edge.h>

Detailed Description

template<typename K, typename E2 = K>
class bridges::datastructure::Edge< K, E2 >

This helper class is used by the graph classes - GraphAdjList , GraphAdjMatrix - to keep track of edge information.

This class is used to assign a visual connection between two Elements in the Bridges Visualization.

Bridges will represent these as arrows between two Elements. The starting Element of the arrow will be referred to as the source Element and the ending Element of the arrow will be referred to as the terminating Element.

Author
Kalpathi Subramanian, Erik Saule
Date
12/28/20
Parameters
E

Public Member Functions

 Edge (const K &from, const K &to, LinkVisualizer *lv, const E2 &data=E2())
 Constructs an edge with the given destination vertex, and edge data. More...
 
 ~Edge ()
 
const K & from () const
 Source vertex accessor. More...
 
const K & to () const
 Destination vertex accessor. More...
 
void setEdgeData (const E2 &data)
 Sets edge data to "data". More...
 
const E2 & getEdgeData () const
 Return the edge data. More...
 
E2 & getEdgeData ()
 Return the edge data. More...
 
string getLabel () const
 Return the edge label. More...
 
void setLabel (const string &lab)
 Sets edge label to "lab". More...
 
void setThickness (const double &th)
 Change the thickness of the edge when displayed. More...
 
double getThickness () const
 Get the thickness of the edge. More...
 
void setColor (const Color &col)
 Set the color of the edge. More...
 
void setColor (const string col)
 Set the color to a named color. Check the Color class for a list of named colors. More...
 
Color getColor () const
 return the current color of the edge More...
 
LinkVisualizergetLinkVisualizer ()
 Get the link visualizer of this edge. More...
 

Constructor & Destructor Documentation

◆ Edge()

template<typename K , typename E2 = K>
bridges::datastructure::Edge< K, E2 >::Edge ( const K &  from,
const K &  to,
LinkVisualizer lv,
const E2 &  data = E2() 
)
inline

Constructs an edge with the given destination vertex, and edge data.

This constructor is not meant to be used by the Bridges user. If an argument is not given its default is used.

Parameters
fromsource vertex
todestination vertex
lvLinkVisualizer storing the styling information for the edge
dataedge data

◆ ~Edge()

template<typename K , typename E2 = K>
bridges::datastructure::Edge< K, E2 >::~Edge ( )
inline

Member Function Documentation

◆ from()

template<typename K , typename E2 = K>
const K& bridges::datastructure::Edge< K, E2 >::from ( ) const
inline

Source vertex accessor.

Returns
The source vertex

◆ getColor()

template<typename K , typename E2 = K>
Color bridges::datastructure::Edge< K, E2 >::getColor ( ) const
inline

return the current color of the edge

Returns
The color of the edge

◆ getEdgeData() [1/2]

template<typename K , typename E2 = K>
E2& bridges::datastructure::Edge< K, E2 >::getEdgeData ( )
inline

Return the edge data.

Returns
The edge data

◆ getEdgeData() [2/2]

template<typename K , typename E2 = K>
const E2& bridges::datastructure::Edge< K, E2 >::getEdgeData ( ) const
inline

Return the edge data.

Returns
The edge data

◆ getLabel()

template<typename K , typename E2 = K>
string bridges::datastructure::Edge< K, E2 >::getLabel ( ) const
inline

Return the edge label.

Returns
The label of the element

◆ getLinkVisualizer()

template<typename K , typename E2 = K>
LinkVisualizer* bridges::datastructure::Edge< K, E2 >::getLinkVisualizer ( )
inline

Get the link visualizer of this edge.

Returns
return the link visualizer of this edge

◆ getThickness()

template<typename K , typename E2 = K>
double bridges::datastructure::Edge< K, E2 >::getThickness ( ) const
inline

Get the thickness of the edge.

Returns
Size in pixels of the link's line thickness

◆ setColor() [1/2]

template<typename K , typename E2 = K>
void bridges::datastructure::Edge< K, E2 >::setColor ( const Color col)
inline

Set the color of the edge.

Parameters
colThe color of the edge

◆ setColor() [2/2]

template<typename K , typename E2 = K>
void bridges::datastructure::Edge< K, E2 >::setColor ( const string  col)
inline

Set the color to a named color. Check the Color class for a list of named colors.

Parameters
colThe name of the color.

◆ setEdgeData()

template<typename K , typename E2 = K>
void bridges::datastructure::Edge< K, E2 >::setEdgeData ( const E2 &  data)
inline

Sets edge data to "data".

Parameters
dataApplication data to be set

◆ setLabel()

template<typename K , typename E2 = K>
void bridges::datastructure::Edge< K, E2 >::setLabel ( const string &  lab)
inline

Sets edge label to "lab".

Parameters
labThe label of the element

◆ setThickness()

template<typename K , typename E2 = K>
void bridges::datastructure::Edge< K, E2 >::setThickness ( const double &  th)
inline

Change the thickness of the edge when displayed.

Valid Range:[1,10] Default: 1

Parameters
thThe size in pixels of the link's line weight
Exceptions
stringIf invalid thickness

◆ to()

template<typename K , typename E2 = K>
const K& bridges::datastructure::Edge< K, E2 >::to ( ) const
inline

Destination vertex accessor.

Returns
The terminating vertex

The documentation for this class was generated from the following file: