SUMO - Simulation of Urban MObility
|
Storage for geometrical objects, sorted by the layers they are in. More...
#include <ShapeContainer.h>
Public Member Functions | |
virtual bool | addPoI (const std::string &name, int layer, const std::string &type, const RGBColor &c, const Position &pos) |
Builds a PoI using the given values and adds it to the according layer. | |
virtual bool | addPolygon (const std::string &name, int layer, const std::string &type, const RGBColor &c, bool filled, const PositionVector &shape) |
Builds a polygon using the given values and adds it to the according layer. | |
int | getMaxLayer () const |
Returns the highest layer. | |
int | getMinLayer () const |
Returns the lowest layer. | |
const NamedObjectCont < PointOfInterest * > & | getPOICont (int layer) const |
Returns the polygons located at the given layer. | |
const NamedObjectCont< Polygon * > & | getPolygonCont (int layer) const |
Returns the polygons located at the given layer. | |
virtual void | movePoI (int layer, const std::string &id, const Position &pos) |
Assigns a new position to the named PoI. | |
virtual bool | removePoI (int layer, const std::string &id) |
Removes a PoI from the container. | |
virtual bool | removePolygon (int layer, const std::string &id) |
Removes a polygon from the container. | |
virtual void | reshapePolygon (int layer, const std::string &id, const PositionVector &shape) |
Assigns a shape to the named polygon. | |
ShapeContainer () | |
Constructor. | |
virtual | ~ShapeContainer () |
Destructor. | |
Protected Types | |
typedef std::map< std::string, Polygon * > | PolyMap |
Protected Member Functions | |
bool | add (int layer, Polygon *p) |
Adds a polygon to the container. | |
bool | add (int layer, PointOfInterest *p) |
Adds a PoI to the container. | |
Protected Attributes | |
int | myMaxLayer |
int | myMinLayer |
The minimum and the maximum layers. | |
std::map< int, NamedObjectCont < PointOfInterest * > > | myPOILayers |
POI layers. | |
std::map< int, NamedObjectCont < Polygon * > > | myPolygonLayers |
Polygon layers. |
Storage for geometrical objects, sorted by the layers they are in.
Definition at line 55 of file ShapeContainer.h.
typedef std::map<std::string, Polygon*> ShapeContainer::PolyMap [protected] |
Definition at line 178 of file ShapeContainer.h.
Constructor.
Definition at line 56 of file ShapeContainer.cpp.
ShapeContainer::~ShapeContainer | ( | ) | [virtual] |
Destructor.
Definition at line 60 of file ShapeContainer.cpp.
bool ShapeContainer::add | ( | int | layer, |
Polygon * | p | ||
) | [protected] |
Adds a polygon to the container.
[in] | layer | The layer the polygon is located in |
[in] | p | The polygon to add |
Definition at line 154 of file ShapeContainer.cpp.
References Polygon::getID(), MAX2(), MIN2(), myMaxLayer, myMinLayer, and myPolygonLayers.
Referenced by GUIShapeContainer::addPoI(), addPoI(), GUIShapeContainer::addPolygon(), and addPolygon().
bool ShapeContainer::add | ( | int | layer, |
PointOfInterest * | p | ||
) | [protected] |
Adds a PoI to the container.
[in] | layer | The layer the poi is located in |
[in] | p | The PoI to add |
Definition at line 165 of file ShapeContainer.cpp.
References Named::getID(), MAX2(), MIN2(), myMaxLayer, myMinLayer, and myPOILayers.
bool ShapeContainer::addPoI | ( | const std::string & | name, |
int | layer, | ||
const std::string & | type, | ||
const RGBColor & | c, | ||
const Position & | pos | ||
) | [virtual] |
Builds a PoI using the given values and adds it to the according layer.
[in] | name | The name of the PoI to add |
[in] | layer | The layer to add the PoI to |
[in] | type | The type of the PoI to add |
[in] | c | The color of the PoI to add |
[in] | pos | The position of the PoI to add |
Reimplemented in GUIShapeContainer.
Definition at line 64 of file ShapeContainer.cpp.
References add().
Referenced by NLHandler::addPOI(), and TraCIServerAPI_POI::processSet().
bool ShapeContainer::addPolygon | ( | const std::string & | name, |
int | layer, | ||
const std::string & | type, | ||
const RGBColor & | c, | ||
bool | filled, | ||
const PositionVector & | shape | ||
) | [virtual] |
Builds a polygon using the given values and adds it to the according layer.
[in] | name | The name of the polygon to add |
[in] | layer | The layer to add the polygon to |
[in] | type | The type of the polygon to add |
[in] | c | The color of the polygon to add |
[in] | shape | The shape of the polygon to add |
Reimplemented in GUIShapeContainer.
Definition at line 76 of file ShapeContainer.cpp.
References add().
Referenced by NLHandler::addPoly(), and TraCIServerAPI_Polygon::processSet().
int ShapeContainer::getMaxLayer | ( | ) | const [inline] |
Returns the highest layer.
Definition at line 155 of file ShapeContainer.h.
References myMaxLayer.
Referenced by TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Polygon::processSet(), and TraCIServerAPI_POI::processSet().
int ShapeContainer::getMinLayer | ( | ) | const [inline] |
Returns the lowest layer.
Definition at line 147 of file ShapeContainer.h.
References myMinLayer.
Referenced by TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Polygon::processSet(), and TraCIServerAPI_POI::processSet().
const NamedObjectCont< PointOfInterest * > & ShapeContainer::getPOICont | ( | int | layer | ) | const |
Returns the polygons located at the given layer.
[in] | layer | The layer of polygons to return |
Definition at line 142 of file ShapeContainer.cpp.
References MAX2(), MIN2(), myMaxLayer, myMinLayer, and myPOILayers.
Referenced by GUIShapeContainer::getShapeIDs(), TraCIServerAPI_POI::processGet(), and TraCIServerAPI_POI::processSet().
const NamedObjectCont< Polygon * > & ShapeContainer::getPolygonCont | ( | int | layer | ) | const |
Returns the polygons located at the given layer.
[in] | layer | The layer of polygons to return |
Definition at line 131 of file ShapeContainer.cpp.
References MAX2(), MIN2(), myMaxLayer, myMinLayer, and myPolygonLayers.
Referenced by GUIShapeContainer::getShapeIDs(), TraCIServerAPI_Polygon::processGet(), and TraCIServerAPI_Polygon::processSet().
void ShapeContainer::movePoI | ( | int | layer, |
const std::string & | id, | ||
const Position & | pos | ||
) | [virtual] |
Assigns a new position to the named PoI.
[in] | layer | The layer the PoI is located in |
[in] | id | The id of the PoI to move |
[in] | pos | The PoI's new position |
Reimplemented in GUIShapeContainer.
Definition at line 108 of file ShapeContainer.cpp.
References myPOILayers.
Referenced by TraCIServerAPI_POI::processSet().
bool ShapeContainer::removePoI | ( | int | layer, |
const std::string & | id | ||
) | [virtual] |
Removes a PoI from the container.
[in] | layer | The layer the PoI is located in |
[in] | id | The id of the PoI |
Reimplemented in GUIShapeContainer.
Definition at line 98 of file ShapeContainer.cpp.
References myPOILayers.
Referenced by TraCIServerAPI_POI::processSet().
bool ShapeContainer::removePolygon | ( | int | layer, |
const std::string & | id | ||
) | [virtual] |
Removes a polygon from the container.
[in] | layer | The layer the polygon is located in |
[in] | id | The id of the polygon |
Reimplemented in GUIShapeContainer.
Definition at line 89 of file ShapeContainer.cpp.
References myPolygonLayers.
Referenced by TraCIServerAPI_Polygon::processSet().
void ShapeContainer::reshapePolygon | ( | int | layer, |
const std::string & | id, | ||
const PositionVector & | shape | ||
) | [virtual] |
Assigns a shape to the named polygon.
[in] | layer | The layer the polygon is located in |
[in] | id | The id of the polygon to reshape |
[in] | shape | The polygon's new shape |
Reimplemented in GUIShapeContainer.
Definition at line 119 of file ShapeContainer.cpp.
References myPolygonLayers, and Polygon::setShape().
Referenced by TraCIServerAPI_Polygon::processSet().
int ShapeContainer::myMaxLayer [mutable, protected] |
Definition at line 186 of file ShapeContainer.h.
Referenced by add(), getMaxLayer(), getPOICont(), getPolygonCont(), and GUIShapeContainer::getShapeIDs().
int ShapeContainer::myMinLayer [mutable, protected] |
The minimum and the maximum layers.
Definition at line 186 of file ShapeContainer.h.
Referenced by add(), getMinLayer(), getPOICont(), getPolygonCont(), and GUIShapeContainer::getShapeIDs().
std::map<int, NamedObjectCont<PointOfInterest*> > ShapeContainer::myPOILayers [mutable, protected] |
POI layers.
Definition at line 183 of file ShapeContainer.h.
Referenced by add(), getPOICont(), movePoI(), GUIShapeContainer::movePoI(), removePoI(), and GUIShapeContainer::removePoI().
std::map<int, NamedObjectCont<Polygon*> > ShapeContainer::myPolygonLayers [mutable, protected] |
Polygon layers.
Definition at line 180 of file ShapeContainer.h.
Referenced by add(), getPolygonCont(), removePolygon(), GUIShapeContainer::removePolygon(), reshapePolygon(), and GUIShapeContainer::reshapePolygon().