SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ShapeContainer Class Reference

Storage for geometrical objects. More...

#include <ShapeContainer.h>

Inheritance diagram for ShapeContainer:
GUIShapeContainer

Public Types

typedef NamedObjectCont
< PointOfInterest * > 
POIs
typedef NamedObjectCont
< Polygon * > 
Polygons

Public Member Functions

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

Protected Attributes

POIs myPOIs
 stored POIs
Polygons myPolygons
 stored Polygons

Detailed Description

Storage for geometrical objects.

Definition at line 55 of file ShapeContainer.h.

Member Typedef Documentation

Definition at line 64 of file ShapeContainer.h.

Constructor & Destructor Documentation

ShapeContainer::ShapeContainer ( )

Constructor.

Definition at line 56 of file ShapeContainer.cpp.

ShapeContainer::~ShapeContainer ( )
virtual

Destructor.

Definition at line 58 of file ShapeContainer.cpp.

Member Function Documentation

bool ShapeContainer::addPOI ( const std::string &  id,
const std::string &  type,
const RGBColor color,
SUMOReal  layer,
SUMOReal  angle,
const std::string &  imgFile,
const Position pos,
SUMOReal  width,
SUMOReal  height 
)
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]layerThe layer of the POI
[in]angleThe rotation of the POI
[in]imgFileThe raster image of the POI
[in]posThe position of the POI
[in]widthThe width of the POI image
[in]heightThe height of the POI image
Returns
whether the poi could be added

Reimplemented in GUIShapeContainer.

Definition at line 75 of file ShapeContainer.cpp.

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

Referenced by NLHandler::addPOI(), and TraCIServerAPI_POI::processSet().

bool ShapeContainer::addPolygon ( const std::string &  id,
const std::string &  type,
const RGBColor color,
SUMOReal  layer,
SUMOReal  angle,
const std::string &  imgFile,
const PositionVector shape,
bool  fill 
)
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]fillWhether the polygon shall be filled
Returns
whether the polygon could be added

Reimplemented in GUIShapeContainer.

Definition at line 61 of file ShapeContainer.cpp.

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

Referenced by NLHandler::addPoly(), and TraCIServerAPI_Polygon::processSet().

const POIs& ShapeContainer::getPOIs ( ) const
inline
const Polygons& ShapeContainer::getPolygons ( ) const
inline
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 101 of file ShapeContainer.cpp.

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

Referenced by TraCIServerAPI_POI::processSet().

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 94 of file ShapeContainer.cpp.

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

Referenced by TraCIServerAPI_POI::processSet().

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 88 of file ShapeContainer.cpp.

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

Referenced by TraCIServerAPI_Polygon::processSet().

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 110 of file ShapeContainer.cpp.

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

Referenced by TraCIServerAPI_Polygon::processSet().

Field Documentation

POIs ShapeContainer::myPOIs
protected
Polygons ShapeContainer::myPolygons
protected

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