44 myOverwriteType(!oc.isDefault(
"type"))
66 const std::string allowFillS = attrs.
get<std::string>(
SUMO_ATTR_FILL,
id.c_str(), ok);
67 if (allowFillS ==
"force") {
79 if (!
myContainer.
add(
id, type, color, prefix, icon, layer, angle, imgFile, discard, allowFill)) {
80 WRITE_ERRORF(
TL(
"Could not add polygon type '%' (probably the id is already used)."),
id);
#define WRITE_ERRORF(...)
@ 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, const std::string &icon, double layer, double angle, const std::string &imgFile, bool discard, Filltype 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.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SAX-handler base for SUMO-files.
static const std::string DEFAULT_IMG_FILE
static const double DEFAULT_ANGLE
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter