3ds Max C++ API Reference
RenderItemHandleDecorator Class Reference

This is a decorator class for RenderItemHandle. More...

#include <RenderItemHandleDecorator.h>

+ Inheritance diagram for RenderItemHandleDecorator:

Public Member Functions

GraphicsDriverAPI RenderItemHandleDecorator ()
 
GraphicsDriverAPI RenderItemHandleDecorator (const RenderItemHandleDecorator &from)
 
GraphicsDriverAPI RenderItemHandleDecoratoroperator= (const RenderItemHandleDecorator &from)
 
virtual GraphicsDriverAPI ~RenderItemHandleDecorator ()
 
GraphicsDriverAPI bool Initialize (const RenderItemHandle &itemToDecorate)
 Initialize the decorator. More...
 
GraphicsDriverAPI RenderItemHandle GetDecoratedRenderItem () const
 Get the decorated render item. More...
 
GraphicsDriverAPI void SetOffsetMatrix (const Matrix44 &offsetMatrix)
 Set the offset matrix for the decorator. More...
 
GraphicsDriverAPI bool GetOffsetMatrix (Matrix44 &offsetMatrix) const
 Get the offset matrix. More...
 
GraphicsDriverAPI void SetAbsoluteMatrix (const Matrix44 &absoluteMatrix)
 Set the absolute matrix for the decorator. More...
 
GraphicsDriverAPI bool GetAbsoluteMatrix (Matrix44 &absoluteMatrix) const
 Get the absolute matrix. More...
 
- Public Member Functions inherited from RenderItemHandle
GraphicsDriverAPI RenderItemHandle ()
 
GraphicsDriverAPI RenderItemHandle (const RenderItemHandle &from)
 
GraphicsDriverAPI RenderItemHandleoperator= (const RenderItemHandle &from)
 
virtual GraphicsDriverAPI ~RenderItemHandle ()
 
GraphicsDriverAPI void SetVisibilityGroup (RenderItemVisibilityGroup group)
 Set the visibility group of this render item. More...
 
GraphicsDriverAPI RenderItemVisibilityGroup GetVisibilityGroup () const
 Get the visibility group of this render item. More...
 
GraphicsDriverAPI void SetCustomMaterial (const BaseMaterialHandle &hMaterial)
 Set custom material for render item. More...
 
GraphicsDriverAPI BaseMaterialHandle GetCustomMaterial () const
 Get custom material for render item. More...
 
GraphicsDriverAPI unsigned long GetDescriptionBits () const
 Get the description bits of this render item. More...
 
GraphicsDriverAPI void SetDescriptionBits (unsigned long descriptionBits)
 Set the unique ID that corresponds to the mesh element description of this render item. More...
 
GraphicsDriverAPI bool GetTransparentHint () const
 Get the transparent hint of the current render item. More...
 
GraphicsDriverAPI void SetTransparentHint (bool bTransparentHint)
 Set the transparent hint of the current render item. More...
 
GraphicsDriverAPI void SetConsolidationData (const ConsolidationData &data)
 Set consolidation strategy and key used for consolidate this render item. More...
 
GraphicsDriverAPI const ConsolidationDataGetConsolidationData ()
 Returns consolidation data of this render item. More...
 
GraphicsDriverAPI void SetZBias (int bias)
 Set the item's Z bias Can be any int value. More...
 
GraphicsDriverAPI int GetZBias () const
 returns the item's z bias More...
 
- Public Member Functions inherited from SmartHandle
virtual GraphicsDriverAPI ~SmartHandle ()
 destructor More...
 
GraphicsDriverAPI bool IsValid () const
 Check if this handle is valid. More...
 
GraphicsDriverAPI void Release ()
 Release the underlying graphics objects. More...
 
GraphicsDriverAPI Identifier GetObjectID () const
 Get the underlying graphics object id. More...
 
GraphicsDriverAPI void SetPointer (IRefObject *pObject)
 
GraphicsDriverAPI IRefObjectGetPointer () const
 Get the underlying graphics object pointer. More...
 
bool operator== (const SmartHandle &rhs) const
 
bool operator!= (const SmartHandle &rhs) const
 
bool operator< (const SmartHandle &rhs) const
 
bool operator<= (const SmartHandle &rhs) const
 
bool operator> (const SmartHandle &rhs) const
 
bool operator>= (const SmartHandle &rhs) const
 
GraphicsDriverAPI SmartHandle (const SmartHandle &)
 
GraphicsDriverAPI SmartHandleoperator= (const SmartHandle &)
 

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...
 
- Protected Member Functions inherited from SmartHandle
GraphicsDriverAPI SmartHandle ()
 
- Protected Attributes inherited from SmartHandle
IRefObjectmpObject
 

Detailed Description

This is a decorator class for RenderItemHandle.

RenderItemHandleDecorator is mainly used when we want to create an additional instance of an existing RenderItemHandle, namely a decorator. The decorator will share the same render geometry of the original render item but it will have some different visual appearance. For e.g, it would have different material assigned, different world position or visibility group, etc. In such cases, there's no need to completely copy the original render item of which we can simply create a decorator. And we can specify the different visual appearance/behavior for the decorator.

Constructor & Destructor Documentation

◆ RenderItemHandleDecorator() [1/2]

◆ RenderItemHandleDecorator() [2/2]

◆ ~RenderItemHandleDecorator()

Member Function Documentation

◆ operator=()

◆ Initialize()

GraphicsDriverAPI bool Initialize ( const RenderItemHandle itemToDecorate)

Initialize the decorator.

Parameters
itemToDecoratethe original render item to be decorated.
Returns
true if itemToDecorate can be decorated or false otherwise. Note CustomRenderItemHandle can't be decorated.

◆ GetDecoratedRenderItem()

GraphicsDriverAPI RenderItemHandle GetDecoratedRenderItem ( ) const

Get the decorated render item.

Returns
the original render item to be decorated.

◆ SetOffsetMatrix()

GraphicsDriverAPI void SetOffsetMatrix ( const Matrix44 offsetMatrix)

Set the offset matrix for the decorator.

The world position of this decorator would be an offset from the world position of the node owning it.

Note
Calling this function will simply override the inner state resulted from any previous call to SetAbsoluteMatrix()
Parameters
offsetMatrixthe offset matrix

◆ GetOffsetMatrix()

GraphicsDriverAPI bool GetOffsetMatrix ( Matrix44 offsetMatrix) const

Get the offset matrix.

Parameters
[out]offsetMatrixuse this parameter to get the offset matrix
Returns
true if an offset matrix has been assign to this decorator or false otherwise

◆ SetAbsoluteMatrix()

GraphicsDriverAPI void SetAbsoluteMatrix ( const Matrix44 absoluteMatrix)

Set the absolute matrix for the decorator.

The world position of this decorator would be directly determined by absoluteMatrix.

Note
Calling this function will simply override the inner state resulted from any previous call to SetOffsetMatrix()
Parameters
absoluteMatrixthe absoluteMatrix matrix

◆ GetAbsoluteMatrix()

GraphicsDriverAPI bool GetAbsoluteMatrix ( Matrix44 absoluteMatrix) const

Get the absolute matrix.

Parameters
[out]absoluteMatrixuse this parameter to get the absolute matrix
Returns
true if an absolute matrix has been assign to this decorator or false otherwise