 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
56 if (!oc.
isSet(
"xml-files")) {
62 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
64 throw ProcessError(
"Could not open xml-file '" + *file +
"'.");
82 myTypeMap(tm), myOptions(oc) {}
PCLoaderXML(PCPolyContainer &toFill, PCTypeMap &tm, OptionsCont &oc)
Constructor.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
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.
PCTypeMap & myTypeMap
The type map to use.
@ SUMO_TAG_POLY
begin/end of the description of a polygon
#define PROGRESS_BEGIN_TIME_MESSAGE(msg)
double layer
The layer to use.
static const Position INVALID
used to indicate that a position is valid
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
bool discard
Information whether polygons of this type shall be discarded.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
void addPoly(const SUMOSAXAttributes &attrs, const bool ignorePruning, const bool useProcessing)
adds a polygon
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
OptionsCont & myOptions
Settings to use.
#define PROGRESS_TIME_MESSAGE(before)
const TypeDef & get(const std::string &id)
Returns a type definition.
void addPOI(const SUMOSAXAttributes &attrs, const bool ignorePruning, const bool useProcessing)
adds a POI
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
Position getLanePos(const std::string &poiID, const std::string &laneID, double lanePos, double lanePosLat)
get position for a given laneID (Has to be implemented in all child)
void setDefaults(const std::string &prefix, const RGBColor &color, const double layer, const bool fill=false)
set default values
static RGBColor parseColor(std::string coldef)
Parses a color information.
~PCLoaderXML()
Destructor.
bool isInStringVector(const std::string &optionName, const std::string &itemName) const
Returns the named option is a list of string values containing the specified item.
A point in 2D or 3D with translation and scaling methods.
A storage for options typed value containers)
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.
A reader for polygons and pois stored in XML-format.
std::string prefix
The prefix to use.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
ShapeContainer & myShapeContainer
reference to shape container in which all Shares are being added
bool has(const std::string &id)
Returns the information whether the named type is known.
A storage for loaded polygons and pois.
static bool isReadable(std::string path)
Checks whether the given file is readable.
The XML-Handler for network loading.
RGBColor color
The color to use.
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored as XML.
A storage for type mappings.
bool allowFill
Information whether polygons of this type can be filled.
Encapsulated SAX-Attributes.
A single definition of values that shall be used for a given type.