geTKEvents

Description: Time-Keyed-Events functions to support motion.c

Source file: …\genesis3d\OpenSource\Source\Actor\tkevents.h

Contents:

Functions: Create, Destroy, Insert, Delete, CreateFromFile, WriteToFile, WriteToBinaryFile, SetupIterator, GetNextEvent, GetExtents

Types: geTKEvents, geTKEvents_TimeType

Overview: view

Additions for Genesis3D v1.6: None

Overview:

TKEvents  (Time-Keyed-Events) is is designed primarily to support motion.c

 geTKEvents is a sorted array of times with an identifying descriptor.  The descriptors are stored as strings in a separate, packed buffer.

 Error conditions are reported to errorlog

 

Return to Contents

Types: 

geTKEvents

typedef struct geTKEvents geTKEvents;

NOTE: The contents of this structure have been intentionally left out of the interface, by the designers of this module. Think of this as a handle only.

Return to Contents

 

geTKEvents_TimeType

typedef geFloat geTKEvents_TimeType;

Return to Contents

Functions:

geTKEvents* GENESISCC geTKEvents_Create(void);

PURPOSE: Creates a new event array.

 
Return to Contents

void GENESISCC geTKEvents_Destroy(geTKEvents** pEvents);

 PURPOSE: Destroys array.

  

Return to Contents

geBoolean GENESISCC geTKEvents_Insert(geTKEvents* pEvents, geTKEvents_TimeType tKey, const char * pEventData);

 PURPOSE: Inserts the new key and corresponding data.

  

Return to Contents

geBoolean GENESISCC geTKEvents_Delete(geTKEvents* pEvents, geTKEvents_TimeType tKey);

 PURPOSE: Deletes the key

  

Return to Contents

geTKEvents* GENESISCC geTKEvents_CreateFromFile(geVFile* pFile);

ARGUMENTS:

Pfile is a stream positioned at array data

PURPOSE: Creates a new array from the given stream.

 
Return to Contents

geBoolean GENESISCC geTKEvents_WriteToFile(const geTKEvents* pEvents,  geVFile* pFile); 

ARGUMENTS:

PEvents is a sorted array to write

PFile is a stream positioned for writing

 

PURPOSE: Writes the array to the given stream.

 
Return to Contents

geBoolean GENESISCC geTKEvents_WriteToBinaryFile(const geTKEvents* pEvents, geVFile* pFile);

ARGUMENTS:

PEvents is a sorted array to write (in binary format)

PFile is a stream positioned for writing

 

PURPOSE: Writes the array to the given stream.

 
Return to Contents

void GENESISCC geTKEvents_SetupIterator(geTKEvents* pEvents, geTKEvents_TimeType StartTime,  geTKEvents_TimeType EndTime);  

ARGUMENTS:

PEvents is a Event list to iterate

StartTime is a Inclusive search start

EndTime is a Non-inclusive search stop

 

(Involved in Event Iteration)

PURPOSE:. For searching or querying the array for events between two times. Times are compaired [StartTime,EndTime), '[' is inclusive, ')' is non-inclusive. This prepares the PathGetNextEvent() function.

 

 
Return to Contents

geBoolean GENESISCC geTKEvents_GetNextEvent(geTKEvents* pEvents, geTKEvents_TimeType* pTime, const char ** ppEventString);

ARGUMENTS:

pEvents is a Event list to iterate

pTime is a Return time, if found

ppEventString is a Return data, if found

 

(Involved in Event Iteration)

 

PURPOSE: Iterates from StartTime to EndTime as setup in geTKEvents_CreateIterator() and for each event between these times [StartTime,EndTime) this function will return Time and EventString returned for that event and the iterator will be positioned for the next search. When there are no more events in the range, this function will return GE_FALSE (Time will be 0 and ppEventString will be empty).

  

Return to Contents

GENESISAPI geBoolean GENESISCC geTKEvents_GetExtents(geTKEvents* Events, geTKEvents_TimeType* FirstEventTime, geTKEvents_TimeType* LastEventTime);

ARGUMENTS:

FirstEventTime is time of first event

LastEventTime is time of last event

(Involved in Event Iteration)

 
Return to Contents