VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtDiGuyCharacterData Class Reference

Stores data representing all the possible appearances, animations, hand items, heads, etc. that are available to a particular character type. It is used by the sim engine at runtime. Populated from both DI-Guy instance and character_animations_table.mtl file.

Inheritance diagram for DtDiGuyCharacterData:
Inheritance graph
[legend]

Public Types

typedef std::map< DtString,
DtDiGuyAnimationSharedPtr
TaskAnimationMap
 
typedef TaskAnimationMap::iterator TaskAnimationMapIterator
 
typedef
TaskAnimationMap::const_iterator 
const_TaskAnimationMapIterator
 
typedef std::list
< DtDiGuyAnimationSharedPtr
UnprocessedAnimationList
 
typedef
UnprocessedAnimationList::iterator 
UnprocessedAnimationListIterator
 
typedef
UnprocessedAnimationList::const_iterator 
const_UnprocessedAnimationListIterator
 

Public Member Functions

 DtDiGuyCharacterData ()
 
 DtDiGuyCharacterData (const DtString &name)
 
 DtDiGuyCharacterData (const DtDiGuyCharacterData &orig)
 
virtual ~DtDiGuyCharacterData ()
 
DtDiGuyCharacterDataoperator= (const DtDiGuyCharacterData &orig)
 
virtual void init ()
 
virtual void setDeadAnimation (DtDiGuyAnimationSharedPtr deadAnimation)
 
virtual DtDiGuyAnimationdeadAnimation ()
 
virtual const DtDiGuyAnimationlookupTaskAnimationByName (const DtString &name) const
 
virtual const std::vector
< DtString > & 
appearances () const
 
virtual void addAppearance (const DtString &app)
 
virtual bool containsAppearance (const DtString &app) const
 
virtual void addGesture (const DtString &app)
 
virtual bool containsGesture (const DtString &app) const
 
virtual const std::vector
< DtString > & 
gestures () const
 
virtual const std::vector
< DtString > & 
handItems () const
 
virtual void addHandItem (const DtString &app)
 
virtual const std::vector
< DtString > & 
heads (const DtString &bodyAppearance) const
 
virtual void addHead (const DtString &bodyAppearance, const DtString &headAppearance)
 
virtual void addTypeMapField (const DtString &appearanceName, const DtString &fieldValue)
 
virtual const DtStringgetTypeMapFieldName (int index) const
 
virtual int getTypeMapFieldIndex (const DtString &name) const
 
virtual const AlternateNamesListanimationNames () const
 
void addAnimation (DtDiGuyAnimationSharedPtr animation)
 
virtual const DtDiGuyAnimationlookupIntrinsicAnimationByName (const DtString &name) const
 
virtual DtDiGuyCharacterDataclone () const
 
void setAnimationTable (DtDiGuyCharacterAnimationsTable *table)
 
bool readInAnimationDataFromTable (DtDiGuyAnimationSharedPtr animation)
 
void setPrintInfo (bool set_print)
 
void debugPrint (const char *fmt,...)
 
virtual const DtDiGuyAnimationlookupTaskAnimationByVariant (const DtString &variant) const
 
virtual const DtDiGuyAnimationlookupIntrinsicAnimationByVariant (const DtString &variant) const
 
virtual void setCharacterTypeName (const DtString &name)
 
virtual const DtStringcharacterTypeName () const
 
virtual const TaskAnimationMaptaskableAnimations () const
 
virtual AlternateNamesList taskableAnimationNames () const
 
virtual void addTaskAnimation (const DtString &name, DtDiGuyAnimationSharedPtr animation)
 
virtual const
DtDiGuyIntrinsicAnimationMap
intrinsicAnimations () const
 
virtual void addIntrinsicAnimation (const DtString &name, DtDiGuyAnimationSharedPtr animation)
 

Static Public Member Functions

static void setCreatorFcn (const DtDiGuyIntrinsicAnimationMapCreatorFcn &fcn)
 

Protected Member Functions

virtual void readInAnimationDataFromDiGuyScenario ()
 
void setUpTypeFieldToIntMap ()
 

Protected Attributes

DtString myCharacterTypeName
 
std::vector< DtStringmyCharacterAppearances
 
std::map< DtString, DtStringmyCharacterAppearancesMap
 
std::vector< DtStringmyCharacterHandItems
 
std::vector< DtStringmyCharacterGestures
 
std::map< DtString, DtStringmyCharacterGesturesMap
 
HeadAppearanceMap myCharacterHeads
 
AppearanceToTypeFieldsMap myTypeMaps
 
UnprocessedAnimationList myUnprocessedAnimations
 
TaskAnimationMap myTaskAnimationsMap
 
DtDiGuyIntrinsicAnimationMapmyIntrinsicAnimationsMap
 
DtFilename myIntrinsicAnimationsFilename
 
AlternateNamesList myAnimationNames
 
DtDiGuyAnimationSharedPtr myDeadAnimation
 
