GenerateMeshRenderItemsContext Class Reference
 
 
 
GenerateMeshRenderItemsContext Class Reference

This reference page is linked to from the following overview topics: About RenderItem.


#include <GenerateMeshRenderItemsContext.h>

Inheritance diagram for GenerateMeshRenderItemsContext:
MaxHeapOperators

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

Public Member Functions

GraphicsDriverAPI  GenerateMeshRenderItemsContext ()
GraphicsDriverAPI  ~GenerateMeshRenderItemsContext ()
GraphicsDriverAPI const
MaterialRequiredStreams
GetRequiredStreams () const
  Get the required streams.
GraphicsDriverAPI
MaterialRequiredStreams
GetRequiredStreams ()
  Get the required streams.
GraphicsDriverAPI size_t  GetNumMeshElementDescriptions () const
  Get the count of mesh element descriptions required to be generated from the given mesh.
GraphicsDriverAPI const
MeshElementDescription
GetMeshElementDescription (size_t i) const
  Get the i-th mesh element description.
GraphicsDriverAPI const
MeshElementDescription
FindMeshElementDescription (unsigned long descriptionBits) const
  Find the mesh element description based on the given descriptionBits.
GraphicsDriverAPI const
MeshElementDescription
FindMeshElementDescription (MeshElementType type, MeshPart part) const
  Find the mesh element description based on the given type and mesh part.
GraphicsDriverAPI void  AddMeshElementDescription (const MeshElementDescription &meshElementDescription)
  Add a new mesh element description.
GraphicsDriverAPI void  AddBuiltInMeshElementDescription (BuiltInMeshElementDescription type)
  Add a built-in mesh element description.
GraphicsDriverAPI void  ClearMeshElementDescriptions ()
  Clear all mesh element descriptions.
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.
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.
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.

Protected Attributes

MaxSDK::Array
< MeshElementDescription
mMeshElementsDescriptions
MaterialRequiredStreams  mRequiredStreams

Constructor & Destructor Documentation

GraphicsDriverAPI GenerateMeshRenderItemsContext ( )
GraphicsDriverAPI ~GenerateMeshRenderItemsContext ( )

Member Function Documentation

GraphicsDriverAPI const MaterialRequiredStreams& GetRequiredStreams ( ) const

Get the required streams.

Required streams is for generating mesh render items.

See also:
MaterialRequiredStreams
GraphicsDriverAPI MaterialRequiredStreams& GetRequiredStreams ( )

Get the required streams.

Required streams is for generating mesh render items.

See also:
MaterialRequiredStreams
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.
GraphicsDriverAPI const MeshElementDescription& GetMeshElementDescription ( size_t  i ) const

Get the i-th mesh element description.

Parameters:
[in] i the index of the mesh element description
Returns:
the i-th mesh element description.
GraphicsDriverAPI const MeshElementDescription* FindMeshElementDescription ( unsigned long  descriptionBits ) const

Find the mesh element description based on the given descriptionBits.

Parameters:
[in] descriptionBits the description bits of the mesh element description
See also:
MeshElementDescription::GetDescriptionBits()
Returns:
the required mesh element description if found or NULL otherwise.
GraphicsDriverAPI const MeshElementDescription* FindMeshElementDescription ( MeshElementType  type,
MeshPart  part 
) const

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

Parameters:
[in] type mesh element type
[in] part mesh part
Returns:
the required mesh element description if found or NULL otherwise.
GraphicsDriverAPI void AddMeshElementDescription ( const MeshElementDescription meshElementDescription )

Add a new mesh element description.

Parameters:
[in] meshElementDescription the new mesh element description.
GraphicsDriverAPI void AddBuiltInMeshElementDescription ( BuiltInMeshElementDescription  type )

Add a built-in mesh element description.

Parameters:
[in] type the type of built-in mesh element description
GraphicsDriverAPI void ClearMeshElementDescriptions ( )

Clear all mesh element descriptions.

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] objectComponentRequirements the object component requirements from the update display context.
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] updateDisplayContext the update display context
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] hRenderNode the render node for which invisible descriptions will be removed

Member Data Documentation