3ds Max C++ API Reference
GenerateMeshRenderItemsContext Class Reference

This class contains all information that will be passed to Mesh::GenerateRenderItems() or MNMesh::GenerateRenderItems() to update its display data. More...

#include <GenerateMeshRenderItemsContext.h>

+ Inheritance diagram for GenerateMeshRenderItemsContext:

Public Member Functions

GraphicsDriverAPI GenerateMeshRenderItemsContext ()
 
GraphicsDriverAPI ~GenerateMeshRenderItemsContext ()
 
GraphicsDriverAPI const MaterialRequiredStreamsGetRequiredStreams () const
 Get the required streams. More...
 
GraphicsDriverAPI MaterialRequiredStreamsGetRequiredStreams ()
 Get the required streams. More...
 
GraphicsDriverAPI size_t GetNumMeshElementDescriptions () const
 Get the count of mesh element descriptions required to be generated from the given mesh. More...
 
GraphicsDriverAPI const MeshElementDescriptionGetMeshElementDescription (size_t i) const
 Get the i-th mesh element description. More...
 
GraphicsDriverAPI const MeshElementDescriptionFindMeshElementDescription (unsigned long descriptionBits) const
 Find the mesh element description based on the given descriptionBits. More...
 
GraphicsDriverAPI const MeshElementDescriptionFindMeshElementDescription (MeshElementType type, MeshPart part) const
 Find the mesh element description based on the given type and mesh part. More...
 
GraphicsDriverAPI void AddMeshElementDescription (const MeshElementDescription &meshElementDescription)
 Add a new mesh element description. More...
 
GraphicsDriverAPI void AddBuiltInMeshElementDescription (BuiltInMeshElementDescription type)
 Add a built-in mesh element description. More...
 
GraphicsDriverAPI void ClearMeshElementDescriptions ()
 Clear all mesh element descriptions. More...
 
GraphicsDriverAPI void GenerateDefaultMeshElementDescriptions (unsigned long objectComponentRequirements)
 Developer may simply call this function when objectComponentRequirements contains the requirements for all the render items that require to be generated. More...
 
GraphicsDriverAPI void GenerateDefaultContext (const UpdateDisplayContext &updateDisplayContext)
 Developer may simply call this function when updateDisplayContext contains the requirements for all render items and material streams to be generated. More...
 
GraphicsDriverAPI void RemoveInvisibleMeshElementDescriptions (const RenderNodeHandle &hRenderNode)
 There are some render items which are invisible in a max node by default with regard to the current state of this node. More...
 
GraphicsDriverAPI void AddRequiredStreams (const MaterialRequiredStreams &materialRequiredStreams)
 Add some new material required streams to the context. More...
 
GraphicsDriverAPI void SetInstanceData (const VertexBufferHandle &instanceData)
 Set instance data to generate instance render items. More...
 
GraphicsDriverAPI const VertexBufferHandleGetInstanceData () const
 Get instance data. More...
 

Protected Attributes

MaxSDK::Array< MeshElementDescriptionmMeshElementsDescriptions
 
MaterialRequiredStreams mRequiredStreams
 
VertexBufferHandle mInstanceData
 

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...
 

Detailed Description

This class contains all information that will be passed to Mesh::GenerateRenderItems() or MNMesh::GenerateRenderItems() to update its display data.

All the value of this class are set by system and plugin developers should build render items to satisfy those requirements.

Constructor & Destructor Documentation

◆ GenerateMeshRenderItemsContext()

◆ ~GenerateMeshRenderItemsContext()

Member Function Documentation

◆ GetRequiredStreams() [1/2]

GraphicsDriverAPI const MaterialRequiredStreams& GetRequiredStreams ( ) const

Get the required streams.

Required streams is for generating mesh render items.

See also
MaterialRequiredStreams

◆ GetRequiredStreams() [2/2]

GraphicsDriverAPI MaterialRequiredStreams& GetRequiredStreams ( )

Get the required streams.

Required streams is for generating mesh render items.

See also
MaterialRequiredStreams

◆ GetNumMeshElementDescriptions()

GraphicsDriverAPI size_t GetNumMeshElementDescriptions ( ) const

