45 #ifdef CHECK_MEMORY_LEAKS
47 #endif // CHECK_MEMORY_LEAKS
55 const std::vector<std::string>& removeByNames)
56 : myPruningBoundary(pruningBoundary), myDoPrune(prune),
57 myRemoveByNames(removeByNames) {}
67 int layer,
bool ignorePruning) {
85 WRITE_ERROR(
"Polygon '" +
id +
"' could not be added.");
97 int layer,
bool ignorePruning) {
112 POICont::iterator i =
myPOICont.find(
id);
114 WRITE_ERROR(
"POI '" +
id +
"' could not be added.");
157 out.
writeXMLHeader(
"additional",
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/additional_file.xsd\"");
174 const std::map<std::string, std::string>& attrs = p->
getMap();
175 if (attrs.size() != 0) {
176 for (std::map<std::string, std::string>::const_iterator j = attrs.begin(); j != attrs.end(); ++j) {
207 const std::map<std::string, std::string>& attrs = p->
getMap();
208 if (attrs.size() != 0) {
209 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)
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.
PCPolyContainer(bool prune, const Boundary &pruningBoundary, const std::vector< std::string > &removeByNames)
Constructor.
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.
bool insert(const std::string &id, Polygon *poly, int layer, bool ignorePruning=false)
Adds a polygon to the storage.
const std::map< std::string, std::string > & getMap() const
Returns the inner key/value map.
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
Boundary myPruningBoundary
The boundary that described the rectangle within which an object must be in order to be kept...
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.
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.
bool myDoPrune
Information whether the pruning boundary shall be used.
#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