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

Public Member Functions

 Polyline ()
 
 Polyline (vector< float > pts)
 
string getDataStructType ()
 
string getName () const
 
void addPoint (float x, float y)
 
vector< float > getPoints ()
 
void setPolyline (vector< float > pts)
 
void translate (float tx, float ty)
 Translate the polyline. More...
 
void rotate (float angle)
 rotate the polyline about its center l * More...
 
void scale (float sx, float sy)
 Scale the polyline about its center. More...
 
void getCenter (float *center)
 
vector< float > getDimensions () const
 
const string getSymbolRepresentation () const
 
- Public Member Functions inherited from bridges::datastructure::Symbol
 Symbol ()
 
 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 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
 

Constructor & Destructor Documentation

◆ Polyline() [1/2]

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

◆ 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

◆ 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 l *

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

◆ 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: