![]() |
Eclipse SUMO - Simulation of Urban MObility
|
A storage for type mappings. More...
#include <PCTypeMap.h>
Data Structures | |
| struct | TypeDef |
| A single definition of values that shall be used for a given type. More... | |
Public Types | |
| enum class | Filltype { NOFILL = 0 , FILL = 1 , FORCE = 2 } |
Public Member Functions | |
| 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. | |
| const TypeDef & | get (const std::string &id) |
| Returns a type definition. | |
| const TypeDef & | getDefault () |
| get the default type according to the given options | |
| const std::map< std::string, TypeDef > & | getTypes () const |
| retrieve all known types | |
| bool | has (const std::string &id) |
| Returns the information whether the named type is known. | |
| PCTypeMap (const OptionsCont &oc) | |
| Constructor. The default type is constructed based on the given options. | |
| ~PCTypeMap () | |
| Destructor. | |
Protected Attributes | |
| TypeDef | myDefaultType |
| std::map< std::string, TypeDef > | myTypes |
| A map of type names to type definitions. | |
A storage for type mappings.
This class holds the mappings between names of read polygon/poi types and the values (color, new type name etc.) that shall be assigned to them.
Definition at line 42 of file PCTypeMap.h.
|
strong |
| Enumerator | |
|---|---|
| NOFILL | |
| FILL | |
| FORCE | |
Definition at line 51 of file PCTypeMap.h.
| PCTypeMap::PCTypeMap | ( | const OptionsCont & | oc | ) |
Constructor. The default type is constructed based on the given options.
Definition at line 33 of file PCTypeMap.cpp.
References PCTypeMap::TypeDef::allowFill, PCTypeMap::TypeDef::color, PCTypeMap::TypeDef::discard, FILL, OptionsCont::getBool(), OptionsCont::getFloat(), OptionsCont::getString(), PCTypeMap::TypeDef::icon, PCTypeMap::TypeDef::id, PCTypeMap::TypeDef::layer, myDefaultType, NOFILL, RGBColor::parseColor(), and PCTypeMap::TypeDef::prefix.
| PCTypeMap::~PCTypeMap | ( | ) |
Destructor.
Definition at line 44 of file PCTypeMap.cpp.
| bool PCTypeMap::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.
| [in] | id | The original id of the type |
| [in] | newid | The new id (name) of the type |
| [in] | color | The color to set for imported objects of this type |
| [in] | prefix | The prefix to prepend to the read names of this type's objects |
| [in] | layer | The layer number to set for this type's objects |
| [in] | icon | The icon for this type's objects |
| [in] | angle | The angle to rotate this type's objects |
| [in] | imgFile | The image file used as texture for objects of this type |
| [in] | discard | Whether objects of this type shall be discarded |
| [in] | allowFill | Whether objects of this type may be filled |
Definition at line 48 of file PCTypeMap.cpp.
References PCTypeMap::TypeDef::allowFill, PCTypeMap::TypeDef::angle, PCTypeMap::TypeDef::color, PCTypeMap::TypeDef::discard, has(), PCTypeMap::TypeDef::icon, PCTypeMap::TypeDef::id, PCTypeMap::TypeDef::imgFile, PCTypeMap::TypeDef::layer, myTypes, RGBColor::parseColor(), and PCTypeMap::TypeDef::prefix.
Referenced by PCTypeDefHandler::myStartElement().
| const PCTypeMap::TypeDef & PCTypeMap::get | ( | const std::string & | id | ) |
Returns a type definition.
This type definition MUST have been added otherwise the further process is undefined.
| [in] | id | The id of the type to get the definitions of |
Definition at line 70 of file PCTypeMap.cpp.
References myTypes.
Referenced by PCLoaderArcView::load(), PCLoaderVisum::load(), PCLoaderOSM::loadIfSet(), PCLoaderDlrNavteq::loadPOIFile(), PCLoaderDlrNavteq::loadPolyFile(), and PCLoaderXML::myStartElement().
|
inline |
get the default type according to the given options
Definition at line 116 of file PCTypeMap.h.
References myDefaultType.
Referenced by PCLoaderOSM::loadIfSet().
|
inline |
| bool PCTypeMap::has | ( | const std::string & | id | ) |
Returns the information whether the named type is known.
| [in] | id | The id of the type |
Definition at line 76 of file PCTypeMap.cpp.
References myTypes.
Referenced by add(), PCLoaderArcView::load(), PCLoaderVisum::load(), PCLoaderOSM::loadIfSet(), PCLoaderDlrNavteq::loadPOIFile(), PCLoaderDlrNavteq::loadPolyFile(), and PCLoaderXML::myStartElement().
|
protected |
Definition at line 129 of file PCTypeMap.h.
Referenced by getDefault(), and PCTypeMap().
|
protected |
A map of type names to type definitions.
Definition at line 127 of file PCTypeMap.h.
Referenced by add(), get(), getTypes(), and has().