CigiAnimationTable Class Reference

#include <CigiAnimationTable.h>

List of all members.

Public Member Functions

 CigiAnimationTable ()
virtual ~CigiAnimationTable ()
Cigi_uint32 GetPastAnimation (const Cigi_uint16 EntityID)
int SetPastAnimation (const Cigi_uint16 EntityID, const Cigi_uint32 State)

Protected Attributes

Cigi_uint8 AnimationTable [16384]


Detailed Description

The class to hold and work the Animation table
Because the Conversions between the Entity Control animation state Versions 1 and 3, we needed to create a table to determine the corrent state for each frame.

Definition at line 60 of file CigiAnimationTable.h.


Constructor & Destructor Documentation

CigiAnimationTable::CigiAnimationTable (  ) 

General Constructor

Definition at line 64 of file CigiAnimationTable.cpp.

References AnimationTable.

00065 {
00066 
00067    memset(AnimationTable,0,16384);
00068 
00069 }

CigiAnimationTable::~CigiAnimationTable (  )  [virtual]

General Destructor

Definition at line 74 of file CigiAnimationTable.cpp.

00075 {
00076 
00077 }


Member Function Documentation

Cigi_uint32 CigiAnimationTable::GetPastAnimation ( const Cigi_uint16  EntityID  ) 

Gets the last frame's animation state for this Entity ID.

Parameters:
EntityID - Uniquely identifies the specific entity 0 - The ownship All other values - An Application defined entity
Returns:
This returns the last frame's animation state for this Entity ID.

Definition at line 86 of file CigiAnimationTable.cpp.

References AnimationTable.

Referenced by CigiEntityCtrlV3_3::Pack(), CigiEntityCtrlV3::Pack(), CigiEntityCtrlV2::Pack(), CigiEntityCtrlV1::Pack(), CigiEntityCtrlV3_3::Unpack(), CigiEntityCtrlV3::Unpack(), CigiEntityCtrlV2::Unpack(), and CigiEntityCtrlV1::Unpack().

00087 {
00088 
00089    int ndx;
00090    int shift;
00091 
00092    shift = EntityID & 0x3;
00093 
00094    ndx = EntityID >> 2;
00095 
00096    return((Cigi_uint32)(AnimationTable[ndx] >> shift) & 0x03);
00097 
00098 }

int CigiAnimationTable::SetPastAnimation ( const Cigi_uint16  EntityID,
const Cigi_uint32  State 
)

Sets the last frame's animation state for this Entity ID.

Parameters:
EntityID - Uniquely identifies the specific entity 0 - The ownship All other values - An Application defined entity
State - This frame's animation state for this Entity ID
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 105 of file CigiAnimationTable.cpp.

References AnimationTable, and CIGI_SUCCESS.

Referenced by CigiEntityCtrlV3_3::Pack(), CigiEntityCtrlV3::Pack(), CigiEntityCtrlV2::Pack(), CigiEntityCtrlV1::Pack(), CigiEntityCtrlV3_3::Unpack(), CigiEntityCtrlV3::Unpack(), CigiEntityCtrlV2::Unpack(), and CigiEntityCtrlV1::Unpack().

00106 {
00107 
00108    int ndx;
00109    int shift;
00110    Cigi_uint8 mask;
00111 
00112    shift = EntityID & 0x3;
00113 
00114    ndx = EntityID >> 2;
00115 
00116    mask = 0x03 << shift;
00117    AnimationTable[ndx] = (AnimationTable[ndx] & (~mask)) |
00118                          ((Cigi_uint8)(State & 0x03) << shift);
00119 
00120    return(CIGI_SUCCESS);
00121 
00122 }


Member Data Documentation

Cigi_uint8 CigiAnimationTable::AnimationTable[16384] [protected]

AnimationTable[16384]
A table to store the last frame's animation state for each valid Entity ID
Each 2 bits holds an Entity's past animation state. 0 Stop
1 Pause
2 Play
3 Continue

Definition at line 117 of file CigiAnimationTable.h.

Referenced by CigiAnimationTable(), GetPastAnimation(), and SetPastAnimation().


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:04 2009 for CCL by  doxygen 1.4.7