Bridges-C++  3.1.1
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
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
 
const K & to () const
 
void setEdgeData (const E2 &data)
 
const E2 & getEdgeData () const
 
E2 & getEdgeData ()
 
string getLabel () const
 
void setLabel (const string &lab)
 
void setThickness (const double &th)
 Change the thickness of the edge when displayed. More...
 
double getThickness () const
 
void setColor (const Color &col)
 Set the color of the edge when displayed. More...
 
void setColor (const string col)
 Set the color to a named color. More...
 
Color getColor () const
 

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
Returns
The source vertex

◆ getColor()

template<typename K, typename E2 = K>
Color bridges::datastructure::Edge< K, E2 >::getColor ( ) const
inline
Returns
The color of the link

◆ getEdgeData() [1/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

◆ getEdgeData() [2/2]

template<typename K, typename E2 = K>
E2& bridges::datastructure::Edge< K, E2 >::getEdgeData ( )
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

◆ getThickness()

template<typename K, typename E2 = K>
double bridges::datastructure::Edge< K, E2 >::getThickness ( ) const
inline
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 when displayed.

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.

Parameters
colThe name of the color. Check the Color class for a list of named colors.

◆ 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

◆ 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
Returns
The terminating vertex

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