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

#include <Polygon.h>

Collaboration diagram for LIBSUMO_NAMESPACE::Polygon:
[legend]

Static Public Member Functions

static void add (const std::string &polygonID, const libsumo::TraCIPositionVector &shape, const libsumo::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 &trackedObjectID="", 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 libsumo::TraCIPositionVector &shape, const libsumo::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 libsumo::TraCIColor getColor (const std::string &polygonID)
 
static bool getFilled (const std::string &polygonID)
 
static double getLineWidth (const std::string &polygonID)
 
static libsumo::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, tcpip::Storage *paramData)
 
static std::shared_ptr< VariableWrapper > makeWrapper ()
 
static void remove (const std::string &polygonID, int layer=0)
 
static void setColor (const std::string &polygonID, const libsumo::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 libsumo::TraCIPositionVector &shape)
 
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void setType (const std::string &polygonID, const std::string &polygonType)
 
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 42 of file Polygon.h.

Constructor & Destructor Documentation

◆ Polygon()

LIBSUMO_NAMESPACE::Polygon::Polygon ( )
privatedelete

invalidated standard constructor

Member Function Documentation

◆ add()

◆ addDynamics()

void Polygon::addDynamics ( const std::string &  polygonID,
const std::string &  trackedObjectID = "",
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 libsumo::TraCIPositionVector shape,
const libsumo::TraCIColor color,
bool  fill,
const std::string &  polygonType,
int  layer,
double  lineWidth 
)
static

◆ cleanup()

void Polygon::cleanup ( )
static

Definition at line 279 of file libsumo/Polygon.cpp.

◆ exists()

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

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

Definition at line 326 of file libsumo/Polygon.cpp.

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

◆ getColor()

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

◆ getFilled()

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

Definition at line 75 of file libsumo/Polygon.cpp.

◆ getLineWidth()

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

Definition at line 80 of file libsumo/Polygon.cpp.

◆ getPolygon()

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

◆ getShape()

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

◆ 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 234 of file libsumo/Polygon.cpp.

References MSTransportableControl::get(), MSNet::getInstance(), MSNet::getPersonControl(), MSVehicleControl::getVehicle(), and MSNet::getVehicleControl().

◆ getTree()

NamedRTree * Polygon::getTree ( )
static

◆ getType()

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

Definition at line 62 of file libsumo/Polygon.cpp.

◆ handleVariable()

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

◆ makeWrapper()

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

Definition at line 291 of file libsumo/Polygon.cpp.

◆ remove()

◆ setColor()

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

Definition at line 116 of file libsumo/Polygon.cpp.

References libsumo::Helper::makeRGBColor().

◆ setFilled()

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

Definition at line 211 of file libsumo/Polygon.cpp.

References SUMOPolygon::setFill().

◆ setLineWidth()

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

Definition at line 217 of file libsumo/Polygon.cpp.

References SUMOPolygon::setLineWidth().

◆ setShape()

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

◆ setType()

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

Definition at line 101 of file libsumo/Polygon.cpp.

◆ 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 285 of file libsumo/Polygon.cpp.

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults Polygon::myContextSubscriptionResults
staticprivate

Definition at line 97 of file Polygon.h.

◆ mySubscriptionResults

SubscriptionResults Polygon::mySubscriptionResults
staticprivate

Definition at line 96 of file Polygon.h.

◆ myTree

NamedRTree * Polygon::myTree
staticprivate

Definition at line 98 of file Polygon.h.


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