VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtTextureAtlasIndexParser Class Reference
Inheritance diagram for makVrv::DtTextureAtlasIndexParser:
Inheritance graph
[legend]

Classes

struct  AtlasResult
 
struct  StringOrFloatAttrib
 

Public Types

typedef std::pair< std::string,
StringOrFloatAttrib
AttrValuePair
 
typedef std::vector
< AttrValuePair
AttrValuePairVec
 

Public Member Functions

virtual ~DtTextureAtlasIndexParser ()
 
virtual bool parseAtlasIfNecessary (const std::string &inputFile)
 
virtual bool retrieveTextureAtlasUV (const std::string &annotation, const AttrValuePairVec &searchStringPairs, float &u, float &v)
 
virtual bool retrieveTextureAtlasUV (const AttrValuePairVec &categoryValuePairs, std::vector< AtlasResult > &results)
 
virtual bool hasSeen (const std::string &fileName)
 
virtual void setCurrentFile (const std::string &fileName)
 
virtual const std::string & currentFile () const
 
virtual void setDefaultUV (float u, float v)
 
virtual void defaultUV (float &u, float &v)
 
virtual void setDefaultAttribute (const std::string &annotation)
 
virtual const std::string & defaultAttribute () const
 
virtual void setDefaultValue (const std::string &value)
 
virtual const std::string & defaultValue () const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Public Attributes

friend DtTextureAtlasIndexParserCreator
 

Protected Types

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

Protected Member Functions

 DtTextureAtlasIndexParser (DtDe &de)
 

Protected Attributes

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

Member Typedef Documentation

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 std::unordered_multimap<std::string, AttrValuePairVec > makVrv::DtTextureAtlasIndexParser::AnnotVecMap
protected
typedef std::unordered_multimap<std::string, AttrValuePairVec >::iterator makVrv::DtTextureAtlasIndexParser::AnnotVecMapItr
protected
typedef std::unordered_map<std::string, AnnotVecMap> makVrv::DtTextureAtlasIndexParser::FileMap
protected
typedef std::unordered_map<std::string, AnnotVecMap>::iterator makVrv::DtTextureAtlasIndexParser::FileMapItr
protected
typedef std::set<std::string> makVrv::DtTextureAtlasIndexParser::AttributeSet
protected
typedef std::unordered_map<std::string, AttributeSet> makVrv::DtTextureAtlasIndexParser::AnnotAttrMap
protected
typedef std::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

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

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

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

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

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

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

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

Have we parsed this file before?

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

Set the file to use for UV retrieval.

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

The current file we are using for UVs.

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

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

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

Retrieve the current default UV.

virtual void makVrv::DtTextureAtlasIndexParser::setDefaultAttribute ( const std::string &  annotation)
virtual

Set the default attribute to use as a fallback in case nothing is found ex. texture1, ->DEFAULT<-, default, 0.2, 0.3.

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

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

virtual void makVrv::DtTextureAtlasIndexParser::setDefaultValue ( const std::string &  value)
virtual

Set the default attribute value to use as a fallback in case nothing is found ex. texture1, DEFAULT, ->default<-, 0.2, 0.3.

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

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

Member Data Documentation

friend makVrv::DtTextureAtlasIndexParser::DtTextureAtlasIndexParserCreator

Instances of DtTextureAtlasIndexParser must be created through the creator function.

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
std::mutex makVrv::DtTextureAtlasIndexParser::myDataMutex
protected
DtDe& makVrv::DtTextureAtlasIndexParser::myDe
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)