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

#include <POI.h>

Collaboration diagram for libsumo::POI:
[legend]

Static Public Member Functions

static bool add (const std::string &poiID, double x, double y, const TraCIColor &color, const std::string &poiType="", int layer=0, const std::string &imgFile=Shape::DEFAULT_IMG_FILE, double width=Shape::DEFAULT_IMG_WIDTH, double height=Shape::DEFAULT_IMG_HEIGHT, double angle=Shape::DEFAULT_ANGLE)
 
static void cleanup ()
 
static double getAngle (const std::string &poiID)
 
static TraCIColor getColor (const std::string &poiID)
 
static double getHeight (const std::string &poiID)
 
static std::string getImageFile (const std::string &poiID)
 
static TraCIPosition getPosition (const std::string &poiID, const bool includeZ=false)
 
static NamedRTreegetTree ()
 Returns a tree filled with PoI instances. More...
 
static std::string getType (const std::string &poiID)
 
static double getWidth (const std::string &poiID)
 
static bool handleVariable (const std::string &objID, const int variable, VariableWrapper *wrapper)
 
static void highlight (const std::string &poiID, const TraCIColor &col=TraCIColor(255, 0, 0, 255), double size=-1, const int alphaMax=-1, const double duration=-1, const int type=0)
 
static std::shared_ptr< VariableWrappermakeWrapper ()
 
static bool remove (const std::string &poiID, int layer=0)
 
static void setAngle (const std::string &poiID, double angle)
 
static void setColor (const std::string &poiID, const TraCIColor &color)
 
static void setHeight (const std::string &poiID, double height)
 
static void setImageFile (const std::string &poiID, const std::string &imageFile)
 
static void setPosition (const std::string &poiID, double x, double y)
 
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void setType (const std::string &poiID, const std::string &setType)
 
static void setWidth (const std::string &poiID, double width)
 
static void storeShape (const std::string &id, PositionVector &shape)
 Saves the shape of the requested object in the given container. More...
 

Private Member Functions

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

Static Private Member Functions

static PointOfInterestgetPoI (const std::string &id)
 

Static Private Attributes

static ContextSubscriptionResults myContextSubscriptionResults
 
static SubscriptionResults mySubscriptionResults
 
static NamedRTreemyTree
 

Detailed Description

Definition at line 50 of file POI.h.

Constructor & Destructor Documentation

◆ POI()

libsumo::POI::POI ( )
privatedelete

invalidated standard constructor

Member Function Documentation

◆ add()

bool POI::add ( const std::string &  poiID,
double  x,
double  y,
const TraCIColor color,
const std::string &  poiType = "",
int  layer = 0,
const std::string &  imgFile = Shape::DEFAULT_IMG_FILE,
double  width = Shape::DEFAULT_IMG_WIDTH,
double  height = Shape::DEFAULT_IMG_HEIGHT,
double  angle = Shape::DEFAULT_ANGLE 
)
static

Definition at line 159 of file POI.cpp.

References ShapeContainer::addPOI(), Shape::DEFAULT_RELATIVEPATH, NamedObjectCont< T >::get(), MSNet::getInstance(), ShapeContainer::getPOIs(), MSNet::getShapeContainer(), NamedRTree::Insert(), libsumo::Helper::makeRGBColor(), myTree, Position::x(), and Position::y().

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ cleanup()

void POI::cleanup ( )
static

Definition at line 282 of file POI.cpp.

References myTree.

Referenced by libsumo::Helper::cleanup().

Here is the caller graph for this function:

◆ getAngle()

double POI::getAngle ( const std::string &  poiID)
static

Definition at line 94 of file POI.cpp.

References getPoI(), and Shape::getShapeNaviDegree().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getColor()

TraCIColor POI::getColor ( const std::string &  poiID)
static

Definition at line 70 of file POI.cpp.

References getPoI(), and libsumo::Helper::makeTraCIColor().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getHeight()

double POI::getHeight ( const std::string &  poiID)
static

Definition at line 88 of file POI.cpp.

References PointOfInterest::getHeight(), and getPoI().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getImageFile()

std::string POI::getImageFile ( const std::string &  poiID)
static

Definition at line 100 of file POI.cpp.

References getPoI(), and Shape::getShapeImgFile().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getPoI()

PointOfInterest * POI::getPoI ( const std::string &  id)
staticprivate

Definition at line 258 of file POI.cpp.

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

Referenced by getAngle(), getColor(), getHeight(), getImageFile(), getPosition(), getType(), getWidth(), highlight(), setAngle(), setColor(), setHeight(), setImageFile(), setPosition(), setType(), setWidth(), and storeShape().

