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

#include <Polygon.h>

Collaboration diagram for libsumo::Polygon:
[legend]

Static Public Member Functions

static void add (const std::string &polygonID, const TraCIPositionVector &shape, const TraCIColor &color, bool fill=false, const std::string &polygonType="", int layer=0, double lineWidth=1)
 
static void addDynamics (const std::string &polygonID, const std::string &trackedID="", const std::vector< double > &timeSpan=std::vector< double >(), const std::vector< double > &alphaSpan=std::vector< double >(), bool looped=false, bool rotate=true)
 
static void addHighlightPolygon (const std::string &objectID, const int type, const std::string &polygonID, const TraCIPositionVector &shape, const TraCIColor &color, bool fill, const std::string &polygonType, int layer, double lineWidth)
 
static void cleanup ()
 
static bool exists (std::string polyID)
 Checks if a polygon of the given name exists already in the simulation. More...
 
static TraCIColor getColor (const std::string &polygonID)
 
static bool getFilled (const std::string &polygonID)
 
static double getLineWidth (const std::string &polygonID)
 
static TraCIPositionVector getShape (const std::string &polygonID)
 
static 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 &color)
 
static void setFilled (std::string polygonID, bool filled)
 
static void setLineWidth (std::string polygonID, double lineWidth)
 
static void setShape (const std::string &polygonID, const TraCIPositionVector &shape)
 
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API 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 SUMOTrafficObjectgetTrafficObject (const std::string &id)
 Obtain a traffic object with the given id if one exists. More...
 

Static Private Attributes

static ContextSubscriptionResults myContextSubscriptionResults
 
static SubscriptionResults mySubscriptionResults
 
static NamedRTreemyTree
 

Detailed Description

Definition at line 45 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,
const std::string &  polygonType = "",
int  layer = 0,
double  lineWidth = 1 
)
static

◆ addDynamics()

void Polygon::addDynamics ( const std::string &  polygonID,
const std::string &  trackedID = "",
const std::vector< double > &  timeSpan = std::vector<double>(),
const std::vector< double > &  alphaSpan = std::vector<double>(),
bool  looped = false,
bool  rotate = true 
)
static

◆ addHighlightPolygon()

void Polygon::addHighlightPolygon ( const std::string &  objectID,
const int  type,
const std::string &  polygonID,
const TraCIPositionVector shape,
const TraCIColor color,
bool  fill,
const std::string &  polygonType,
int  layer,
double  lineWidth 
)
static

Definition at line 142 of file Polygon.cpp.

References add(), MSNet::getInstance(), MSNet::getShapeContainer(), and ShapeContainer::registerHighlight().

Referenced by libsumo::POI::highlight(), and LIBSUMO_NAMESPACE::Vehicle::highlight().

Here is the caller graph for this function:

◆ cleanup()

void Polygon::cleanup ( )
static

Definition at line 281 of file Polygon.cpp.

References myTree.

◆ exists()

bool Polygon::exists ( std::string  polyID)
static

Checks if a polygon of the given name exists already in the simulation.

Definition at line 320 of file Polygon.cpp.

References NamedObjectCont< T >::get(), MSNet::getInstance(), ShapeContainer::getPolygons(), and MSNet::getShapeContainer().

Referenced by libsumo::POI::highlight(), and LIBSUMO_NAMESPACE::Vehicle::highlight().

Here is the caller graph for this function:

◆ getColor()

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

Definition at line 86 of file Polygon.cpp.

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

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getFilled()

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

Definition at line 76 of file Polygon.cpp.

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

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getLineWidth()

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

Definition at line 81 of file Polygon.cpp.

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

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getPolygon()

SUMOPolygon * Polygon::getPolygon ( const std::string &  id)
staticprivate

Definition at line 226 of file Polygon.cpp.

References NamedObjectCont< T >::get(), MSNet::getInstance(), ShapeContainer::getPolygons(), and MSNet::getShapeContainer().

