SUMO - Simulation of Urban MObility
ShapeContainer Class Reference

Storage for geometrical objects. More...

#include <ShapeContainer.h>

Inheritance diagram for ShapeContainer:
Inheritance graph
Collaboration diagram for ShapeContainer:
Collaboration graph

Public Types

typedef NamedObjectCont< PointOfInterest * > POIs
 
typedef NamedObjectCont< SUMOPolygon * > Polygons
 containers More...
 

Public Member Functions

virtual bool addPOI (const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, double width, double height, bool ignorePruning=false)
 Builds a POI using the given values and adds it to the container. More...
 
virtual bool addPolygon (const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, const PositionVector &shape, bool geo, bool fill, bool ignorePruning=false)
 Builds a polygon using the given values and adds it to the container. More...
 
const POIsgetPOIs () const
 Returns all pois. More...
 
const PolygonsgetPolygons () const
 Returns all polygons. More...
 
virtual void movePOI (const std::string &id, const Position &pos)
 Assigns a new position to the named PoI. More...
 
virtual bool removePOI (const std::string &id)
 Removes a PoI from the container. More...
 
virtual bool removePolygon (const std::string &id)
 Removes a polygon from the container. More...
 
virtual void reshapePolygon (const std::string &id, const PositionVector &shape)
 Assigns a shape to the named polygon. More...
 
 ShapeContainer ()
 Constructor. More...
 
virtual ~ShapeContainer ()
 Destructor. More...
 

Protected Member Functions

virtual bool add (SUMOPolygon *poly, bool ignorePruning=false)
 add polygon More...
 
virtual bool add (PointOfInterest *poi, bool ignorePruning=false)
 add poi More...
 

Protected Attributes

POIs myPOIs
 stored POIs More...
 
Polygons myPolygons
 stored Polygons More...
 

Detailed Description

Storage for geometrical objects.

Definition at line 47 of file ShapeContainer.h.

Member Typedef Documentation

◆ POIs

◆ Polygons

containers

Definition at line 51 of file ShapeContainer.h.

Constructor & Destructor Documentation

◆ ShapeContainer()

ShapeContainer::ShapeContainer ( )

Constructor.

Definition at line 50 of file ShapeContainer.cpp.

◆ ~ShapeContainer()

ShapeContainer::~ShapeContainer ( )
virtual

Destructor.

Definition at line 52 of file ShapeContainer.cpp.

Member Function Documentation

◆ add() [1/2]

bool ShapeContainer::add ( SUMOPolygon poly,
bool  ignorePruning = false 
)
protectedvirtual

add polygon

Reimplemented in PCPolyContainer.

Definition at line 102 of file ShapeContainer.cpp.

References NamedObjectCont< T >::add(), Named::getID(), and myPolygons.

Referenced by PCPolyContainer::add(), addPOI(), addPolygon(), and getPOIs().

◆ add() [2/2]

bool ShapeContainer::add ( PointOfInterest poi,
bool  ignorePruning = false 
)
protectedvirtual

add poi

Reimplemented in PCPolyContainer.

Definition at line 112 of file ShapeContainer.cpp.

References NamedObjectCont< T >::add(), Named::getID(), and myPOIs.

◆ addPOI()

bool ShapeContainer::addPOI ( const std::string &  id,
const std::string &  type,
const RGBColor color,
const Position pos,
bool  geo,
const std::string &  lane,
double  posOverLane,
double  posLat,
double  layer,
double  angle,
const std::string &  imgFile,
double  width,
double  height,
bool  ignorePruning = false 
)
virtual

Builds a POI using the given values and adds it to the container.

Parameters
[in]idThe name of the POI
[in]typeThe (abstract) type of the POI
[in]colorThe color of the POI
[in]posThe position of the POI

Reimplemented in GNENet, and GUIShapeContainer.

Definition at line 64 of file ShapeContainer.cpp.

References add().

Referenced by libsumo::POI::add(), and ShapeHandler::addPOI().

◆ addPolygon()

bool ShapeContainer::addPolygon ( const std::string &  id,
const std::string &  type,
const RGBColor color,
double  layer,
double  angle,
const std::string &  imgFile,
const PositionVector shape,
bool  geo,
bool  fill,
bool  ignorePruning = false 
)
virtual

Builds a polygon using the given values and adds it to the container.

Parameters
[in]idThe name of the polygon
[in]typeThe (abstract) type of the polygon
[in]colorThe color of the polygon
[in]layerThe layer of the polygon
[in]angleThe rotation of the polygon
[in]imgFileThe raster image of the polygon
[in]shapeThe shape of the polygon
[in]geospecify if shape was loaded as GEO coordinate
[in]fillWhether the polygon shall be filled
Returns
whether the polygon could be added

Reimplemented in GNENet, and GUIShapeContainer.

Definition at line 55 of file ShapeContainer.cpp.

References add().

Referenced by libsumo::Polygon::add(), NLHandler::addDistrict(), and ShapeHandler::addPoly().

◆ getPOIs()

◆ getPolygons()

◆ movePOI()

void ShapeContainer::movePOI ( const std::string &  id,
const Position pos 
)
virtual

Assigns a new position to the named PoI.

Parameters
[in]idThe id of the PoI to move
[in]posThe PoI's new position

Reimplemented in GUIShapeContainer.

Definition at line 84 of file ShapeContainer.cpp.

References NamedObjectCont< T >::get(), and myPOIs.

◆ removePOI()

bool ShapeContainer::removePOI ( const std::string &  id)
virtual

Removes a PoI from the container.

Parameters
[in]idThe id of the PoI
Returns
Whether the poi could be removed

Reimplemented in GUIShapeContainer.

Definition at line 78 of file ShapeContainer.cpp.

References myPOIs, and NamedObjectCont< T >::remove().

Referenced by libsumo::POI::remove(), and GNEChange_Attribute::~GNEChange_Attribute().

◆ removePolygon()

bool ShapeContainer::removePolygon ( const std::string &  id)
virtual

Removes a polygon from the container.

Parameters
[in]idThe id of the polygon
Returns
Whether the polygon could be removed

Reimplemented in GUIShapeContainer.

Definition at line 72 of file ShapeContainer.cpp.

References myPolygons, and NamedObjectCont< T >::remove().

Referenced by libsumo::Polygon::remove(), and GNEChange_Attribute::~GNEChange_Attribute().

◆ reshapePolygon()

void ShapeContainer::reshapePolygon ( const std::string &  id,
const PositionVector shape 
)
virtual

Assigns a shape to the named polygon.

Parameters
[in]idThe id of the polygon to reshape
[in]shapeThe polygon's new shape

Reimplemented in GUIShapeContainer.

Definition at line 93 of file ShapeContainer.cpp.

References NamedObjectCont< T >::get(), myPolygons, and SUMOPolygon::setShape().

Referenced by libsumo::Polygon::setShape().

Field Documentation

◆ myPOIs

◆ myPolygons


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