45 #ifdef CHECK_MEMORY_LEAKS
47 #endif // CHECK_MEMORY_LEAKS
55 const std::vector<std::string>& removeByNames)
56 : myPrunningBoundary(prunningBoundary), myDoPrunne(prune),
57 myRemoveByNames(removeByNames) {}
67 int layer,
bool ignorePrunning) {
95 int layer,
bool ignorePrunning) {
110 POICont::iterator i =
myPOICont.find(
id);
170 const std::map<std::string, std::string>& attrs = p->
getMap();
171 if (attrs.size() != 0) {
172 for (std::map<std::string, std::string>::const_iterator j = attrs.begin(); j != attrs.end(); ++j) {
203 const std::map<std::string, std::string>& attrs = p->
getMap();
204 if (attrs.size() != 0) {
205 for (std::map<std::string, std::string>::const_iterator j = attrs.begin(); j != attrs.end(); ++j) {
void clear()
Removes all stored objects (polygons and pois)
bool insert(const std::string &id, Polygon *poly, int layer, bool ignorePrunning=false)
Adds a polygon to the storage.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
bool containsPolygon(const std::string &kidey)
Returns the information whether a polygon with the given key is in the container. ...
void close()
Closes the device and removes it from the dictionary.
const std::string & getImgFile() const
Returns the imgFile of the Shape.
unsigned int getNoPOIs()
Returns the number of stored pois.
static const std::string DEFAULT_IMG_FILE
bool around(const Position &p, SUMOReal offset=0) const
Returns whether the boundary contains the given coordinate.
POICont myPOICont
The poi container, accessed by the pois' ids.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
bool partialWithin(const AbstractPoly &poly, SUMOReal offset=0) const
Returns whether the boundary is partially within the given polygon.
static std::string escapeXML(const std::string &orig)
Replaces the standard escapes by their XML entities.
Boundary myPrunningBoundary
The boundary that described the rectangle within which an object must be in order to be kept...
const std::map< std::string, std::string > & getMap() const
Returns the inner key/value map.
bool myDoPrunne
Information whether the prunning boundary shall be used.
SUMOReal x() const
Returns the x-position.
A class that stores a 2D geometrical boundary.
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
void save(const std::string &file)
Saves the stored polygons into the given file.
static const SUMOReal DEFAULT_ANGLE
const std::string & getID() const
Returns the id.
static const SUMOReal DEFAULT_IMG_HEIGHT
unsigned int getNoPolygons()
Returns the number of stored polygons.
~PCPolyContainer()
Destructor.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
std::map< std::string, int > myIDEnums
An id to int map for proper enumeration.
const RGBColor & getColor() const
Returns the color of the Shape.
PCPolyContainer(bool prune, const Boundary &prunningBoundary, const std::vector< std::string > &removeByNames)
Constructor.
void report()
Reports how many polygons and pois were added.
std::map< PointOfInterest *, int > myPOILayerMap
A map from pois to the layers they are located in.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
std::map< Polygon *, int > myPolyLayerMap
A map from polygons to the layers they are located in.
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
SUMOReal y() const
Returns the y-position.
std::vector< std::string > myRemoveByNames
List of names of polygons/pois that shall be removed.
SUMOReal getWidth() const
Returns whether the image width of the POI.
SUMOReal getHeight() const
Returns whether the image hidth of the POI.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
SUMOReal getLayer() const
Returns the layer of the Shape.
PolyCont myPolyCont
The polygon container, accessed by the polygons' ids.
const std::string & getType() const
Returns the (abstract) type of the Shape.
#define WRITE_MESSAGE(msg)
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
bool getFill() const
Returns whether the polygon is filled.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
SUMOReal getAngle() const
Returns the angle of the Shape.
static const SUMOReal DEFAULT_IMG_WIDTH