3ds Max C++ API Reference
MarkerConsolidationItem Class Reference

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

#include <MarkerRenderItem.h>

+ Inheritance diagram for MarkerConsolidationItem:

Classes

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

Public Member Functions

 MarkerConsolidationItem ()
 
virtual void Realize (DrawContext &drawContext)
 This function first check dirty flags of its own and sub items. More...
 
virtual void Display (DrawContext &drawContext)
 This function draw markers by marker shader. More...
 
virtual size_t GetPrimitiveCount () const
 This function returns number of markers. More...
 
virtual void ClearSourceItems ()
 This function clears all marker data comes from AddSourceItem() More...
 
virtual 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< ConsolidationDatamMarkerDataArray
 Array of ConsolidationData. More...
 
VertexBufferHandleArray mMarkerVB
 Marker data vertex buffer. 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 marker 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 markers data and greatly reduce rendering API overheads. Ideally whole scene's marker objects can be rendered by a few consolidation items.

Constructor & Destructor Documentation

◆ MarkerConsolidationItem()

Member Function Documentation

◆ Realize()

virtual void Realize ( DrawContext drawContext)
virtual

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

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

Parameters
drawContextdraw context used by the function

Implements ICustomRenderItem.

◆ Display()

virtual void Display ( DrawContext drawContext)
virtual

This function draw markers by marker shader.

Parameters
drawContextdraw context used by the function

Implements ICustomRenderItem.

◆ GetPrimitiveCount()

virtual size_t GetPrimitiveCount ( ) const
inlinevirtual

This function returns number of markers.

Returns
number of markers.

Implements ICustomRenderItem.

251 {return mPrimitiveCount;}
int mPrimitiveCount
Number of primitives.
Definition: MarkerRenderItem.h:214

◆ ClearSourceItems()

virtual void ClearSourceItems ( )
virtual

This function clears all marker data comes from AddSourceItem()

Implements IConsolidationRenderItem.

◆ AddSourceItem()

virtual bool AddSourceItem ( ICustomRenderItemPtr pSourceItem,
DrawContext drawContext 
)
virtual

This function handle pSourceItem which has same consolidation key.

Parameters
pSourceIteman instance of MarkerRenderItem
drawContextdraw context of the incoming item

Implements IConsolidationRenderItem.

Member Data Documentation

◆ mPrimitiveCount

int mPrimitiveCount
protected

Number of primitives.

◆ mbIsDirty

bool mbIsDirty
protected

Dirty flag.

◆ mMarkerDataArray

MaxSDK::Array<ConsolidationData> mMarkerDataArray
protected

◆ mMarkerVB

VertexBufferHandleArray mMarkerVB
protected

Marker data vertex buffer.