Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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.
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.
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.

Private Member Functions

 Polygon ()=delete
 invalidated standard constructor

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.

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()

void Polygon::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

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

References add(), ShapeContainer::addPolygon(), Shape::DEFAULT_ANGLE, Shape::DEFAULT_IMG_FILE, NamedObjectCont< T >::get(), PositionVector::getBoxBoundary(), MSNet::getInstance(), ShapeContainer::getPolygons(), SUMOPolygon::getShape(), MSNet::getShapeContainer(), libsumo::Helper::makePositionVector(), libsumo::Helper::makeRGBColor(), and myTree.

Referenced by add(), and addHighlightPolygon().

Here is the caller graph for this function:

◆ 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

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

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

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

Here is the caller graph for this function:

◆ cleanup()

void Polygon::cleanup ( )
static

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

References cleanup(), and myTree.

Referenced by cleanup().

Here is the caller graph for this function:

◆ 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 exists(), NamedObjectCont< T >::get(), MSNet::getInstance(), ShapeContainer::getPolygons(), and MSNet::getShapeContainer().

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

Here is the caller graph for this function:

◆ getColor()

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

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

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

Referenced by getColor(), and handleVariable().

Here is the caller graph for this function:

◆ getFilled()

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

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

References getFilled(), and getPolygon().

Referenced by getFilled(), and handleVariable().

Here is the caller graph for this function:

◆ getLineWidth()

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

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

References getLineWidth(), and getPolygon().

Referenced by getLineWidth(), and handleVariable().

Here is the caller graph for this function:

◆ getPolygon()

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

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

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

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

Here is the caller graph for this function:

◆ getShape()

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

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

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

Referenced by getShape(), and handleVariable().

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

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

Referenced by addDynamics(), and getTrafficObject().

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

References MSNet::getInstance(), ShapeContainer::getPolygons(), MSNet::getShapeContainer(), getTree(), and myTree.

Referenced by getTree().

Here is the caller graph for this function:

◆ getType()

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

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

References getPolygon(), and getType().

Referenced by getType(), and handleVariable().

Here is the caller graph for this function:

◆ handleVariable()

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

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

References getColor(), getFilled(), getLineWidth(), getShape(), getType(), handleVariable(), libsumo::ID_COUNT, tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), libsumo::TRACI_ID_LIST, libsumo::VAR_COLOR, libsumo::VAR_FILL, libsumo::VAR_PARAMETER, libsumo::VAR_PARAMETER_WITH_KEY, libsumo::VAR_SHAPE, libsumo::VAR_TYPE, and libsumo::VAR_WIDTH.

Referenced by handleVariable(), and makeWrapper().

Here is the caller graph for this function:

◆ makeWrapper()

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

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

References handleVariable(), makeWrapper(), myContextSubscriptionResults, and mySubscriptionResults.

Referenced by makeWrapper().

Here is the caller graph for this function:

◆ remove()

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

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

References NamedObjectCont< T >::get(), PositionVector::getBoxBoundary(), MSNet::getInstance(), ShapeContainer::getPolygons(), SUMOPolygon::getShape(), MSNet::getShapeContainer(), myTree, remove(), and ShapeContainer::removePolygon().

Referenced by remove().

Here is the caller graph for this function:

◆ setColor()

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

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

References getPolygon(), libsumo::Helper::makeRGBColor(), and setColor().

Referenced by setColor().

Here is the caller graph for this function:

◆ setFilled()

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

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

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

Referenced by setFilled().

Here is the caller graph for this function:

◆ setLineWidth()

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

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

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

Referenced by setLineWidth().

Here is the caller graph for this function:

◆ setShape()

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

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

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

Referenced by setShape().

Here is the caller graph for this function:

◆ setType()

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

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

References getPolygon(), and setType().

Referenced by setType().

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

References getPolygon(), and storeShape().

Referenced by storeShape().

Here is the caller graph for this function:

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults Polygon::myContextSubscriptionResults
staticprivate

Definition at line 97 of file Polygon.h.

Referenced by makeWrapper().

◆ mySubscriptionResults

SubscriptionResults Polygon::mySubscriptionResults
staticprivate

Definition at line 96 of file Polygon.h.

Referenced by makeWrapper().

◆ myTree

NamedRTree * Polygon::myTree
staticprivate

Definition at line 98 of file Polygon.h.

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


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