Here is the caller graph for this function:

◆ getPosition()

TraCIPosition POI::getPosition ( const std::string &  poiID,
const bool  includeZ = false 
)
static

Definition at line 76 of file POI.cpp.

References getPoI(), and libsumo::Helper::makeTraCIPosition().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getTree()

NamedRTree * POI::getTree ( )
static

Returns a tree filled with PoI instances.

Returns
The rtree of PoIs

Definition at line 268 of file POI.cpp.

References MSNet::getInstance(), ShapeContainer::getPOIs(), MSNet::getShapeContainer(), NamedRTree::Insert(), and myTree.

Referenced by libsumo::Helper::collectObjectsInRange().

Here is the caller graph for this function:

◆ getType()

std::string POI::getType ( const std::string &  poiID)
static

Definition at line 64 of file POI.cpp.

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

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getWidth()

double POI::getWidth ( const std::string &  poiID)
static

Definition at line 82 of file POI.cpp.

References getPoI(), and PointOfInterest::getWidth().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ handleVariable()

◆ highlight()

void POI::highlight ( const std::string &  poiID,
const TraCIColor col = TraCIColor(255, 0, 0, 255),
double  size = -1,
const int  alphaMax = -1,
const double  duration = -1,
const int  type = 0 
)
static

Definition at line 193 of file POI.cpp.

References libsumo::Polygon::addDynamics(), libsumo::Polygon::addHighlightPolygon(), libsumo::Polygon::exists(), PointOfInterest::getHeight(), Named::getID(), MSNet::getInstance(), getPoI(), Shape::getShapeLayer(), PointOfInterest::getWidth(), GeomHelper::makeRing(), libsumo::Helper::makeTraCIPositionVector(), MIN2(), SIMTIME, and toString().

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ makeWrapper()

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

Definition at line 295 of file POI.cpp.

References handleVariable(), myContextSubscriptionResults, and mySubscriptionResults.

Referenced by libsumo::Helper::handleSingleSubscription().

Here is the caller graph for this function:

◆ remove()

bool POI::remove ( const std::string &  poiID,
int  layer = 0 
)
static

Definition at line 180 of file POI.cpp.

References NamedObjectCont< T >::get(), MSNet::getInstance(), ShapeContainer::getPOIs(), MSNet::getShapeContainer(), myTree, NamedRTree::Remove(), ShapeContainer::removePOI(), Position::x(), and Position::y().

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ setAngle()

void POI::setAngle ( const std::string &  poiID,
double  angle 
)
static

Definition at line 147 of file POI.cpp.

References getPoI(), and Shape::setShapeNaviDegree().

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ setColor()

void POI::setColor ( const std::string &  poiID,
const TraCIColor color 
)
static

Definition at line 129 of file POI.cpp.

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

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ setHeight()

void POI::setHeight ( const std::string &  poiID,
double  height 
)
static

Definition at line 141 of file POI.cpp.

References getPoI(), and PointOfInterest::setHeight().

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ setImageFile()

void POI::setImageFile ( const std::string &  poiID,
const std::string &  imageFile 
)
static

Definition at line 153 of file POI.cpp.

References getPoI(), and Shape::setShapeImgFile().

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ setPosition()

void POI::setPosition ( const std::string &  poiID,
double  x,
double  y 
)
static

Definition at line 121 of file POI.cpp.

References MSNet::getInstance(), getPoI(), MSNet::getShapeContainer(), and ShapeContainer::movePOI().

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ setType()

void POI::setType ( const std::string &  poiID,
const std::string &  setType 
)
static

Definition at line 115 of file POI.cpp.

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

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ setWidth()

void POI::setWidth ( const std::string &  poiID,
double  width 
)
static

Definition at line 135 of file POI.cpp.

References getPoI(), and PointOfInterest::setWidth().

Referenced by TraCIServerAPI_POI::processSet().

Here is the caller graph for this function:

◆ storeShape()

void POI::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 289 of file POI.cpp.

References getPoI().

Referenced by libsumo::Helper::findObjectShape().

Here is the caller graph for this function:

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults POI::myContextSubscriptionResults
staticprivate

Definition at line 97 of file POI.h.

Referenced by makeWrapper().

◆ mySubscriptionResults

SubscriptionResults POI::mySubscriptionResults
staticprivate

Definition at line 96 of file POI.h.

Referenced by makeWrapper().

◆ myTree

NamedRTree * POI::myTree
staticprivate

Definition at line 98 of file POI.h.

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


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