![]() |
VR-Forces 4.8 Class Documentation
|
The DtBuoyBeaconModelStringParser parses the buoy attributes found in the strings used by streamed buoy marker names. More...
Classes | |
| struct | buoySymbols |
| 2D Icon methods More... | |
Public Types | |
| typedef boost::unordered_map < std::string, std::string > | ParsedAttributeValueMap |
| This type defines a map from attribute name to the value we parsed for it. More... | |
| typedef boost::unordered_map < std::string, std::string > | ModelDefsByNameMap |
| This type defines a map from a specific buoy name to the model definition requested for it. More... | |
Public Member Functions | |
| virtual | ~DtBuoyBeaconModelStringParser () |
| virtual DTOR More... | |
| virtual bool | readEnumMappingFile (const std::string &path, const std::string &enumMappingsFileName) |
| Read the file that specifies the strings to use for each enumerated value for each attribute. More... | |
| virtual bool | readModelDefsByNameFile (const std::string &path, const std::string &modelDefsFileName) |
| Read a file that lists model definitions that are to be used for specific buoys (indicated by the OBJNAM attribute) More... | |
| virtual bool | readDefaultsFile (const std::string &path, const std::string &defaultsFileName) |
| Read a file that provides default names and model definitions for each feature class. More... | |
| virtual void | parse (const std::string &stringToParse) |
| Break the string supplied with a streamed buoy into its component tokens and build the ParsedAttributeValueMap, replacing enumerated values with strings from the enumeration mapping file. More... | |
| const std::string & | attributeValue (const std::string &attrName) const |
| Get the attribute value for the specified attribute name for the most recently parsed string. More... | |
| const std::string & | buildPattern () const |
| Get the build pattern from the most recently parsed string. More... | |
| const std::string & | designator () const |
| Get the designator string. More... | |
| const std::string & | defaultModelDefinition (const std::string &featureClass) const |
| Get the default model definition for the specified feature class. More... | |
| const std::string & | defaultName (const std::string &featureClass) const |
| Get the default name. More... | |
| const ParsedAttributeValueMap & | results () const |
| Get the map of all attributes and associated values for the most recently parsed string. More... | |
| const ModelDefsByNameMap & | modelDefsByName () const |
| Get the map of buoy name (OBJNAM attribute) / model definition pairs that indicate an explicit model definition to use for that buoy. More... | |
Protected Types | |
| typedef boost::unordered_map < std::string, std::vector < std::string > > | AttributeEnumerationMap |
| This is what is read from the importConfig file - attribute names with a vector of strings for each enumerated value. More... | |
| typedef boost::unordered_map < std::string, std::string > | DefaultMap |
| typedef boost::unordered_set < std::string > | DesignatorAcceptSet |
| typedef boost::unordered_map < std::string, BuoySymbols > | BuoyIconsByColorMap |
| typedef boost::unordered_map < std::string, std::string > | BeaconIconByColorMap |
Protected Member Functions | |
| DtBuoyBeaconModelStringParser () | |
| CTOR. More... | |
| void | getAttributeValue (const std::string &attr, const std::string &valueString) |
| Given ATTRIBUTE=VALUE, find the value and place into the results map. More... | |
| void | createDesignatorString () |
| Generate the designator string. More... | |
| void | clearParseResultStrings () |
| Clear the results map in preparation for a new parse. More... | |
Friends | |
| class | DtBuoyBeaconModelStringParserCreator |
| Instances of DtBuoyBeaconModelStringParser must be created through the creator function. More... | |
| typedef struct makVrv::DtBuoyBeaconModelStringParser::buoySymbols | BuoySymbols |
| 2D Icon methods More... | |
| virtual bool | readIconMappingFile (const std::string &path, const std::string &iconMappingFileName) |
| Read a file that provides mappings from color and other attributes to model definitions for 2D icon symbols. More... | |
| bool | isMulticolored () const |
| Get whether the buoy is multicolored. More... | |
| BuoySymbols | buoyIconsByColor (const std::string &color) const |
| Get the icons to use for lit and unlit buoys by color. More... | |
| BuoySymbols | buoyMulticoloredIcons () const |
| Get the icons to use for lit and unlit buoys that don't have a specific color mapping but are multicolored. More... | |
| BuoySymbols | buoyDefaultIcons () const |
| Get the icons to use for lit and unlit buoys that don't meet the criteria for colored or multicolored. More... | |
| std::string | beaconLitIcon () const |
| Get the icon used for all lit beacons. More... | |
| std::string | beaconIconByColor (const std::string &color) const |
| Get the beacon icon to use defined by color (for unlit beacons) More... | |
| std::string | beaconUnnamedIcon () const |
| Get the beacon icon to use for unlit beacons that aren't defined by color and are unnamed. More... | |
| std::string | beaconNamedIcon () const |
| Get the beacon icon to use for unlit beacons that aren't defined by color and are named. More... | |
The DtBuoyBeaconModelStringParser parses the buoy attributes found in the strings used by streamed buoy marker names.
The string is a ':' separated list; the first field is a pattern used to build a model definition based on substituting attributes values specified in square brackets. The subsequent fields provide the attribute/value pairs in the form ATTRIBUTE=VALUE. Value comes directly from an S-57 data (or a shape file extracted from S-57). These values may themselves be comma-separated lists of values. Further, they may be enumerations that need to be mapped to strings. This class reads a enumeration mapping file that it uses to substitute the enumerated values into the build pattern.
Example: The following is specified as the marker name in the .earth file: "Buoys[BOYSHP][COLOUR]"+ ":BOYSHP=" + [BOYSHP] + ":COLOUR=" + [COLOUR] When the marker is streamed in, osgEarth replaces [BOYSHP] and [COLOUR] with the attribute values in the S-57 or shape file, say 3, and 5 respectively. Then the resulting marker string is "Buoys[BOYSHP][COLOUR]:BOYSHP=3:COLOUR=5". The parser uses ""Buoys[BOYSHP][COLOUR]" as the build pattern. It looks up the strings indicated by the enumeration values ("Spherical" and "Blue" using the enumeration mapping file provided) and substitutes these into the build pattern to create the model definition "BuoysSphericalBlue".
A special string called the designator is created from the object name (OBJNAM) attribute if it is provided. Tae object name often ends with the alphanumeric marking that should appear on the buoy itself. If the last word of the object name is 3 characters or less and contains no lower case letters, it will be extracted as the designator, and can be added to a model definition by including "[DESIGNATOR]" in the build patterm
| typedef boost::unordered_map< std::string, std::string> makVrv::DtBuoyBeaconModelStringParser::ParsedAttributeValueMap |
This type defines a map from attribute name to the value we parsed for it.
| typedef boost::unordered_map< std::string, std::string> makVrv::DtBuoyBeaconModelStringParser::ModelDefsByNameMap |
This type defines a map from a specific buoy name to the model definition requested for it.
| typedef struct makVrv::DtBuoyBeaconModelStringParser::buoySymbols makVrv::DtBuoyBeaconModelStringParser::BuoySymbols |
2D Icon methods
Buoys have separate icons for lit and unlit. This struct holds both
|
protected |
This is what is read from the importConfig file - attribute names with a vector of strings for each enumerated value.
|
protected |
|
protected |
|
protected |
|
protected |
|
virtual |
virtual DTOR
|
protected |
CTOR.
|
virtual |
Read the file that specifies the strings to use for each enumerated value for each attribute.
|
virtual |
Read a file that lists model definitions that are to be used for specific buoys (indicated by the OBJNAM attribute)
|
virtual |
Read a file that provides default names and model definitions for each feature class.
|
virtual |
Break the string supplied with a streamed buoy into its component tokens and build the ParsedAttributeValueMap, replacing enumerated values with strings from the enumeration mapping file.
| const std::string& makVrv::DtBuoyBeaconModelStringParser::attributeValue | ( | const std::string & | attrName | ) | const |
Get the attribute value for the specified attribute name for the most recently parsed string.
| const std::string& makVrv::DtBuoyBeaconModelStringParser::buildPattern | ( | ) | const |
Get the build pattern from the most recently parsed string.
| const std::string& makVrv::DtBuoyBeaconModelStringParser::designator | ( | ) | const |
Get the designator string.
| const std::string& makVrv::DtBuoyBeaconModelStringParser::defaultModelDefinition | ( | const std::string & | featureClass | ) | const |
Get the default model definition for the specified feature class.
| const std::string& makVrv::DtBuoyBeaconModelStringParser::defaultName | ( | const std::string & | featureClass | ) | const |
Get the default name.
| const ParsedAttributeValueMap& makVrv::DtBuoyBeaconModelStringParser::results | ( | ) | const |
Get the map of all attributes and associated values for the most recently parsed string.
| const ModelDefsByNameMap& makVrv::DtBuoyBeaconModelStringParser::modelDefsByName | ( | ) | const |
Get the map of buoy name (OBJNAM attribute) / model definition pairs that indicate an explicit model definition to use for that buoy.
|
virtual |
Read a file that provides mappings from color and other attributes to model definitions for 2D icon symbols.
| bool makVrv::DtBuoyBeaconModelStringParser::isMulticolored | ( | ) | const |
Get whether the buoy is multicolored.
| BuoySymbols makVrv::DtBuoyBeaconModelStringParser::buoyIconsByColor | ( | const std::string & | color | ) | const |
Get the icons to use for lit and unlit buoys by color.
| BuoySymbols makVrv::DtBuoyBeaconModelStringParser::buoyMulticoloredIcons | ( | ) | const |
Get the icons to use for lit and unlit buoys that don't have a specific color mapping but are multicolored.
| BuoySymbols makVrv::DtBuoyBeaconModelStringParser::buoyDefaultIcons | ( | ) | const |
Get the icons to use for lit and unlit buoys that don't meet the criteria for colored or multicolored.
| std::string makVrv::DtBuoyBeaconModelStringParser::beaconLitIcon | ( | ) | const |
Get the icon used for all lit beacons.
| std::string makVrv::DtBuoyBeaconModelStringParser::beaconIconByColor | ( | const std::string & | color | ) | const |
Get the beacon icon to use defined by color (for unlit beacons)
| std::string makVrv::DtBuoyBeaconModelStringParser::beaconUnnamedIcon | ( | ) | const |
Get the beacon icon to use for unlit beacons that aren't defined by color and are unnamed.
| std::string makVrv::DtBuoyBeaconModelStringParser::beaconNamedIcon | ( | ) | const |
Get the beacon icon to use for unlit beacons that aren't defined by color and are named.
|
protected |
Given ATTRIBUTE=VALUE, find the value and place into the results map.
|
protected |
Generate the designator string.
|
protected |
Clear the results map in preparation for a new parse.
|
friend |
Instances of DtBuoyBeaconModelStringParser must be created through the creator function.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |