OBJ_XformCache Class Reference

#include <OBJ_XformCache.h>

Inheritance diagram for OBJ_XformCache:

UT_Cache

List of all members.

Public Types

enum  OBJ_XformType { WORLD_XFORM, LOCAL_XFORM }
enum  OBJ_LookupStatus { HIT, MISS_VERSION, MISS_DATA }
enum  { DEFAULT_CACHE_SIZE_KB = 50*1024 }

Public Member Functions

 OBJ_XformCache ()
 ~OBJ_XformCache ()
OBJ_LookupStatus getXform (int id, float time, OBJ_XformType type, OP_VERSION version, UT_DMatrix4 &xform)
bool setXform (int id, float time, OBJ_XformType type, OP_VERSION version, const UT_DMatrix4 &xform)
void parseCommand (CMD_Args &args)
void setMemoryLimit (int64 max_memory)
 Sets the new memory limit for the cache size in bytes.
void clear ()
 Clears the cache and frees memory.

Static Public Member Functions

static OBJ_XformCachegetCache ()
 Obtains the transform matrix cache used by all objects.

Protected Types

enum  OBJ_MemoryState { MEMORY_CHECK_NEVER, MEMORY_CHECK_ALWAYS }

Protected Member Functions

virtual const char * utGetCacheName () const
virtual int64 utGetCurrentSize ()
virtual bool utHasMaxSize () const
virtual int64 utGetMaxSize ()
virtual void utSetMaxSize (int64 size)
virtual int64 utReduceCacheSizeBy (int64 amount)


Detailed Description

The OBJ_XformCache maintains a table of recently calculated transforms which describe world position and orientation of objects.

It can also watch memory usage to see what transform matrices should be removed from the table.

Definition at line 39 of file OBJ_XformCache.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
DEFAULT_CACHE_SIZE_KB 

Definition at line 59 of file OBJ_XformCache.h.

Enumerator:
HIT 
MISS_VERSION 
MISS_DATA 

Definition at line 51 of file OBJ_XformCache.h.

Enumerator:
MEMORY_CHECK_NEVER 
MEMORY_CHECK_ALWAYS 

Definition at line 124 of file OBJ_XformCache.h.

Enumerator:
WORLD_XFORM 
LOCAL_XFORM 

Definition at line 44 of file OBJ_XformCache.h.


Constructor & Destructor Documentation

OBJ_XformCache::OBJ_XformCache (  ) 

OBJ_XformCache::~OBJ_XformCache (  ) 


Member Function Documentation

void OBJ_XformCache::clear (  ) 

Clears the cache and frees memory.

static OBJ_XformCache* OBJ_XformCache::getCache (  )  [static]

Obtains the transform matrix cache used by all objects.

OBJ_LookupStatus OBJ_XformCache::getXform ( int  id,
float  time,
OBJ_XformType  type,
OP_VERSION  version,
UT_DMatrix4 xform 
)

querries the cache for the transform matrix INPUTS: id - the unique identification number of the operator time - the time at which the xform is applied to the object type - tranformation type version - version of parameters used to construct the xform OUTPUT: xform - on cache hit, the transform matrix, otherwise unchanged RETURNS: the status of the lookup (hit or miss)

void OBJ_XformCache::parseCommand ( CMD_Args args  ) 

Used as the interface to objcache, which is installed in MOT_Command.C

void OBJ_XformCache::setMemoryLimit ( int64  max_memory  ) 

Sets the new memory limit for the cache size in bytes.

bool OBJ_XformCache::setXform ( int  id,
float  time,
OBJ_XformType  type,
OP_VERSION  version,
const UT_DMatrix4 xform 
)

sets the transform matrix in the cache INPUTS: id - the unique identification number of the operator time - the time at which the xform is applied to the object type - tranformation type version - version of parameters used to construct the xform RETURNS: true: if succeeded false: if failed

virtual const char* OBJ_XformCache::utGetCacheName (  )  const [inline, protected, virtual]

Implements UT_Cache.

Definition at line 132 of file OBJ_XformCache.h.

virtual int64 OBJ_XformCache::utGetCurrentSize (  )  [inline, protected, virtual]

Implements UT_Cache.

Definition at line 134 of file OBJ_XformCache.h.

virtual int64 OBJ_XformCache::utGetMaxSize (  )  [inline, protected, virtual]

Reimplemented from UT_Cache.

Definition at line 138 of file OBJ_XformCache.h.

virtual bool OBJ_XformCache::utHasMaxSize (  )  const [inline, protected, virtual]

Reimplemented from UT_Cache.

Definition at line 137 of file OBJ_XformCache.h.

virtual int64 OBJ_XformCache::utReduceCacheSizeBy ( int64  amount  )  [protected, virtual]

Implements UT_Cache.

virtual void OBJ_XformCache::utSetMaxSize ( int64  size  )  [protected, virtual]

Reimplemented from UT_Cache.


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

Generated on Fri May 25 00:10:31 2012 for HDK by  doxygen 1.5.9