Bridges-C++  3.2.0
Bridges(C++API)
Public Member Functions | Protected Member Functions | List of all members
bridges::datastructure::Symbol Class Referenceabstract

#include <Symbol.h>

Inheritance diagram for bridges::datastructure::Symbol:
bridges::datastructure::Circle bridges::datastructure::Label bridges::datastructure::Polyline bridges::datastructure::Rectangle bridges::datastructure::Polygon

Detailed Description

This is an abstract class for deriving a number of Symbol shape objects, for use in a SymbolCollection. Symbols correspond to a simplified subset of SVG paths and shapes for custom visual representations in BRIDGES.

Currently shapes supported are rectangle, circle, polygon, label; each shape has a name, location (x, y) and appropriate geometric and non-geometric attributes

Author
David Burlinson, Kalpathi Subramanian
Date
12/24/18, 7/12/19, 12/28/20

Public Member Functions

 Symbol ()
 default constructor More...
 
virtual const string getSymbolRepresentation () const =0
 Virtual method to get the JSON representation of the symbol. More...
 
virtual vector< float > getDimensions () const =0
 Virtual method to get the bounding box (dimensions) of the shape. More...
 
 Symbol (string symb)
 Create a symbol of type "symb". More...
 
int getIdentifier ()
 return the symbol identifier. More...
 
void setLabel (string lbl)
 Set the symbol label. More...
 
string getLabel () const
 Get the symbol label. More...
 
void setFillColor (Color c)
 Set the symbol fill color. More...
 
void setFillColor (string c)
 This method sets the symbol fill color. More...
 
Color getFillColor ()
 This method gets fill color. More...
 
void setStrokeColor (Color c)
 
void setStrokeColor (string c)
 This method sets the symbol stroke color. More...
 
Color getStrokeColor ()
 This method gets stroke color. More...
 
void setStrokeWidth (float strk_width)
 This method sets the symbol stroke width. More...
 
float getStrokeWidth ()
 This method gets stroke width. More...
 
void setOpacity (float op)
 This method sets the symbol opacity. More...
 
float getOpacity ()
 This method gets symbol opacity. More...
 
void setStrokeDash (int dash)
 This method sets the stroke dash level. More...
 
int getStrokeDash ()
 This method gets stroke dash level. More...
 
void setLocation (int x, int y)
 This method sets the symbol location. More...
 
void setLocation (double x, double y)
 This method sets the symbol location. More...
 
void setCenter (float x, float y)
 This method sets the symbol location. More...
 
void setLocation (float x, float y)
 This method sets the ssymbol location. More...
 
const float * getLocation () const
 This method gets the symbol location. More...
 
string getName () const
 This method gets the name of the symbol. More...
 

Protected Member Functions

void setShapeType (string s)
 Set the shape type. More...
 
string getShapeType () const
 
void translatePoint (float *pt, float tx, float ty)
 Translate a 2D point. More...
 
void scalePoint (float *pt, float sx, float sy)
 Scale a 2D point. More...
 
void rotatePoint (float *pt, float angle)
 Rotate a 2D point (about Z) More...
 
const string getSymbolAttributeRepresentation () const
 Get the JSON of the symbol representation. More...
 

Constructor & Destructor Documentation

◆ Symbol() [1/2]

bridges::datastructure::Symbol::Symbol ( )
inline

default constructor

◆ Symbol() [2/2]

bridges::datastructure::Symbol::Symbol ( string  symb)
inline

Create a symbol of type "symb".

Parameters
symbsymbol to create

Member Function Documentation

◆ getDimensions()

virtual vector<float> bridges::datastructure::Symbol::getDimensions ( ) const
pure virtual

Virtual method to get the bounding box (dimensions) of the shape.

Implemented in bridges::datastructure::Polyline, bridges::datastructure::Label, bridges::datastructure::Rectangle, and bridges::datastructure::Circle.

◆ getFillColor()

Color bridges::datastructure::Symbol::getFillColor ( )
inline

This method gets fill color.

Returns
fill color

◆ getIdentifier()

int bridges::datastructure::Symbol::getIdentifier ( )
inline

return the symbol identifier.

Maintains unique identifiers of symbols and returns the Symbol's unique identifier

Returns
the identifier

◆ getLabel()

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

Get the symbol label.

Returns
the label

◆ getLocation()

const float* bridges::datastructure::Symbol::getLocation ( ) const
inline

This method gets the symbol location.

Returns
location (x, y) of the symbol

◆ getName()

string bridges::datastructure::Symbol::getName ( ) const
inline

This method gets the name of the symbol.

Returns
name shape name

