VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
makVrv::DtTextureAtlasIndexParser Class Reference

Classes

struct  AtlasResult
 Results for setting UV offsets ex. More...

Public Types

typedef std::pair< std::string,
std::string > 
AttrValuePair
 Typedef for S-57 attribute/value pairs valuePair = ("COLOUR", "Red") = ( attribute, value )
typedef std::vector
< AttrValuePair
AttrValuePairVec
 Typedef for a vector of S-57 attribute/value pairs and a UV coord ex.

Public Member Functions

virtual ~DtTextureAtlasIndexParser ()
 virtual DTOR
bool parseAtlasIfNecessary (const std::string &inputFile)
 Load the UV atlas file - specified in the model definition .dtxc for diffuse texture coordinates, .ctxc for character texture coordinates.
bool retrieveTextureAtlasUV (const std::string &annotation, const AttrValuePairVec &searchStringPairs, float &u, float &v)
 For a given annotation and string, look for the entry and retrieve the u,vs or return u=0,v=0 if not found.
bool retrieveTextureAtlasUV (const AttrValuePairVec &categoryValuePairs, std::vector< AtlasResult > &results)
 For a set of categories, return all annotations that match (and the uv value for each match)
bool hasSeen (const std::string &fileName)
 Have we parsed this file before?
void setCurrentFile (const std::string &fileName)
 Set the file to use for UV retrieval.
const std::string & currentFile () const
 The current file we are using for UVs.
void setDefaultUV (float u, float v)
 Set the default u,v to return if the search string was not found and all the fallbacks failed.
void defaultUV (float &u, float &v)
 Retrieve the current default UV.
void setDefaultAttribute (std::string annotation)
 Set the default attribute to use as a fallback in case nothing is found ex.
const std::string & defaultAttribute () const
 Retrieve the current default attribute to search for if there are no matches (and no fallback matches)
void setDefaultValue (std::string value)
 Set the default attribute value to use as a fallback in case nothing is found ex.
const std::string & defaultValue () const
 Retrieve the current default attribute value to search for if there are no matches (and no fallback matches)
DtDede ()
 Retrieve the display engine.

Protected Types

typedef
boost::unordered_multimap
< std::string,
AttrValuePairVec
AnnotVecMap
typedef
boost::unordered_multimap
< std::string,
AttrValuePairVec >::iterator 
AnnotVecMapItr
typedef boost::unordered_map
< std::string, AnnotVecMap
FileMap
typedef boost::unordered_map
< std::string, AnnotVecMap >
::iterator 
FileMapItr
typedef std::set< std::string > AttributeSet
typedef boost::unordered_map
< std::string, AttributeSet
AnnotAttrMap
typedef boost::unordered_map
< std::string, AnnotAttrMap
AttrMap

Protected Member Functions

 DtTextureAtlasIndexParser (DtDe &de)
 CTOR.

Protected Attributes

FileMap myFileAttrValueUVMap
AttrMap myAttributeOnlyMap
std::string myCurrentAtlasIndex
float myDefaultU
float myDefaultV
std::string myDefaultAnnotation
std::string myDefaultValue
DtDemyDe

Friends

class DtTextureAtlasIndexParserCreator
 Instances of DtTextureAtlasIndexParser must be created through the creator function.

Member Typedef Documentation

typedef std::pair<std::string, std::string> makVrv::DtTextureAtlasIndexParser::AttrValuePair

Typedef for S-57 attribute/value pairs valuePair = ("COLOUR", "Red") = ( attribute, value )

Typedef for a vector of S-57 attribute/value pairs and a UV coord ex.

v = { ("COLOUR", "Red"), ("COLPAT", "HorizontalStriped") , ...., ("U", "0.1"), ("V", "0.2") }