Referenced by getColor(), getFilled(), getLineWidth(), getShape(), getTrafficObject(), getType(), setColor(), setFilled(), setLineWidth(), setShape(), setType(), and storeShape().

Here is the caller graph for this function:

◆ getShape()

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

Definition at line 69 of file Polygon.cpp.

References getPolygon(), SUMOPolygon::getShape(), and libsumo::Helper::makeTraCIPositionVector().

Referenced by TraCIServerAPI_Polygon::processGet().

Here is the caller graph for this function:

◆ getTrafficObject()

SUMOTrafficObject * Polygon::getTrafficObject ( const std::string &  id)
staticprivate

Obtain a traffic object with the given id if one exists.

Returns
Searches the domains Vehicle and Person for the given id (priorizes vehicles)

Definition at line 236 of file Polygon.cpp.

References MSTransportableControl::get(), MSNet::getInstance(), MSNet::getPersonControl(), getPolygon(), MSVehicleControl::getVehicle(), MSNet::getVehicleControl(), LIBSUMO_SUBSCRIPTION_IMPLEMENTATION, and Parameterised::setParameter().

Referenced by addDynamics().

Here is the caller graph for this function:

◆ getTree()

NamedRTree * Polygon::getTree ( )
static

Returns a tree filled with polygon instances.

Returns
The rtree of polygons

Definition at line 266 of file Polygon.cpp.

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

◆ getType()

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

Definition at line 63 of file Polygon.cpp.

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

Referenced by handleVariable().

Here is the caller graph for this function:

◆ handleVariable()

bool Polygon::handleVariable ( const std::string &  objID,
const int  variable,
VariableWrapper wrapper 
)
static

◆ makeWrapper()

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

◆ remove()

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

Definition at line 194 of file Polygon.cpp.

References NamedObjectCont< T >::get(), PositionVector::getBoxBoundary(), MSNet::getInstance(), ShapeContainer::getPolygons(), SUMOPolygon::getShape(), MSNet::getShapeContainer(), myTree, NamedRTree::Remove(), ShapeContainer::removePolygon(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

Referenced by TraCIServerAPI_Polygon::processSet().

Here is the caller graph for this function:

◆ setColor()

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

Definition at line 118 of file Polygon.cpp.

References getPolygon(), libsumo::Helper::makeRGBColor(), and Shape::setShapeColor().

Referenced by TraCIServerAPI_Polygon::processSet().

Here is the caller graph for this function:

◆ setFilled()

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

Definition at line 213 of file Polygon.cpp.

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

Referenced by TraCIServerAPI_Polygon::processSet().

Here is the caller graph for this function:

◆ setLineWidth()

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

Definition at line 219 of file Polygon.cpp.

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

Referenced by TraCIServerAPI_Polygon::processSet().

Here is the caller graph for this function:

◆ setShape()

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

Definition at line 109 of file Polygon.cpp.

References MSNet::getInstance(), getPolygon(), MSNet::getShapeContainer(), libsumo::Helper::makePositionVector(), and ShapeContainer::reshapePolygon().

Referenced by TraCIServerAPI_Polygon::processSet().

Here is the caller graph for this function:

◆ setType()

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

Definition at line 102 of file Polygon.cpp.

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

Referenced by TraCIServerAPI_Polygon::processSet().

Here is the caller graph for this function:

◆ 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 287 of file Polygon.cpp.

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

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults Polygon::myContextSubscriptionResults
staticprivate

Definition at line 98 of file Polygon.h.

Referenced by makeWrapper().

◆ mySubscriptionResults

SubscriptionResults Polygon::mySubscriptionResults
staticprivate

Definition at line 97 of file Polygon.h.

Referenced by makeWrapper().

◆ myTree

NamedRTree * Polygon::myTree
staticprivate

Definition at line 99 of file Polygon.h.

Referenced by add(), cleanup(), getTree(), and remove().


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