ObjectState Class Reference

#include <object.h>

Class Description

The ObjectState is the structure that flows up the geometry pipeline.

It contains a matrix, a material index, some flags for channels, and a pointer to the object in the pipeline. This is what is passed down the pipeline, and ultimately used by the Node to Display, Hittest, render.

See also
Object, Matrix3
+ Inheritance diagram for ObjectState:

Public Member Functions

CoreExport ObjectState ()
 Constructor. More...
 
CoreExport ObjectState (Object *ob)
 Constructor. More...
 
CoreExport ObjectState (const ObjectState &os)
 Constructor. More...
 
CoreExport ~ObjectState ()
 Destructor. More...
 
void OSSetFlag (ulong f)
 Call this method to update the object state flags. More...
 
void OSClearFlag (ulong f)
 Call this method to clear the specified object state flags. More...
 
ulong OSTestFlag (ulong f) const
 Call this method to test the specified flags. More...
 
CoreExport void OSCopyFlag (ulong f, const ObjectState &fromos)
 Copies the specified flag settings from the specified object state to this object state. More...
 
CoreExport ObjectStateoperator= (const ObjectState &os)
 Assignment operator. More...
 
Interval tmValid () const
 Returns the validity interval of the object state's transformation matrix. More...
 
Interval mtlValid () const
 Returns the validity interval of the object state's material. More...
 
CoreExport Interval Validity (TimeValue t) const
 Returns the validity interval of the object state. More...
 
CoreExport int TMIsIdentity () const
 Returns nonzero if the object state's transformation matrix is the identity matrix; otherwise zero. More...
 
CoreExport void SetTM (Matrix3 *mat, Interval iv)
 Sets the object state's transformation matrix to the specified Matrix3 and its validity interval to the interval passed. More...
 
CoreExport Matrix3GetTM () const
 Returns the object state's transformation matrix. More...
 
CoreExport void SetIdentityTM ()
 Sets the object state tm to the identity transformation matrix. More...
 
CoreExport void ApplyTM (Matrix3 *mat, Interval iv)
 Applies the specified matrix to the object state tm. More...
 
CoreExport void CopyTM (const ObjectState &fromos)
 Copies the object state tm (and its validity interval) from the specified object state's tm. More...
 
CoreExport void CopyMtl (const ObjectState &fromos)
 Copies the object state material (and its validity interval) from the specified object state's material. More...
 
CoreExport void Invalidate (ChannelMask channels, BOOL checkLock=FALSE)
 Invalidates the specified channels of the object state's object. More...
 
CoreExport ChannelMask DeleteObj (BOOL checkLock=FALSE)
 Deletes the object state's object. More...
 

Public Attributes

Objectobj
 Pointer to the object in the pipeline. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

Constructor.

The object pointer is initialized to NULL.

Constructor.

The object pointer is set to the object passed. The tm pointer is set to NULL and the tm and mtl validity intervals are set to FOREVER.

Parameters
obThe object to initialize the object pointer to.

Constructor.

The object state is initialized to the object state passed.

Parameters
osThe object state to initialized to os.

Destructor.

If the tm exists, it is deleted.

Member Function Documentation

void OSSetFlag ( ulong  f)
inline

Call this method to update the object state flags.

Parameters
fThe flags to set. The specified flags are ORed into the current state of the flags.
315 { flags |= f; }
void OSClearFlag ( ulong  f)
inline

Call this method to clear the specified object state flags.

Parameters
fThe flags to clear.
319 { flags &= ~f; }
ulong OSTestFlag ( ulong  f) const
inline

Call this method to test the specified flags.

Parameters
fThe flags to test.
Returns
Nonzero if the specified flags are all set; otherwise 0.
324 { return flags&f; }
CoreExport void OSCopyFlag ( ulong  f,
const ObjectState fromos 
)

Copies the specified flag settings from the specified object state to this object state.

Parameters
fThe flags to copy.
fromosThe source object state.
CoreExport ObjectState& operator= ( const ObjectState os)

Assignment operator.

The object pointer, flags, transformation matrix (and its validity interval), and material (and its validity interval) are copied from the specified object state.

Interval tmValid ( ) const
inline

Returns the validity interval of the object state's transformation matrix.

338 { return tmvi; }
Interval mtlValid ( ) const
inline

Returns the validity interval of the object state's material.

341 { return mtlvi; }
CoreExport Interval Validity ( TimeValue  t) const

Returns the validity interval of the object state.

If the object is not defined, this interval is NEVER. Otherwise it is the intersection of the tm validity interval, the mtl validity interval and the interval returned from obj->ObjectValidity(t).

Parameters
tSpecifies the time to retrieve the validity interval.
Returns
The validity interval of the object state.
CoreExport int TMIsIdentity ( ) const

Returns nonzero if the object state's transformation matrix is the identity matrix; otherwise zero.

CoreExport void SetTM ( Matrix3 mat,
Interval  iv 
)

Sets the object state's transformation matrix to the specified Matrix3 and its validity interval to the interval passed.

If the specified matrix is NULL, a new Matrix3 is allocated and is initialized to the identity matrix.

Parameters
matSpecifies the matrix to set.
ivSpecifies the validity interval to set.
CoreExport Matrix3* GetTM ( ) const

Returns the object state's transformation matrix.

CoreExport void SetIdentityTM ( )

Sets the object state tm to the identity transformation matrix.

CoreExport void ApplyTM ( Matrix3 mat,
Interval  iv 
)

Applies the specified matrix to the object state tm.

The object state tm is multiplied by the specified matrix. The specified interval is intersected with the object state tm validity interval.

Parameters
matThe matrix to apply.
ivThe interval to intersect with the object state's tm validity interval.
CoreExport void CopyTM ( const ObjectState fromos)

Copies the object state tm (and its validity interval) from the specified object state's tm.

Parameters
fromosThe object state whose tm is to be copied.
CoreExport void CopyMtl ( const ObjectState fromos)

Copies the object state material (and its validity interval) from the specified object state's material.

Parameters
fromosThe object state whose material is to be copied.
CoreExport void Invalidate ( ChannelMask  channels,
BOOL  checkLock = FALSE 
)

Invalidates the specified channels of the object state's object.

Parameters
channelsThe channels of the object to invalidate.
checkLockIf checkLock is TRUE and OBJ_CHANNELS is one of the specified channels, the object the object state points to is not deleted if it is locked; otherwise it is deleted.
CoreExport ChannelMask DeleteObj ( BOOL  checkLock = FALSE)

Deletes the object state's object.

Parameters
checkLockIf checkLock is TRUE, the object the object state points to is not deleted if it is locked; otherwise it is always deleted.
Operators:

Member Data Documentation

Object* obj

Pointer to the object in the pipeline.

The validity interval of the object can be retrieved using obj->ObjectValidity()