53 #ifdef CHECK_MEMORY_LEAKS
55 #endif // CHECK_MEMORY_LEAKS
67 if (!oc.
isSet(
"xml-files")) {
73 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
75 throw ProcessError(
"Could not open xml-file '" + *file +
"'.");
93 myCont(toFill), myTypeMap(tm), myOptions(oc) {}
117 WRITE_WARNING(
"Unable to project coordinates for POI '" +
id +
"'.");
149 bool ignorePrunning =
false;
151 ignorePrunning =
true;
192 bool ignorePrunning =
false;
194 ignorePrunning =
true;
206 for (PositionVector::const_iterator i = pshape.begin(); i != pshape.end(); ++i) {
std::string id
The new type id to use.
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
static RGBColor parseColor(std::string coldef)
Parses a color information.
PCLoaderXML(PCPolyContainer &toFill, PCTypeMap &tm, OptionsCont &oc)
Constructor.
A single definition of values that shall be used for a given type.
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
static const std::string DEFAULT_IMG_FILE
A reader for polygons and pois stored in XML-format.
bool isInStringVector(const std::string &optionName, const std::string &itemName)
Returns the named option is a list of string values containing the specified item.
PCTypeMap & myTypeMap
The type map to use.
RGBColor myCurrentColor
The color of the currently parsed polygon.
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
OptionsCont & myOptions
Settings to use.
bool myCurrentIgnorePrunning
Whether the current polygon must not be prunned.
bool insert(const std::string &id, Polygon *poly, int layer, bool ignorePruning=false)
Adds a polygon to the storage.
SAX-handler base for SUMO-files.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
#define WRITE_WARNING(msg)
bool discard
Information whether polygons of this type shall be discarded.
A storage for loaded polygons and pois.
static OptionsCont & getOptions()
Retrieves the options.
RGBColor color
The color to use.
static const SUMOReal DEFAULT_ANGLE
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
std::string myCurrentType
The type of the currently parsed polygon.
A storage for type mappings.
const std::string & getFileName() const
returns the current file name
const TypeDef & get(const std::string &id)
Returns a type definition.
Encapsulated SAX-Attributes.
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
static const SUMOReal DEFAULT_IMG_HEIGHT
A point in 2D or 3D with translation and scaling methods.
bool has(const std::string &id)
Returns the information whether the named type is known.
static bool exists(std::string path)
Checks whether the given file exists.
#define PROGRESS_BEGIN_MESSAGE(msg)
~PCLoaderXML()
Destructor.
std::string myCurrentID
The id of the currently parsed polygon.
void push_back(const PositionVector &p)
Appends all positions from the given vector.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
SUMOReal myCurrentLayer
The layer of the currently parsed polygon.
std::string prefix
The prefix to use.
A storage for options typed value containers)
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored as XML.
int layer
The layer to use.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
#define PROGRESS_DONE_MESSAGE()
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
PCPolyContainer & myCont
The container to store the converted polygons/pois into.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
static const SUMOReal DEFAULT_IMG_WIDTH