47 #ifdef CHECK_MEMORY_LEAKS
49 #endif // CHECK_MEMORY_LEAKS
57 const std::vector<std::string>& removeByNames)
58 : myPruningBoundary(pruningBoundary), myDoPrune(prune),
59 myRemoveByNames(removeByNames) {}
69 int layer,
bool ignorePruning) {
87 WRITE_ERROR(
"Polygon '" +
id +
"' could not be added.");
99 int layer,
bool ignorePruning) {
114 POICont::iterator i =
myPOICont.find(
id);
116 WRITE_ERROR(
"POI '" +
id +
"' could not be added.");
160 WRITE_WARNING(
"Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
164 out.
writeXMLHeader(
"additional",
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\"");
172 i->second->writeXML(out, useGeo);
203 for (std::map<std::string, std::string>::const_iterator j = p->
getMap().begin(); j != p->
getMap().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.
static void writeLocation(OutputDevice &into)
writes the location element
const std::string & getImgFile() const
Returns the imgFile of the Shape.
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
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.
#define GEO_OUTPUT_ACCURACY
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.
void save(const std::string &file, bool useGeo)
Saves the stored polygons into the given file.
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.
#define WRITE_WARNING(msg)
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
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.
void setPrecision(unsigned int precision=OUTPUT_ACCURACY)
Sets the precison or resets it to default.
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
static methods for processing the coordinates conversion for the current net
static const SUMOReal DEFAULT_IMG_HEIGHT
A point in 2D or 3D with translation and scaling methods.
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.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
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.
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