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

The DtModelSemanticsMapper object is responsible for mapping Names of model semantics declarations (for example states, articulated parts etc) To integers. More...

Inheritance diagram for makVrv::DtModelSemanticsMapper:
Inheritance graph
[legend]

Classes

struct  Parts
 This struct is used like a namespace. More...
struct  States
 This struct is used like a namespace. More...

Public Member Functions

virtual ~DtModelSemanticsMapper ()
const std::string * findStateName (States::Id id) const
 Search for a state name for the id.
const States::IdfindStateId (const std::string &name) const
 Search for a state name for the id.
const std::string * findPartName (Parts::Id id) const
 Search for a part name for the id.
const Parts::IdfindPartId (const std::string &name) const
 Search for a part name for the id.
void addState (const std::string &name, States::Id id)
 Add a particular state.
void removeState (const std::string &name)
 Remove a state.
void addPart (const std::string &name, Parts::Id id)
 Add a part.
void removePart (const std::string &name)
 Remove a part.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static DtModelSemanticsMapperinstance (DtDe &)

Protected Types

typedef std::map< std::string,
States::Id
StateNameToIdMap
typedef std::map< States::Id,
std::string > 
StateIdToNameMap
typedef std::map< std::string,
Parts::Id
PartNameToIdMap
typedef std::map< Parts::Id,
std::string > 
PartIdToNameMap

Protected Member Functions

virtual std::string cleanUpName (const std::string &) const
 Function for transforming an input name into a valid search name.
 DtModelSemanticsMapper ()
virtual void initialize ()
 Called by instance function on creation of only Mapper instance.

Protected Attributes

StateNameToIdMap myStateNamesToIds
StateIdToNameMap myStateIdsToNames
PartNameToIdMap myPartNamesToIds
PartIdToNameMap myPartIdsToNames

Friends

class DtModelSemanticsMapperCreator

Detailed Description

The DtModelSemanticsMapper object is responsible for mapping Names of model semantics declarations (for example states, articulated parts etc) To integers.

Member Typedef Documentation

typedef std::map<std::string,States::Id> makVrv::DtModelSemanticsMapper::StateNameToIdMap
protected
typedef std::map<States::Id,std::string> makVrv::DtModelSemanticsMapper::StateIdToNameMap
protected
typedef std::map<std::string,Parts::Id> makVrv::DtModelSemanticsMapper::PartNameToIdMap
protected
typedef std::map<Parts::Id,std::string> makVrv::DtModelSemanticsMapper::PartIdToNameMap
protected

Constructor & Destructor Documentation

virtual makVrv::DtModelSemanticsMapper::~DtModelSemanticsMapper ( )
virtual
makVrv::DtModelSemanticsMapper::DtModelSemanticsMapper ( )
protected

Member Function Documentation

static DtModelSemanticsMapper& makVrv::DtModelSemanticsMapper::instance ( DtDe )
static
const std::string* makVrv::DtModelSemanticsMapper::findStateName ( States::Id  id) const

Search for a state name for the id.

Note
The state name is case-insensitive also 'spaces' and 'underscore' are treated as the same (except for padding spaces which are ignored).
Returns
a pointer to an internal reference. This pointer MUST not be deleted and should not be held on to.
Return values
NULLif no name was found.
const States::Id* makVrv::DtModelSemanticsMapper::findStateId ( const std::string &  name) const

Search for a state name for the id.

Note if id is actually an integer encoded as a string, the string is converted to an integer and cast to a StateId, it will then also attempt to search for the proper id pointer in the map.

Returns
a pointer to an internal reference. This pointer MUST not be deleted and should not be held on to.
Return values
NULLif no id was found.
const std::string* makVrv::DtModelSemanticsMapper::findPartName ( Parts::Id  id) const

Search for a part name for the id.

Note
The state name is case-insensitive also 'spaces' and 'underscore' are treated as the same (except for padding spaces which are ignored).
Returns
a pointer to an internal reference. This pointer MUST not be deleted and should not be held on to.
Return values
NULLif no name was found.
const Parts::Id* makVrv::DtModelSemanticsMapper::findPartId ( const std::string &  name) const

Search for a part name for the id.

Note if id is actually an integer encoded as a string, the string is converted to an integer and cast to a Parts::Ids, it will then also attempt to search for the proper id pointer in the map.

Returns
a pointer to an internal reference. This pointer MUST not be deleted and should not be held on to.
Return values
NULLif no id was found.
void makVrv::DtModelSemanticsMapper::addState ( const std::string &  name,
States::Id  id 
)

Add a particular state.

void makVrv::DtModelSemanticsMapper::removeState ( const std::string &  name)

Remove a state.

void makVrv::DtModelSemanticsMapper::addPart ( const std::string &  name,
Parts::Id  id 
)

Add a part.

void makVrv::DtModelSemanticsMapper::removePart ( const std::string &  name)

Remove a part.

virtual std::string makVrv::DtModelSemanticsMapper::cleanUpName ( const std::string &  ) const
protectedvirtual

Function for transforming an input name into a valid search name.

This removes any space padding, transforms the alpha characters to lower case and all internal spaces to underscores.

virtual void makVrv::DtModelSemanticsMapper::initialize ( )
protectedvirtual

Called by instance function on creation of only Mapper instance.

Friends And Related Function Documentation

friend class DtModelSemanticsMapperCreator
friend

Member Data Documentation

StateNameToIdMap makVrv::DtModelSemanticsMapper::myStateNamesToIds
protected
StateIdToNameMap makVrv::DtModelSemanticsMapper::myStateIdsToNames
protected
PartNameToIdMap makVrv::DtModelSemanticsMapper::myPartNamesToIds
protected
PartIdToNameMap makVrv::DtModelSemanticsMapper::myPartIdsToNames
protected

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)