Get the count of mesh element descriptions required to be generated from the given mesh.

Returns
the count of mesh elements.

◆ GetMeshElementDescription()

GraphicsDriverAPI const MeshElementDescription& GetMeshElementDescription ( size_t  i) const

Get the i-th mesh element description.

Parameters
[in]ithe index of the mesh element description
Returns
the i-th mesh element description.

◆ FindMeshElementDescription() [1/2]

GraphicsDriverAPI const MeshElementDescription* FindMeshElementDescription ( unsigned long  descriptionBits) const

Find the mesh element description based on the given descriptionBits.

Parameters
[in]descriptionBitsthe description bits of the mesh element description
See also
MeshElementDescription::GetDescriptionBits()
Returns
the required mesh element description if found or NULL otherwise.

◆ FindMeshElementDescription() [2/2]

GraphicsDriverAPI const MeshElementDescription* FindMeshElementDescription ( MeshElementType  type,
MeshPart  part 
) const

Find the mesh element description based on the given type and mesh part.

Parameters
[in]typemesh element type
[in]partmesh part
Returns
the required mesh element description if found or NULL otherwise.

◆ AddMeshElementDescription()

GraphicsDriverAPI void AddMeshElementDescription ( const MeshElementDescription meshElementDescription)

Add a new mesh element description.

Parameters
[in]meshElementDescriptionthe new mesh element description.

◆ AddBuiltInMeshElementDescription()

GraphicsDriverAPI void AddBuiltInMeshElementDescription ( BuiltInMeshElementDescription  type)

Add a built-in mesh element description.

Parameters
[in]typethe type of built-in mesh element description

◆ ClearMeshElementDescriptions()

GraphicsDriverAPI void ClearMeshElementDescriptions ( )

Clear all mesh element descriptions.

◆ GenerateDefaultMeshElementDescriptions()

GraphicsDriverAPI void GenerateDefaultMeshElementDescriptions ( unsigned long  objectComponentRequirements)

Developer may simply call this function when objectComponentRequirements contains the requirements for all the render items that require to be generated.

Remarks
If you require some additional render items which are usually displayed when mesh is edited in any sub-object level. Please still use AddMeshElementDescription to specify the required mesh element.
Parameters
[in]objectComponentRequirementsthe object component requirements from the update display context.

◆ GenerateDefaultContext()

GraphicsDriverAPI void GenerateDefaultContext ( const UpdateDisplayContext updateDisplayContext)

Developer may simply call this function when updateDisplayContext contains the requirements for all render items and material streams to be generated.

Parameters
[in]updateDisplayContextthe update display context

◆ RemoveInvisibleMeshElementDescriptions()

GraphicsDriverAPI void RemoveInvisibleMeshElementDescriptions ( const RenderNodeHandle hRenderNode)

There are some render items which are invisible in a max node by default with regard to the current state of this node.

For e.g., selected edges is not visible in an unselected node or digonals is not visible in a node whose 'Edge Only' property is true, etc. Developers may call this function to remove the descriptions of those invisible render items of a given node.

Parameters
[in]hRenderNodethe render node for which invisible descriptions will be removed

◆ AddRequiredStreams()

GraphicsDriverAPI void AddRequiredStreams ( const MaterialRequiredStreams materialRequiredStreams)

Add some new material required streams to the context.

Parameters
[in]materialRequiredStreamsthe material required streams to add.

◆ SetInstanceData()

GraphicsDriverAPI void SetInstanceData ( const VertexBufferHandle instanceData)

Set instance data to generate instance render items.

Parameters
[in]instanceDatavertex buffer data, generated via MaxSDK::Graphics::GenerateInstanceData()

◆ GetInstanceData()

GraphicsDriverAPI const VertexBufferHandle& GetInstanceData ( ) const

Get instance data.

Returns
instance data stored in this context

Member Data Documentation

◆ mMeshElementsDescriptions

MaxSDK::Array<MeshElementDescription> mMeshElementsDescriptions
protected

◆ mRequiredStreams

MaterialRequiredStreams mRequiredStreams
protected

◆ mInstanceData

VertexBufferHandle mInstanceData
protected