Bridges-C++  3.1.1
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

Public Member Functions

 Symbol ()
 
virtual const string getSymbolRepresentation () const =0
 
virtual vector< float > getDimensions () const =0
 
 Symbol (string symb)
 
int getIdentifier ()
 
void setLabel (string lbl)
 
string getLabel () const
 
void setFillColor (Color c)
 
void setFillColor (string c)
 
Color getFillColor ()
 
void setStrokeColor (Color c)
 
void setStrokeColor (string c)
 
Color getStrokeColor ()
 
void setStrokeWidth (float strk_width)
 
float getStrokeWidth ()
 
void setOpacity (float op)
 
float getOpacity ()
 
void setStrokeDash (int dash)
 
int getStrokeDash ()
 
void setLocation (int x, int y)
 
void setCenter (float x, float y)
 
void setLocation (float x, float y)
 
const float * getLocation () const
 
string getName () const
 

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
 

Constructor & Destructor Documentation

◆ Symbol() [1/2]

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

◆ Symbol() [2/2]

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

create a symbole of type "symb"

Member Function Documentation

◆ getDimensions()

virtual vector<float> bridges::datastructure::Symbol::getDimensions ( ) const
pure 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

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

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

This method sets 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

This method sets the symbol label

Parameters
lblthe label to set

◆ setLocation() [1/2]

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

This method sets the symbol location

Parameters
xx coordinate
yy coordinate

◆ setLocation() [2/2]

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: