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

#include <ElementVisualizer.h>

Detailed Description

This class maintains the visual properties of the a Bridges element.

This class is used to store the visualization elements for Bridges Visualiztions, including the color, shape, and size of the node. Defaults of "steelblue", CIRCLE, and 10.0 respectively.

Size values must range from [1.0, 50.0]. Colors can be specified by name or by (R,G,B) triplets. See the Color class for details.

BRIDGES supports a number of shapes (specified as enums), namely, CIRCLE, SQUARE, DIAMOND", CROSS, WYE, TRIANGLE, STAR

Objects of this class are stored as properties of all Element subclasses.

Author
Kalpathi Subramanian
Date
6/11/15, 7/12/19, 12/28/20

Public Member Functions

 ElementVisualizer (const Color &hue=DEFAULT_COLOR(), const double &sz=DEFAULT_SIZE(), const Shape &shp=DEFAULT_SHAPE())
 
void setSize (const double &sz)
 
double getSize () const
 
void setColor (const Color &col)
 Set the color to "col". More...
 
void setColor (const string &col)
 Set the color to a named color. More...
 
Color getColor () const
 Return the element color. More...
 
void setOpacity (double opacity)
 Set opacity of element. More...
 
double getOpacity ()
 Get opacity of element. More...
 
void setShape (const Shape &shp)
 Set the shape of the element. More...
 
Shape getShape () const
 Return the shape of the element. More...
 
void setLocation (const double &locX, const double &locY)
 
double getLocationX () const
 get X coordinate of element location More...
 
double getLocationY () const
 get Y coordinate of element location More...
 

Static Public Member Functions

static const Color DEFAULT_COLOR ()
 
static constexpr Shape DEFAULT_SHAPE ()
 
static constexpr double DEFAULT_SIZE ()
 

Constructor & Destructor Documentation

◆ ElementVisualizer()

bridges::datastructure::ElementVisualizer::ElementVisualizer ( const Color hue = DEFAULT_COLOR(),
const double &  sz = DEFAULT_SIZE(),
const Shape shp = DEFAULT_SHAPE() 
)
inline

Constructs an element with the provided Color, Size, and Shape. The defaults will be used if not provided.

Parameters
hueThe Color for display
szThe Size for display
shpThe Shape for display

Member Function Documentation

◆ DEFAULT_COLOR()

static const Color bridges::datastructure::ElementVisualizer::DEFAULT_COLOR ( )
inlinestatic

◆ DEFAULT_SHAPE()

static constexpr Shape bridges::datastructure::ElementVisualizer::DEFAULT_SHAPE ( )
inlinestaticconstexpr

◆ DEFAULT_SIZE()

static constexpr double bridges::datastructure::ElementVisualizer::DEFAULT_SIZE ( )
inlinestaticconstexpr

◆ getColor()

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

Return the element color.

Returns
The color of the element

◆ getLocationX()

double bridges::datastructure::ElementVisualizer::getLocationX ( ) const
inline

get X coordinate of element location

Returns
the X coordinate of the element's location attribute

◆ getLocationY()

double bridges::datastructure::ElementVisualizer::getLocationY ( ) const
inline

get Y coordinate of element location

Returns
the Y coordinate of the element's location attribute

◆ getOpacity()

double bridges::datastructure::ElementVisualizer::getOpacity ( )
inline

Get opacity of element.

Returns
opacity of the element

◆ getShape()

Shape bridges::datastructure::ElementVisualizer::getShape ( ) const
inline

Return the shape of the element.

Returns
The shape of the element

◆ getSize()

double bridges::datastructure::ElementVisualizer::getSize ( ) const
inline
Returns
The size in pixel weight of the element

◆ setColor() [1/2]

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

Set the color to "col".

Parameters
colThe color of the element

◆ setColor() [2/2]

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

Set the color to a named color.

Parameters
colThe color name. Check the Color class for supported values.

◆ setLocation()

void bridges::datastructure::ElementVisualizer::setLocation ( const double &  locX,
const double &  locY 
)
inline

Set the location attributes of an element. Set location to INFINITY for bridges to chose the location.

Parameters
locXX coordinate of the element location
locYY coordinate of the element location

◆ setOpacity()

void bridges::datastructure::ElementVisualizer::setOpacity ( double  opacity)
inline

Set opacity of element.

Set opacity of element - use the 4th color component

Parameters
opacityopacity of element to be set

◆ setShape()

void bridges::datastructure::ElementVisualizer::setShape ( const Shape shp)
inline

Set the shape of the element.

Parameters
shpis one of CIRCLE, SQUARE, DIAMOND, CROSS, TRIANGLE, WYE, STAR

◆ setSize()

void bridges::datastructure::ElementVisualizer::setSize ( const double &  sz)
inline

Sets size to "sz" Valid Range:[1,50]

Parameters
szThe size in pixel weight of the element
Exceptions
stringIf size is invalid

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