3ds Max C++ API Reference
SplineConsolidationItem Class Reference

This class collects all spline items(both immediate and non-immediate), hardware build vertex buffer and index buffer in Realize() function and render them in Display() function. More...

#include <SplineRenderItem.h>

+ Inheritance diagram for SplineConsolidationItem:

Classes

struct  ConsolidationData
 Data structure used by the item. More...
 

Public Member Functions

DefaultRenderItemAPI SplineConsolidationItem ()
 
virtual DefaultRenderItemAPI void Realize (DrawContext &drawContext)
 This function first check dirty flags of its own and sub line items. More...
 
virtual DefaultRenderItemAPI void Display (DrawContext &drawContext)
 This function draw lines by vertex color material. More...
 
virtual DefaultRenderItemAPI size_t GetPrimitiveCount () const
 This function returns number of lines. More...
 
virtual DefaultRenderItemAPI void ClearSourceItems ()
 This function clears all line data comes from AddSourceItem() More...
 
virtual DefaultRenderItemAPI bool AddSourceItem (ICustomRenderItemPtr &pSourceItem, DrawContext &drawContext)
 This function handle pSourceItem which has same consolidation key. More...
 
- Public Member Functions inherited from ICustomRenderItem
virtual void HitTest (HitTestContext &, DrawContext &drawContext)
 This function is called in a hit test pass. More...
 
virtual void OnHit (HitTestContext &, DrawContext &)
 This function will be called when the render item is hit. More...
 
- Public Member Functions inherited from ARefObject
GraphicsUtilityAPI ARefObject ()
 
virtual GraphicsUtilityAPI long AddRef ()
 from IRefObject, see comments in IRefObject More...
 
virtual GraphicsUtilityAPI long Release ()
 decrease reference count of this object by one, if the decreased reference count equals zero, the object will be deleted. More...
 
GraphicsUtilityAPI IRefObjectQueryInterface (Interface_ID classID)
 Try query an interface from the ref object using a given interface id. More...
 
- Public Member Functions inherited from IRefObject
GraphicsUtilityAPI IRefObject ()
 
virtual GraphicsUtilityAPI ~IRefObject ()
 
- Public Member Functions inherited from BaseInterfaceServer
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual UtilExport int NumInterfaces () const
 
virtual UtilExport BaseInterfaceGetInterfaceAt (int i) const
 
virtual UtilExport ~BaseInterfaceServer ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Protected Attributes

int mPrimitiveCount
 Number of primitives. More...
 
bool mbIsDirty
 Dirty flag. More...
 
MaxSDK::Array< ConsolidationDatamLineDataArray
 Array of ConsolidationData. More...
 
VertexBufferHandleArray mLineVB
 Hardware vertex buffer handle. More...
 
IndexBufferHandle mLineIB
 Hardware index buffer handle. More...
 
- Protected Attributes inherited from BaseInterfaceServer
Tab< BaseInterface * > interfaces
 

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 ARefObject
virtual GraphicsUtilityAPI void DeleteThis ()
 This function will be called when the reference count of an ARefObject equals zero. More...
 
virtual GraphicsUtilityAPI ~ARefObject ()
 
- Protected Member Functions inherited from Noncopyable
 Noncopyable ()
 
 ~Noncopyable ()
 

Detailed Description

This class collects all spline items(both immediate and non-immediate), hardware build vertex buffer and index buffer in Realize() function and render them in Display() function.

With this class, we can efficiently batch small line data and greatly reduce rendering API overheads. Ideally whole scene's line objects can be rendered by a few consolidation items.

Constructor & Destructor Documentation

◆ SplineConsolidationItem()

Member Function Documentation

◆ Realize()

virtual DefaultRenderItemAPI void Realize ( DrawContext drawContext)
virtual

This function first check dirty flags of its own and sub line items.

If anything changes, it creates and fills hardware vertex/index buffer form
all of internal line item data.

Parameters
drawContextdraw context used by the function

Implements ICustomRenderItem.

◆ Display()

virtual DefaultRenderItemAPI void Display ( DrawContext drawContext)
virtual

This function draw lines by vertex color material.

Parameters
drawContextdraw context used by the function

Implements ICustomRenderItem.

◆ GetPrimitiveCount()

virtual DefaultRenderItemAPI size_t GetPrimitiveCount ( ) const
inlinevirtual

This function returns number of lines.

Returns
number of lines.

Implements ICustomRenderItem.

291 {return mPrimitiveCount;}
int mPrimitiveCount
Number of primitives.
Definition: SplineRenderItem.h:253

◆ ClearSourceItems()

virtual DefaultRenderItemAPI void ClearSourceItems ( )
virtual

This function clears all line data comes from AddSourceItem()

Implements IConsolidationRenderItem.

◆ AddSourceItem()

virtual DefaultRenderItemAPI bool AddSourceItem ( ICustomRenderItemPtr pSourceItem,
DrawContext drawContext 
)
virtual

This function handle pSourceItem which has same consolidation key.

Parameters
pSourceIteman instance of SplineRenderItem
drawContextdraw context of the incoming item

Implements IConsolidationRenderItem.

Member Data Documentation

◆ mPrimitiveCount

int mPrimitiveCount
protected

Number of primitives.

◆ mbIsDirty

bool mbIsDirty
protected

Dirty flag.

◆ mLineDataArray

MaxSDK::Array<ConsolidationData> mLineDataArray
protected

◆ mLineVB

VertexBufferHandleArray mLineVB
protected

Hardware vertex buffer handle.

◆ mLineIB

IndexBufferHandle mLineIB
protected

Hardware index buffer handle.