Bridges-C++  3.4.2
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::Polyline bridges::datastructure::Rectangle bridges::datastructure::SymbolGroup bridges::datastructure::Text 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, Erik Saule
Date
12/24/18, 7/12/19, 12/28/20, 7/2/21, 7/7/21

Public Member Functions

 Symbol ()
 default constructor More...
 
 Symbol (const Symbol &s)
 
Symboloperator= (const Symbol &s)
 
 ~Symbol ()
 
virtual const string getSymbolRepresentation () const =0
 Virtual method to get the JSON representation of the symbol. More...
 
int getIdentifier () const
 return the symbol identifier. More...
 
SymbolsetFillColor (Color c)
 Set the symbol fill color. More...
 
SymbolsetFillColor (string c)
 This method sets the symbol fill color. More...
 
Color getFillColor () const
 This method gets fill color. More...
 
SymbolsetStrokeColor (Color c)
 
SymbolsetStrokeColor (string c)
 This method sets the symbol stroke color. More...
 
Color getStrokeColor ()
 This method gets stroke color. More...
 
SymbolsetStrokeWidth (float strk_width)
 This method sets the symbol stroke width. More...
 
float getStrokeWidth () const
 This method gets stroke width. More...
 
SymbolsetOpacity (float op)
 This method sets the symbol opacity. More...
 
float getOpacity () const
 This method gets symbol opacity. More...
 
SymbolsetStrokeDash (int dash)
 This method sets the stroke dash level. More...
 
int getStrokeDash () const
 This method gets stroke dash level. More...
 
SymbolsetLayer (int l)
 
int getLayer () const
 
Symboltranslate (float tx, float ty)
 Translate a 2D point. More...
 
Symbolscale (float sx, float sy)
 Scale a Symbol. More...
 
Symbolscale (float scalefactor)
 Scale a Symbol. More...
 
Symbolrotate (float angle)
 Rotate a 2D point (about Z) More...
 
Symbolscale (float sx, float sy, float px, float py)
 Scale about an arbitrary point (px, py) More...
 
Symbolrotate (float angle, float px, float py)
 Rotate a 2D point about an arbitrary point (px, py) More...
 
SymbolsetTransform (float a, float b, float c, float d, float e, float f)
 

Protected Member Functions

virtual string getShapeType () const =0
 
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 ( const Symbol s)
inline

◆ ~Symbol()

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

Member Function Documentation

◆ getFillColor()

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

This method gets fill color.

Returns
fill color

◆ getIdentifier()

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

return the symbol identifier.

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

Returns
the identifier

◆ getLayer()

int bridges::datastructure::Symbol::getLayer ( ) const
inline

This method gets layer

Returns
layer layer (lower value closer to camera)

◆ getOpacity()

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

This method gets symbol opacity.

Returns
symbol opacity

◆ getShapeType()

virtual string bridges::datastructure::Symbol::getShapeType ( ) const
protectedpure virtual

Get the symbol type - implemented in subclasses

Returns
the shape type

Implemented in bridges::datastructure::Text, and bridges::datastructure::SymbolGroup.

◆ getStrokeColor()

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

This method gets stroke color.

Returns
stroke color

◆ getStrokeDash()

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

This method gets stroke dash level.

Returns
stroke dash level

◆ getStrokeWidth()

float bridges::datastructure::Symbol::getStrokeWidth ( ) const
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

◆ operator=()

Symbol& bridges::datastructure::Symbol::operator= ( const Symbol s)
inline

◆ rotate() [1/2]

Symbol& bridges::datastructure::Symbol::rotate ( float  angle)
inline

Rotate a 2D point (about Z)

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

◆ rotate() [2/2]

Symbol& bridges::datastructure::Symbol::rotate ( float  angle,
float  px,
float  py 
)
inline

Rotate a 2D point about an arbitrary point (px, py)

Parameters
anglerotation angle in degrees
pt2D point (px, py) (positive is counter clockwise, negative is clockwise)

◆ scale() [1/3]

Symbol& bridges::datastructure::Symbol::scale ( float  scalefactor)
inline

Scale a Symbol.

Parameters
pt2D point (x, y)
scalefactorscale factors along both axis

◆ scale() [2/3]

Symbol& bridges::datastructure::Symbol::scale ( float  sx,
float  sy 
)
inline

Scale a Symbol.

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

◆ scale() [3/3]

Symbol& bridges::datastructure::Symbol::scale ( float  sx,
float  sy,
float  px,
float  py 
)
inline

Scale about an arbitrary point (px, py)

Parameters
sx,scalefactors along X
sy,scalefactors along X
pxx coord of point
pyy coord of point

◆ setFillColor() [1/2]

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

Set the symbol fill color.

Parameters
cthe color to set

◆ setFillColor() [2/2]

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

This method sets the symbol fill color.

Parameters
cthe named color to set

◆ setLayer()

Symbol& bridges::datastructure::Symbol::setLayer ( int  l)
inline

This method sets the layer the symbol sits on

Parameters
llayer (lower value closer to camera)
Returns
the symbol

◆ setOpacity()

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

This method sets the symbol opacity.

Parameters
opthe opacity to set

◆ setStrokeColor() [1/2]

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

This method sets the symbol stroke color

Parameters
cthe color to set

◆ setStrokeColor() [2/2]

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

This method sets the symbol stroke color.

Parameters
cthe named color to set

◆ setStrokeDash()

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

This method sets the stroke dash level.

Parameters
dashdash level

◆ setStrokeWidth()

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

This method sets the symbol stroke width.

Parameters
strk_widththe stroke width to set

◆ setTransform()

Symbol& bridges::datastructure::Symbol::setTransform ( float  a,
float  b,
float  c,
float  d,
float  e,
float  f 
)
inline

Directly sets the transform matrix; note that the parameters are provided in column major order

Parameters
a,b,c,d,e,ffills the first two rows of the matrix

◆ translate()

Symbol& bridges::datastructure::Symbol::translate ( float  tx,
float  ty 
)
inline

Translate a 2D point.

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

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