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) {}
118 WRITE_WARNING(
"Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
122 out.
writeXMLHeader(
"additional",
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\"");
129 for (std::map<std::string, SUMO::Polygon*>::const_iterator i =
myPolygons.getMyMap().begin(); i !=
myPolygons.getMyMap().end(); ++i) {
130 i->second->writeXML(out, useGeo);
135 std::map<std::string, std::pair<std::string, SUMOReal> >::const_iterator it =
myLanePosPois.find(i->first);
137 i->second->writeXML(out, useGeo, zOffset);
139 i->second->writeXML(out, useGeo, zOffset, it->second.first, it->second.second);
void close()
Closes the device and removes it from the dictionary.
static void writeLocation(OutputDevice &into)
writes the location element
PCPolyContainer(bool prune, const Boundary &pruningBoundary, const std::vector< std::string > &removeByNames)
Constructor.
#define GEO_OUTPUT_ACCURACY
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
Polygons myPolygons
stored Polygons
void setPrecision(int precision=OUTPUT_ACCURACY)
Sets the precison or resets it to default.
void save(const std::string &file, bool useGeo)
Saves the stored polygons and pois into the given file.
const std::string & getID() const
Returns the id.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
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.
void clear()
Removes all items from the container (deletes them, too)
Boundary myPruningBoundary
The boundary that described the rectangle within which an object must be in order to be kept...
static methods for processing the coordinates conversion for the current net
virtual bool add(SUMO::Polygon *poly, bool ignorePruning=false)
const IDMap & getMyMap() const
~PCPolyContainer()
Destructor.
std::map< std::string, int > myIDEnums
An id to int map for proper enumeration.
bool add(SUMO::Polygon *poly, bool ignorePruning=false)
Adds a polygon to the storage.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
bool partialWithin(const AbstractPoly &poly, SUMOReal offset=0) const
Returns whether the boundary is partially within the given polygon.
void addLanePos(const std::string &poiID, const std::string &laneID, SUMOReal lanePos)
bool around(const Position &p, SUMOReal offset=0) const
Returns whether the boundary contains the given coordinate.
std::map< std::string, std::pair< std::string, SUMOReal > > myLanePosPois
An id to pos map for lane pos specs.
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.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
bool myDoPrune
Information whether the pruning boundary shall be used.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)