DtDiGuyCharacterAnimationsTablemyAnimationTable
 
bool myDataReadFromDiGuyScenario
 
bool myPrintInfo
 

Static Protected Attributes

static std::map< DtString, intmyTypeFieldNameToIntMap
 
static std::vector< DtStringmyTypeFieldNameVect
 
static
DtDiGuyIntrinsicAnimationMapCreatorFcn 
theDiGuyIntrinsicAnimationMapCreatorFcn
 

Member Typedef Documentation

typedef TaskAnimationMap::iterator DtDiGuyCharacterData::TaskAnimationMapIterator
typedef TaskAnimationMap::const_iterator DtDiGuyCharacterData::const_TaskAnimationMapIterator
typedef UnprocessedAnimationList::iterator DtDiGuyCharacterData::UnprocessedAnimationListIterator
typedef UnprocessedAnimationList::const_iterator DtDiGuyCharacterData::const_UnprocessedAnimationListIterator

Constructor & Destructor Documentation

DtDiGuyCharacterData::DtDiGuyCharacterData ( )
DtDiGuyCharacterData::DtDiGuyCharacterData ( const DtString name)
DtDiGuyCharacterData::DtDiGuyCharacterData ( const DtDiGuyCharacterData orig)
virtual DtDiGuyCharacterData::~DtDiGuyCharacterData ( )
virtual

Member Function Documentation

DtDiGuyCharacterData& DtDiGuyCharacterData::operator= ( const DtDiGuyCharacterData orig)
virtual void DtDiGuyCharacterData::init ( )
virtual
virtual void DtDiGuyCharacterData::setCharacterTypeName ( const DtString name)
virtual

The name of the character type.

virtual const DtString& DtDiGuyCharacterData::characterTypeName ( ) const
virtual

The name of the character type.

virtual void DtDiGuyCharacterData::setDeadAnimation ( DtDiGuyAnimationSharedPtr  deadAnimation)
virtual
virtual DtDiGuyAnimation* DtDiGuyCharacterData::deadAnimation ( )
virtual
virtual const DtDiGuyAnimation* DtDiGuyCharacterData::lookupTaskAnimationByName ( const DtString name) const
virtual

Look up a particular animation.

virtual const std::vector<DtString>& DtDiGuyCharacterData::appearances ( ) const
virtual

The list of possible appearances for this character.

virtual void DtDiGuyCharacterData::addAppearance ( const DtString app)
virtual

Add a new possible appearance for the character.

virtual bool DtDiGuyCharacterData::containsAppearance ( const DtString app) const
virtual
virtual void DtDiGuyCharacterData::addGesture ( const DtString app)
virtual

Add a new possible gesture for the character.

virtual bool DtDiGuyCharacterData::containsGesture ( const DtString app) const
virtual
virtual const std::vector<DtString>& DtDiGuyCharacterData::gestures ( ) const
virtual
virtual const std::vector<DtString>& DtDiGuyCharacterData::handItems ( ) const
virtual

The list of possible hand items for this character.

virtual void DtDiGuyCharacterData::addHandItem ( const DtString app)
virtual

Add a new possible hand item for the character.

virtual const std::vector<DtString>& DtDiGuyCharacterData::heads ( const DtString bodyAppearance) const
virtual

The list of possible heads for this character and body appearance.

virtual void DtDiGuyCharacterData::addHead ( const DtString bodyAppearance,
const DtString headAppearance 
)
virtual

Add a new possible head for the character.

virtual void DtDiGuyCharacterData::addTypeMapField ( const DtString appearanceName,
const DtString fieldValue 
)
virtual

Adds the value to the next type map field that hasn't yet been set.

virtual const DtString& DtDiGuyCharacterData::getTypeMapFieldName ( int  index) const
virtual

Gets the name of a type map field (i.e. name of category)

virtual int DtDiGuyCharacterData::getTypeMapFieldIndex ( const DtString name) const
virtual

Get the index of a type map field name.

virtual const AlternateNamesList* DtDiGuyCharacterData::animationNames ( ) const
virtual

Returns string list of all the animations and their user friendly display name.

void DtDiGuyCharacterData::addAnimation ( DtDiGuyAnimationSharedPtr  animation)

readInAnimationDataFromDiGuyScenario() will later classify all added animations into taskable or instrinsic.

virtual const TaskAnimationMap* DtDiGuyCharacterData::taskableAnimations ( ) const
virtual

The taskable animationsReturns the map of all taskable animations.

virtual AlternateNamesList DtDiGuyCharacterData::taskableAnimationNames ( ) const
virtual

Returns string list of all the taskable animations and their user friendly display name.

virtual void DtDiGuyCharacterData::addTaskAnimation ( const DtString name,
DtDiGuyAnimationSharedPtr  animation 
)
virtual

The taskable animationsReturns the map of all taskable animations.

virtual const DtDiGuyIntrinsicAnimationMap* DtDiGuyCharacterData::intrinsicAnimations ( ) const
virtual