typedef boost::unordered_multimap<std::string, AttrValuePairVec > makVrv::DtTextureAtlasIndexParser::AnnotVecMap
protected
typedef boost::unordered_multimap<std::string, AttrValuePairVec >::iterator makVrv::DtTextureAtlasIndexParser::AnnotVecMapItr
protected
typedef boost::unordered_map<std::string, AnnotVecMap> makVrv::DtTextureAtlasIndexParser::FileMap
protected
typedef boost::unordered_map<std::string, AnnotVecMap>::iterator makVrv::DtTextureAtlasIndexParser::FileMapItr
protected
typedef std::set<std::string> makVrv::DtTextureAtlasIndexParser::AttributeSet
protected
typedef boost::unordered_map<std::string, AttributeSet> makVrv::DtTextureAtlasIndexParser::AnnotAttrMap
protected
typedef boost::unordered_map<std::string, AnnotAttrMap> makVrv::DtTextureAtlasIndexParser::AttrMap
protected

Constructor & Destructor Documentation

virtual makVrv::DtTextureAtlasIndexParser::~DtTextureAtlasIndexParser ( )
virtual

virtual DTOR

makVrv::DtTextureAtlasIndexParser::DtTextureAtlasIndexParser ( DtDe de)
protected

CTOR.

Member Function Documentation

bool makVrv::DtTextureAtlasIndexParser::parseAtlasIfNecessary ( const std::string &  inputFile)

Load the UV atlas file - specified in the model definition .dtxc for diffuse texture coordinates, .ctxc for character texture coordinates.

bool makVrv::DtTextureAtlasIndexParser::retrieveTextureAtlasUV ( const std::string &  annotation,
const AttrValuePairVec searchStringPairs,
float &  u,
float &  v 
)

For a given annotation and string, look for the entry and retrieve the u,vs or return u=0,v=0 if not found.

bool makVrv::DtTextureAtlasIndexParser::retrieveTextureAtlasUV ( const AttrValuePairVec categoryValuePairs,
std::vector< AtlasResult > &  results 
)

For a set of categories, return all annotations that match (and the uv value for each match)

bool makVrv::DtTextureAtlasIndexParser::hasSeen ( const std::string &  fileName)

Have we parsed this file before?

void makVrv::DtTextureAtlasIndexParser::setCurrentFile ( const std::string &  fileName)

Set the file to use for UV retrieval.

const std::string& makVrv::DtTextureAtlasIndexParser::currentFile ( ) const

The current file we are using for UVs.

void makVrv::DtTextureAtlasIndexParser::setDefaultUV ( float  u,
float  v 
)

Set the default u,v to return if the search string was not found and all the fallbacks failed.

void makVrv::DtTextureAtlasIndexParser::defaultUV ( float &  u,
float &  v 
)

Retrieve the current default UV.

void makVrv::DtTextureAtlasIndexParser::setDefaultAttribute ( std::string  annotation)

Set the default attribute to use as a fallback in case nothing is found ex.

texture1, ->DEFAULT<-, default, 0.2, 0.3

const std::string& makVrv::DtTextureAtlasIndexParser::defaultAttribute ( ) const

Retrieve the current default attribute to search for if there are no matches (and no fallback matches)

void makVrv::DtTextureAtlasIndexParser::setDefaultValue ( std::string  value)

Set the default attribute value to use as a fallback in case nothing is found ex.

texture1, DEFAULT, ->default<-, 0.2, 0.3

const std::string& makVrv::DtTextureAtlasIndexParser::defaultValue ( ) const

Retrieve the current default attribute value to search for if there are no matches (and no fallback matches)

DtDe& makVrv::DtTextureAtlasIndexParser::de ( )
inline

Retrieve the display engine.

Friends And Related Function Documentation

friend class DtTextureAtlasIndexParserCreator
friend

Instances of DtTextureAtlasIndexParser must be created through the creator function.

Member Data Documentation

FileMap makVrv::DtTextureAtlasIndexParser::myFileAttrValueUVMap
protected
AttrMap makVrv::DtTextureAtlasIndexParser::myAttributeOnlyMap
protected
std::string makVrv::DtTextureAtlasIndexParser::myCurrentAtlasIndex
protected
float makVrv::DtTextureAtlasIndexParser::myDefaultU
protected
float makVrv::DtTextureAtlasIndexParser::myDefaultV
protected
std::string makVrv::DtTextureAtlasIndexParser::myDefaultAnnotation
protected
std::string makVrv::DtTextureAtlasIndexParser::myDefaultValue
protected
DtDe& makVrv::DtTextureAtlasIndexParser::myDe
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)