44 myOverwriteType(!oc.isDefault(
"type"))
70 if (!
myContainer.
add(
id, type, color, prefix, layer, angle, imgFile, discard, allowFill)) {
71 WRITE_ERROR(
"Could not add polygon type '" +
id +
"' (probably the id is already used).");
@ SUMO_TAG_POLYTYPE
type of polygon
@ SUMO_ATTR_FILL
Fill the polygon.
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_COLOR
A color information.
A storage for options typed value containers)
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
virtual ~PCTypeDefHandler()
Destructor.
OptionsCont & myOptions
The options (program settings)
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
bool myOverwriteType
whether to replace the loaded type with a custom value
PCTypeDefHandler(OptionsCont &oc, PCTypeMap &con)
Constructor.
PCTypeMap & myContainer
The type map to fill.
A storage for type mappings.
bool add(const std::string &id, const std::string &newid, const std::string &color, const std::string &prefix, double layer, double angle, const std::string &imgFile, bool discard, bool allowFill)
Adds a type definition.
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), 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.
SAX-handler base for SUMO-files.
static const std::string DEFAULT_IMG_FILE
static const double DEFAULT_ANGLE