|
SUMO - Simulation of Urban MObility
|
Storage for geometrical objects extended by mutexes. More...
#include <GUIShapeContainer.h>
Public Member Functions | |
| virtual bool | addPoI (const std::string &name, int layer, const std::string &type, const RGBColor &c, const Position &pos) throw () |
| 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) throw () |
| Builds a polygon using the given values and adds it to the according layer. | |
| int | getMaxLayer () const throw () |
| Returns the highest layer. | |
| int | getMinLayer () const throw () |
| Returns the lowest layer. | |
| const NamedObjectCont < PointOfInterest * > & | getPOICont (int layer) const throw () |
| Returns the polygons located at the given layer. | |
| const NamedObjectCont< Polygon * > & | getPolygonCont (int layer) const throw () |
| Returns the polygons located at the given layer. | |
| std::vector< GUIGlID > | getShapeIDs () const |
| Returns the gl-ids of all shapes. | |
| GUIShapeContainer (SUMORTree &vis) throw () | |
| Constructor. | |
| void | movePoI (int layer, const std::string &id, const Position &pos) throw () |
| Assigns a new position to the named PoI. | |
| bool | removePoI (int layer, const std::string &id) throw () |
| Removes a PoI from the container. | |
| bool | removePolygon (int layer, const std::string &id) throw () |
| Removes a polygon from the container. | |
| void | reshapePolygon (int layer, const std::string &id, const PositionVector &shape) throw () |
| Assigns a shape to the named polygon. | |
| virtual | ~GUIShapeContainer () throw () |
| Destructor. | |
Protected Types | |
| typedef std::map< std::string, Polygon * > | PolyMap |
Protected Member Functions | |
| bool | add (int layer, Polygon *p) throw () |
| Adds a polygon to the container. | |
| bool | add (int layer, PointOfInterest *p) throw () |
| 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. | |
Private Attributes | |
| MFXMutex | myLock |
| The mutex for adding/removing operations. | |
| SUMORTree & | myVis |
| The RTree structure to add and remove visualization elements. | |
Storage for geometrical objects extended by mutexes.
Definition at line 52 of file GUIShapeContainer.h.
typedef std::map<std::string, Polygon*> ShapeContainer::PolyMap [protected, inherited] |
Definition at line 176 of file ShapeContainer.h.
| GUIShapeContainer::GUIShapeContainer | ( | SUMORTree & | vis | ) | throw () |
Constructor.
Definition at line 43 of file GUIShapeContainer.cpp.
| GUIShapeContainer::~GUIShapeContainer | ( | ) | throw () [virtual] |
Destructor.
Definition at line 47 of file GUIShapeContainer.cpp.
Adds a polygon to the container.
| [in] | layer | The layer the polygon is located in |
| [in] | p | The polygon to add |
Definition at line 151 of file ShapeContainer.cpp.
| bool ShapeContainer::add | ( | int | layer, |
| PointOfInterest * | p | ||
| ) | throw () [protected, inherited] |
Adds a PoI to the container.
| [in] | layer | The layer the poi is located in |
| [in] | p | The PoI to add |
Definition at line 162 of file ShapeContainer.cpp.
| bool GUIShapeContainer::addPoI | ( | const std::string & | name, |
| int | layer, | ||
| const std::string & | type, | ||
| const RGBColor & | c, | ||
| const Position & | pos | ||
| ) | throw () [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 from ShapeContainer.
Definition at line 51 of file GUIShapeContainer.cpp.
| bool GUIShapeContainer::addPolygon | ( | const std::string & | name, |
| int | layer, | ||
| const std::string & | type, | ||
| const RGBColor & | c, | ||
| bool | filled, | ||
| const PositionVector & | shape | ||
| ) | throw () [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] | pos | The position of the polygon to add |
Reimplemented from ShapeContainer.
Definition at line 67 of file GUIShapeContainer.cpp.
| int ShapeContainer::getMaxLayer | ( | ) | const throw () [inline, inherited] |
Returns the highest layer.
Definition at line 153 of file ShapeContainer.h.
References ShapeContainer::myMaxLayer.
Referenced by TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processSet(), and TraCIServerAPI_POI::processSet().
| int ShapeContainer::getMinLayer | ( | ) | const throw () [inline, inherited] |
Returns the lowest layer.
Definition at line 145 of file ShapeContainer.h.
References ShapeContainer::myMinLayer.
Referenced by TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processSet(), and TraCIServerAPI_POI::processSet().
| const NamedObjectCont< PointOfInterest * > & ShapeContainer::getPOICont | ( | int | layer | ) | const throw () [inherited] |
Returns the polygons located at the given layer.
| [in] | layer | The layer of polygons to return |
Definition at line 139 of file ShapeContainer.cpp.
References MAX2(), and MIN2().
Referenced by getShapeIDs(), TraCIServerAPI_POI::processGet(), and TraCIServerAPI_POI::processSet().
| const NamedObjectCont< Polygon * > & ShapeContainer::getPolygonCont | ( | int | layer | ) | const throw () [inherited] |
Returns the polygons located at the given layer.
| [in] | layer | The layer of polygons to return |
Definition at line 128 of file ShapeContainer.cpp.
References MAX2(), and MIN2().
Referenced by getShapeIDs(), TraCIServerAPI_Polygon::processGet(), and TraCIServerAPI_Polygon::processSet().
| std::vector< GUIGlID > GUIShapeContainer::getShapeIDs | ( | ) | const |
Returns the gl-ids of all shapes.
Definition at line 154 of file GUIShapeContainer.cpp.
References ShapeContainer::getPOICont(), ShapeContainer::getPolygonCont(), ShapeContainer::myMaxLayer, and ShapeContainer::myMinLayer.
| void GUIShapeContainer::movePoI | ( | int | layer, |
| const std::string & | id, | ||
| const Position & | pos | ||
| ) | throw () [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 from ShapeContainer.
Definition at line 124 of file GUIShapeContainer.cpp.
| bool GUIShapeContainer::removePoI | ( | int | layer, |
| const std::string & | id | ||
| ) | throw () [virtual] |
Removes a PoI from the container.
| [in] | layer | The layer the PoI is located in |
| [in] | id | The id of the PoI |
Reimplemented from ShapeContainer.
Definition at line 84 of file GUIShapeContainer.cpp.
References NamedObjectCont< T >::get(), and NamedObjectCont< T >::remove().
| bool GUIShapeContainer::removePolygon | ( | int | layer, |
| const std::string & | id | ||
| ) | throw () [virtual] |
Removes a polygon from the container.
| [in] | layer | The layer the polygon is located in |
| [in] | id | The id of the polygon |
Reimplemented from ShapeContainer.
Definition at line 104 of file GUIShapeContainer.cpp.
| void GUIShapeContainer::reshapePolygon | ( | int | layer, |
| const std::string & | id, | ||
| const PositionVector & | shape | ||
| ) | throw () [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 from ShapeContainer.
Definition at line 139 of file GUIShapeContainer.cpp.
References Polygon::setShape().
MFXMutex GUIShapeContainer::myLock [private] |
The mutex for adding/removing operations.
Definition at line 132 of file GUIShapeContainer.h.
int ShapeContainer::myMaxLayer [mutable, protected, inherited] |
Definition at line 184 of file ShapeContainer.h.
Referenced by ShapeContainer::getMaxLayer(), and getShapeIDs().
int ShapeContainer::myMinLayer [mutable, protected, inherited] |
The minimum and the maximum layers.
Definition at line 184 of file ShapeContainer.h.
Referenced by ShapeContainer::getMinLayer(), and getShapeIDs().
std::map<int, NamedObjectCont<PointOfInterest*> > ShapeContainer::myPOILayers [mutable, protected, inherited] |
POI layers.
Definition at line 181 of file ShapeContainer.h.
std::map<int, NamedObjectCont<Polygon*> > ShapeContainer::myPolygonLayers [mutable, protected, inherited] |
Polygon layers.
Definition at line 178 of file ShapeContainer.h.
SUMORTree& GUIShapeContainer::myVis [private] |
The RTree structure to add and remove visualization elements.
Definition at line 135 of file GUIShapeContainer.h.