48 #ifdef CHECK_MEMORY_LEAKS 50 #endif // CHECK_MEMORY_LEAKS 58 const std::vector<std::string>& removeByNames)
59 : myPruningBoundary(pruningBoundary), myDoPrune(prune),
60 myRemoveByNames(removeByNames) {}
70 int layer,
bool ignorePruning) {
88 WRITE_ERROR(
"Polygon '" +
id +
"' could not be added.");
100 int layer,
bool ignorePruning) {
115 POICont::iterator i =
myPOICont.find(
id);
117 WRITE_ERROR(
"POI '" +
id +
"' could not be added.");
161 WRITE_WARNING(
"Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
165 out.
writeXMLHeader(
"additional",
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\"");
173 i->second->writeXML(out, useGeo);
178 i->second->writeXML(out, useGeo, zOffset);
void clear()
Removes all stored objects (polygons and pois)
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
unsigned int getNoPOIs()
Returns the number of stored pois.
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.
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.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
A class that stores a 2D geometrical boundary.
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
Boundary myPruningBoundary
The boundary that described the rectangle within which an object must be in order to be kept...
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
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.
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.
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...
Static storage of an output device and its base (abstract) implementation.
PolyCont myPolyCont
The polygon container, accessed by the polygons' ids.
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.