◆ getOpacity()

float bridges::datastructure::Symbol::getOpacity ( )
inline

This method gets symbol opacity.

Returns
symbol opacity

◆ getShapeType()

string bridges::datastructure::Symbol::getShapeType ( ) const
inlineprotected

Get the symbol label

Returns
the shape type

◆ getStrokeColor()

Color bridges::datastructure::Symbol::getStrokeColor ( )
inline

This method gets stroke color.

Returns
stroke color

◆ getStrokeDash()

int bridges::datastructure::Symbol::getStrokeDash ( )
inline

This method gets stroke dash level.

Returns
stroke dash level

◆ getStrokeWidth()

float bridges::datastructure::Symbol::getStrokeWidth ( )
inline

This method gets stroke width.

Returns
stroke width

◆ getSymbolAttributeRepresentation()

const string bridges::datastructure::Symbol::getSymbolAttributeRepresentation ( ) const
inlineprotected

Get the JSON of the symbol representation.

This method gets the JSON representation of all of the symbol attributes

Returns
JSON string of symbol attributes

◆ getSymbolRepresentation()

virtual const string bridges::datastructure::Symbol::getSymbolRepresentation ( ) const
pure virtual

Virtual method to get the JSON representation of the symbol.

Implemented in bridges::datastructure::Polyline, bridges::datastructure::Rectangle, bridges::datastructure::Label, and bridges::datastructure::Circle.

◆ rotatePoint()

void bridges::datastructure::Symbol::rotatePoint ( float *  pt,
float  angle 
)
inlineprotected

Rotate a 2D point (about Z)

Parameters
pt2D point (x, y)
anglerotation angle in degrees (positive is counter clockwise, negative is clockwise)

◆ scalePoint()

void bridges::datastructure::Symbol::scalePoint ( float *  pt,
float  sx,
float  sy 
)
inlineprotected

Scale a 2D point.

Parameters
pt2D point (x, y)
sx,syscale factors along each axis

◆ setCenter()

void bridges::datastructure::Symbol::setCenter ( float  x,
float  y 
)
inline

This method sets the symbol location.

Parameters
xx coordinate
yy coordinate

◆ setFillColor() [1/2]

void bridges::datastructure::Symbol::setFillColor ( Color  c)
inline

Set the symbol fill color.

Parameters
cthe color to set

◆ setFillColor() [2/2]

void bridges::datastructure::Symbol::setFillColor ( string  c)
inline

This method sets the symbol fill color.

Parameters
cthe named color to set

◆ setLabel()

void bridges::datastructure::Symbol::setLabel ( string  lbl)
inline

Set the symbol label.

Parameters
lblthe label to set

◆ setLocation() [1/3]

void bridges::datastructure::Symbol::setLocation ( int  x,
int  y 
)
inline

This method sets the symbol location.

Parameters
xx coordinate
yy coordinate

◆ setLocation() [2/3]

void bridges::datastructure::Symbol::setLocation ( double  x,
double  y 
)
inline

This method sets the symbol location.

Parameters
xx coordinate
yy coordinate

◆ setLocation() [3/3]

void bridges::datastructure::Symbol::setLocation ( float  x,
float  y 
)
inline

This method sets the ssymbol location.

Parameters
xx coordinate
yy coordinate

◆ setOpacity()

void bridges::datastructure::Symbol::setOpacity ( float  op)
inline

This method sets the symbol opacity.

Parameters
opthe opacity to set

◆ setShapeType()

void bridges::datastructure::Symbol::setShapeType ( string  s)
inlineprotected

Set the shape type.

Parameters
sshape type to set

◆ setStrokeColor() [1/2]

void bridges::datastructure::Symbol::setStrokeColor ( Color  c)
inline

This method sets the symbol stroke color

Parameters
cthe color to set

◆ setStrokeColor() [2/2]

void bridges::datastructure::Symbol::setStrokeColor ( string  c)
inline

This method sets the symbol stroke color.

Parameters
cthe named color to set

◆ setStrokeDash()

void bridges::datastructure::Symbol::setStrokeDash ( int  dash)
inline

This method sets the stroke dash level.

Parameters
dashdash level

◆ setStrokeWidth()

void bridges::datastructure::Symbol::setStrokeWidth ( float  strk_width)
inline

This method sets the symbol stroke width.

Parameters
strk_widththe stroke width to set

◆ translatePoint()

void bridges::datastructure::Symbol::translatePoint ( float *  pt,
float  tx,
float  ty 
)
inlineprotected

Translate a 2D point.

Parameters
pt2D point (x, y)
tx,tytranslation vector

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