SUMO - Simulation of Urban MObility
libsumo::Polygon Class Reference

#include <Polygon.h>

Collaboration diagram for libsumo::Polygon:
Collaboration graph

Static Public Member Functions

static void add (const std::string &polygonID, const TraCIPositionVector &shape, const TraCIColor &color, bool fill=false, double lineWidth=1, const std::string &polygonType="", int layer=0)
 
static TraCIColor getColor (const std::string &polygonID)
 
static bool getFilled (const std::string &polygonID)
 
static int getIDCount ()
 
static std::vector< std::string > getIDList ()
 
static double getLineWidth (const std::string &polygonID)
 
static std::string getParameter (const std::string &polygonID, const std::string &key)
 
static TraCIPositionVector getShape (const std::string &polygonID)
 
static LIBSUMO_SUBSCRIPTION_API NamedRTreegetTree ()
 Returns a tree filled with polygon instances. More...
 
static std::string getType (const std::string &polygonID)
 
static bool handleVariable (const std::string &objID, const int variable, VariableWrapper *wrapper)
 
static std::shared_ptr< VariableWrappermakeWrapper ()
 
static void remove (const std::string &polygonID, int layer=0)
 
static void setColor (const std::string &polygonID, const TraCIColor &c)
 
static void setFilled (std::string polygonID, bool filled)
 
static void setLineWidth (std::string polygonID, double lineWidth)
 
static void setParameter (const std::string &polygonID, const std::string &key, const std::string &value)
 
static void setShape (const std::string &polygonID, const TraCIPositionVector &shape)
 
static void setType (const std::string &polygonID, const std::string &setType)
 
static void storeShape (const std::string &id, PositionVector &shape)
 Saves the shape of the requested object in the given container. More...
 

Private Member Functions

 Polygon ()=delete
 invalidated standard constructor More...
 

Static Private Member Functions

static SUMOPolygongetPolygon (const std::string &id)
 

Static Private Attributes

static ContextSubscriptionResults myContextSubscriptionResults
 
static SubscriptionResults mySubscriptionResults
 

Detailed Description

Definition at line 46 of file Polygon.h.

Constructor & Destructor Documentation

◆ Polygon()

libsumo::Polygon::Polygon ( )
privatedelete

invalidated standard constructor

Member Function Documentation

◆ add()

void Polygon::add ( const std::string &  polygonID,
const TraCIPositionVector shape,
const TraCIColor color,
bool  fill = false,
double  lineWidth = 1,
const std::string &  polygonType = "",
int  layer = 0 
)
static

◆ getColor()

TraCIColor Polygon::getColor ( const std::string &  polygonID)
static

Definition at line 81 of file Polygon.cpp.

References getPolygon(), Shape::getShapeColor(), and libsumo::Helper::makeTraCIColor().

Referenced by handleVariable().

◆ getFilled()

bool Polygon::getFilled ( const std::string &  polygonID)
static

Definition at line 71 of file Polygon.cpp.

References SUMOPolygon::getFill(), and getPolygon().

Referenced by handleVariable().

◆ getIDCount()

int Polygon::getIDCount ( )
static

Definition at line 52 of file Polygon.cpp.

References getIDList().

Referenced by handleVariable().

◆ getIDList()

std::vector< std::string > Polygon::getIDList ( )
static

◆ getLineWidth()

double Polygon::getLineWidth ( const std::string &  polygonID)
static

Definition at line 76 of file Polygon.cpp.

References SUMOPolygon::getLineWidth(), and getPolygon().

Referenced by handleVariable().

◆ getParameter()

std::string Polygon::getParameter ( const std::string &  polygonID,
const std::string &  key 
)
static

Definition at line 88 of file Polygon.cpp.

References Parameterised::getParameter(), and getPolygon().

Referenced by TraCIServerAPI_Polygon::processGet().

◆ getPolygon()

◆ getShape()

TraCIPositionVector Polygon::getShape ( const std::string &  polygonID)
static

◆ getTree()

NamedRTree * Polygon::getTree ( )
static

Returns a tree filled with polygon instances.

Returns
The rtree of polygons

Definition at line 170 of file Polygon.cpp.

References MSNet::getInstance(), ShapeContainer::getPolygons(), MSNet::getShapeContainer(), NamedRTree::Insert(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

◆ getType()

std::string Polygon::getType ( const std::string &  polygonID)
static

Definition at line 58 of file Polygon.cpp.

References getPolygon(), and Shape::getShapeType().

Referenced by handleVariable().

◆ handleVariable()

◆ makeWrapper()

std::shared_ptr< VariableWrapper > Polygon::makeWrapper ( )
static

◆ remove()

void Polygon::remove ( const std::string &  polygonID,
int  layer = 0 
)
static

◆ setColor()

void Polygon::setColor ( const std::string &  polygonID,
const TraCIColor c 
)
static

◆ setFilled()

void Polygon::setFilled ( std::string  polygonID,
bool  filled 
)
static

Definition at line 137 of file Polygon.cpp.

References getPolygon(), and SUMOPolygon::setFill().

Referenced by TraCIServerAPI_Polygon::processSet().

◆ setLineWidth()

void Polygon::setLineWidth ( std::string  polygonID,
double  lineWidth 
)
static

Definition at line 143 of file Polygon.cpp.

References getPolygon(), and SUMOPolygon::setLineWidth().

Referenced by TraCIServerAPI_Polygon::processSet().

◆ setParameter()

void Polygon::setParameter ( const std::string &  polygonID,
const std::string &  key,
const std::string &  value 
)
static

◆ setShape()

void Polygon::setShape ( const std::string &  polygonID,
const TraCIPositionVector shape 
)
static

◆ setType()

void Polygon::setType ( const std::string &  polygonID,
const std::string &  setType 
)
static

Definition at line 94 of file Polygon.cpp.

References getPolygon(), and Shape::setShapeType().

Referenced by TraCIServerAPI_Polygon::processSet().

◆ storeShape()

void Polygon::storeShape ( const std::string &  id,
PositionVector shape 
)
static

Saves the shape of the requested object in the given container.

Parameters
idThe id of the poi to retrieve
shapeThe container to fill

Definition at line 184 of file Polygon.cpp.

References getPolygon(), and SUMOPolygon::getShape().

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults Polygon::myContextSubscriptionResults
staticprivate

Definition at line 88 of file Polygon.h.

Referenced by makeWrapper().

◆ mySubscriptionResults

SubscriptionResults Polygon::mySubscriptionResults
staticprivate

Definition at line 87 of file Polygon.h.

Referenced by makeWrapper().


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