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

#include <Polyline.h>

Inheritance diagram for bridges::datastructure::Polyline:
bridges::datastructure::Symbol bridges::datastructure::Polygon

Detailed Description

This class defines a polyline and is part of the symbol collection. A polyline has a set of vertices with the vertices connect by line segments.

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

Public Member Functions

 Polyline ()
 default constructor More...
 
 Polyline (vector< float > pts)
 Construct a polyline from sequence of points. More...
 
string getDataStructType ()
 Get the name of the data type. More...
 
string getName () const
 This method gets the name of the shape. More...
 
void addPoint (float x, float y)
 This method adds a point to the polyline. More...
 
vector< float > getPoints ()
 This method returns the point list of the polyline. More...
 
void setPolyline (vector< float > pts)
 Construct a polyline from sequence of points. More...
 
void translate (float tx, float ty)
 Translate the polyline. More...
 
void rotate (float angle)
 rotate the polyline about its center More...
 
void scale (float sx, float sy)
 Scale the polyline about its center. More...
 
void getCenter (float *center)
 Get center of polyline - use its bounding box. More...
 
vector< float > getDimensions () const
 This method returns the dimensions of the shape: min and max values in X and Y. More...
 
const string getSymbolRepresentation () const
 This method returns the JSON representation of the shape. More...
 
- Public Member Functions inherited from bridges::datastructure::Symbol
 Symbol ()
 default constructor 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 Attributes

vector< float > points
 

Additional Inherited Members

- Protected Member Functions inherited from bridges::datastructure::Symbol
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

◆ Polyline() [1/2]

bridges::datastructure::Polyline::Polyline ( )
inline

default constructor

◆ Polyline() [2/2]

bridges::datastructure::Polyline::Polyline ( vector< float >  pts)
inline

Construct a polyline from sequence of points.

Parameters
ptspoint sequence

Member Function Documentation

◆ addPoint()

void bridges::datastructure::Polyline::addPoint ( float  x,
float  y 
)
inline

This method adds a point to the polyline.

Parameters
x,y: X, Y coordinates of the point

◆ getCenter()

void bridges::datastructure::Polyline::getCenter ( float *  center)
inline

Get center of polyline - use its bounding box.

Parameters
[out]centerof the polyline to be returned

◆ getDataStructType()

string bridges::datastructure::Polyline::getDataStructType ( )
inline

Get the name of the data type.

Returns
name of symbol type

◆ getDimensions()

vector<float> bridges::datastructure::Polyline::getDimensions ( ) const
inlinevirtual

This method returns the dimensions of the shape: min and max values in X and Y.

Returns
array of 4 values

Implements bridges::datastructure::Symbol.

◆ getName()

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

This method gets the name of the shape.

Returns
name shape name

◆ getPoints()

vector<float> bridges::datastructure::Polyline::getPoints ( )
inline

This method returns the point list of the polyline.

Returns
points point list of the polygon - sequence of x, y values

◆ getSymbolRepresentation()

const string bridges::datastructure::Polyline::getSymbolRepresentation ( ) const
inlinevirtual

This method returns the JSON representation of the shape.

Returns
string JSON string

Implements bridges::datastructure::Symbol.

◆ rotate()

void bridges::datastructure::Polyline::rotate ( float  angle)
inline

rotate the polyline about its center

Parameters
anglerotation angle in degrees (positive is counter-clock wise, negative is clockwise)

◆ scale()

void bridges::datastructure::Polyline::scale ( float  sx,
float  sy 
)
inline

Scale the polyline about its center.

Parameters
sx,syscale factor along each axis

◆ setPolyline()

void bridges::datastructure::Polyline::setPolyline ( vector< float >  pts)
inline

Construct a polyline from sequence of points.

Parameters
ptspoint sequence

◆ translate()

void bridges::datastructure::Polyline::translate ( float  tx,
float  ty 
)
inline

Translate the polyline.

Parameters
tx,tytranslation vector

Member Data Documentation

◆ points

vector<float> bridges::datastructure::Polyline::points
protected

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