The intrinsic animations.

virtual void DtDiGuyCharacterData::addIntrinsicAnimation ( const DtString name,
DtDiGuyAnimationSharedPtr  animation 
)
virtual

The intrinsic animations.

virtual const DtDiGuyAnimation* DtDiGuyCharacterData::lookupIntrinsicAnimationByName ( const DtString name) const
virtual
virtual DtDiGuyCharacterData* DtDiGuyCharacterData::clone ( ) const
virtual

Returns a newly created clone of this class.

Reimplemented in DtVrvDiGuyCharacterData.

void DtDiGuyCharacterData::setAnimationTable ( DtDiGuyCharacterAnimationsTable table)
bool DtDiGuyCharacterData::readInAnimationDataFromTable ( DtDiGuyAnimationSharedPtr  animation)

Checks for override entries for the action in the character animations table. If an entry is present, the taskable vs. intrinsic flag for the action is set to use the value from the character animations table instead of the value derived from diguy data. This method expects both animation name and display name to be set.

Returns
true if a value for the animation was read from the character animations table.
void DtDiGuyCharacterData::setPrintInfo ( bool  set_print)

If set_print is true, calls to debugPrint() will print info to stdout.

void DtDiGuyCharacterData::debugPrint ( const char fmt,
  ... 
)
virtual const DtDiGuyAnimation* DtDiGuyCharacterData::lookupTaskAnimationByVariant ( const DtString variant) const
virtual
virtual const DtDiGuyAnimation* DtDiGuyCharacterData::lookupIntrinsicAnimationByVariant ( const DtString variant) const
virtual
static void DtDiGuyCharacterData::setCreatorFcn ( const DtDiGuyIntrinsicAnimationMapCreatorFcn fcn)
static

By default, this class creates a DtDiGuyIntrinsicAnimationMap data member, used in determining the appropriate animation for a given posture, speed, and demeanor. To override and replace this with your own derived DtDiGuyIntrinsicAnimationMap class, create a function that returns a new instance of your derived class, and then pass it in to this function before calling init().

virtual void DtDiGuyCharacterData::readInAnimationDataFromDiGuyScenario ( )
protectedvirtual

This is rather slow, because it causes creation of many things inside DI-Guy, so calls should be deferred until it's time to actually display an animation.

Reimplemented in DtVrvDiGuyCharacterData.

void DtDiGuyCharacterData::setUpTypeFieldToIntMap ( )
protected

Member Data Documentation

std::map<DtString,int> DtDiGuyCharacterData::myTypeFieldNameToIntMap
staticprotected
std::vector<DtString> DtDiGuyCharacterData::myTypeFieldNameVect
staticprotected
DtString DtDiGuyCharacterData::myCharacterTypeName
protected
std::vector<DtString> DtDiGuyCharacterData::myCharacterAppearances
protected
std::map<DtString, DtString> DtDiGuyCharacterData::myCharacterAppearancesMap
protected
std::vector<DtString> DtDiGuyCharacterData::myCharacterHandItems
protected
std::vector<DtString> DtDiGuyCharacterData::myCharacterGestures
protected
std::map<DtString, DtString> DtDiGuyCharacterData::myCharacterGesturesMap
protected
HeadAppearanceMap DtDiGuyCharacterData::myCharacterHeads
protected
AppearanceToTypeFieldsMap DtDiGuyCharacterData::myTypeMaps
protected
UnprocessedAnimationList DtDiGuyCharacterData::myUnprocessedAnimations
protected

Will hold animation references until they can be classified as taskable or intrinsic.

TaskAnimationMap DtDiGuyCharacterData::myTaskAnimationsMap
protected

Holds refs to taskable animations.

DtDiGuyIntrinsicAnimationMap* DtDiGuyCharacterData::myIntrinsicAnimationsMap
protected

Holds refs to intrinsic animations.

DtFilename DtDiGuyCharacterData::myIntrinsicAnimationsFilename
protected
AlternateNamesList DtDiGuyCharacterData::myAnimationNames
protected

List of names of all animations available.

DtDiGuyAnimationSharedPtr DtDiGuyCharacterData::myDeadAnimation
protected

Keep death animation separate 1) don't need to loop thru the lists to match– dead is dead 2) prevents matching death as closest animation to people in prone posture even though they are alive.

DtDiGuyCharacterAnimationsTable* DtDiGuyCharacterData::myAnimationTable
protected

This will be generated from the data in character_animations_table.mtl Its main importance is holding user-readable names and info about whether an animation is taskable or instrinsic.

bool DtDiGuyCharacterData::myDataReadFromDiGuyScenario
protected

flag to indicate that animation data has been gathered from DIGuy

bool DtDiGuyCharacterData::myPrintInfo
protected
DtDiGuyIntrinsicAnimationMapCreatorFcn DtDiGuyCharacterData::theDiGuyIntrinsicAnimationMapCreatorFcn
staticprotected

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)