Bridges-C++  3.4.4
Bridges(C++ API)
Public Member Functions | Static Public Member Functions | List of all members
bridges::datastructure::LinkVisualizer Class Reference

#include <LinkVisualizer.h>

Detailed Description

This class maintains the visual properties of links within data structures.

This class is used to keep the visual properties of links that are part of data structures such as linked lists, pointer based trees, link based graph representations, etc. Relevant attributes include color and thickness

Objects of this class are stored as properties of Elements. A user may manipulate the LinkVisualizer returned from the Element's getLinkVisualizer() method.

BRIDGES supports color of any legal named CSS or (R,G,B) triplets value. Check the Color class for details. Default: "steelblue".

Thickness values must range from ]0.0,10.0]. Default: 1.0

Author
Kalpathi Subramanian, Dakota Carmer, Erik Saule
Date
6/29/15, 6/10/16, 7/12/19, 12/28/20

Public Member Functions

 LinkVisualizer (Color col=DEFAULT_COLOR(), double th=DEFAULT_THICKNESS())
 Constructs a LinkVisualizer with the specified color and thickness. 8 The defaults will be used if not provided (black,1) More...
 
string getLabel () const
 Return the link label. More...
 
void setLabel (const string &lab)
 Sets label of the link. More...
 
void setThickness (const double &th)
 
double getThickness () const
 Get the link thickness. More...
 
void setColor (const Color &col)
 Set the link color. More...
 
void setColor (const string &col)
 Set the color by name. More...
 
Color getColor () const
 Return the link color. More...
 

Static Public Member Functions

static constexpr double DEFAULT_THICKNESS ()
 get default thickness of link (1.0) More...
 
static Color DEFAULT_COLOR ()
 get default color of link ("steelblue") More...
 

Constructor & Destructor Documentation

◆ LinkVisualizer()

bridges::datastructure::LinkVisualizer::LinkVisualizer ( Color  col = DEFAULT_COLOR(),
double  th = DEFAULT_THICKNESS() 
)
inline

Constructs a LinkVisualizer with the specified color and thickness. 8 The defaults will be used if not provided (black,1)

Parameters
colLink color
thLink thickness

Member Function Documentation

◆ DEFAULT_COLOR()

static Color bridges::datastructure::LinkVisualizer::DEFAULT_COLOR ( )
inlinestatic

get default color of link ("steelblue")

◆ DEFAULT_THICKNESS()

static constexpr double bridges::datastructure::LinkVisualizer::DEFAULT_THICKNESS ( )
inlinestaticconstexpr

get default thickness of link (1.0)

◆ getColor()

Color bridges::datastructure::LinkVisualizer::getColor ( ) const
inline

Return the link color.

Returns
The color of the link

◆ getLabel()

string bridges::datastructure::LinkVisualizer::getLabel ( ) const
inline

Return the link label.

Returns
The label of the link

◆ getThickness()

double bridges::datastructure::LinkVisualizer::getThickness ( ) const
inline

Get the link thickness.

Returns
Size in pixels of the link's line thickness

◆ setColor() [1/2]

void bridges::datastructure::LinkVisualizer::setColor ( const Color col)
inline

Set the link color.

Parameters
colThe color of the element

◆ setColor() [2/2]

void bridges::datastructure::LinkVisualizer::setColor ( const string &  col)
inline

Set the color by name.

Parameters
colThe color name. See Color for supported names.

◆ setLabel()

void bridges::datastructure::LinkVisualizer::setLabel ( const string &  lab)
inline

Sets label of the link.

Parameters
labThe label of the link

◆ setThickness()

void bridges::datastructure::LinkVisualizer::setThickness ( const double &  th)
inline

Set the link thickness Valid Range:]0.0,10.0] Default: 1

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

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