3ds Max C++ API Reference
RenderNodeHandle Class Reference

This class describes a graphics node. More...

#include <RenderNodeHandle.h>

+ Inheritance diagram for RenderNodeHandle:

Public Member Functions

GraphicsDriverAPI RenderNodeHandle ()
 
GraphicsDriverAPI RenderNodeHandle (const RenderNodeHandle &from)
 
GraphicsDriverAPI RenderNodeHandleoperator= (const RenderNodeHandle &from)
 
virtual GraphicsDriverAPI ~RenderNodeHandle ()
 
GraphicsDriverAPI bool Initialize ()
 Initialize this graphics node. More...
 
virtual GraphicsDriverAPI const Matrix44GetWorldMatrix () const
 Returns the world matrix of this node. More...
 
GraphicsDriverAPI void SetWorldMatrix (const Matrix44 &matWorld)
 Set the world matrix of this node. More...
 
GraphicsDriverAPI void SetObjectBox (const Box3 &bbox)
 Set the bounding box of this node in its own space. More...
 
GraphicsDriverAPI INodeGetMaxNode () const
 Returns the max node. More...
 
GraphicsDriverAPI bool GetPrimaryVisibility () const
 Returns whether this node would be visible to cameras in the scene. More...
 
GraphicsDriverAPI bool GetSecondaryVisibility () const
 Returns whether this node would appear in rendered reflections and refractions. More...
 
GraphicsDriverAPI bool GetReceiveShadows () const
 Returns whether this node could receive shadows. More...
 
GraphicsDriverAPI bool GetCastShadows () const
 Returns whether this node could case shadows. More...
 
GraphicsDriverAPI bool GetNoCulling () const
 Returns whether this node should not be culled when rendering. More...
 
GraphicsDriverAPI void SetNoCulling (bool onOff)
 
GraphicsDriverAPI bool GetSelected () const
 Returns whether this node is selected. More...
 
GraphicsDriverAPI bool GetBoxMode () const
 Returns whether this node is in bounding box mode. More...
 
GraphicsDriverAPI bool GetBackFaceCull () const
 Returns whether back face cull is enabled on this node. More...
 
GraphicsDriverAPI DWORD GetWireColor () const
 Returns the wire color of this node. More...
 
GraphicsDriverAPI float GetOpacity () const
 Returns the opacity of this node. More...
 
GraphicsDriverAPI size_t GetNumberOfRenderItems () const
 Get the number of render items that this node contains. More...
 
GraphicsDriverAPI RenderItemHandle GetRenderItem (size_t i) const
 Get the i-th render item of this node. More...
 
GraphicsDriverAPI void AddRenderItem (const RenderItemHandle &pRenderItem)
 Add a render item to this node. More...
 
GraphicsDriverAPI void RemoveRenderItem (size_t i)
 Remove the render item with the specified index from this node. More...
 
GraphicsDriverAPI void SetRenderItemDefaultMaterial (size_t i, const BaseMaterialHandle &hMaterial)
 Set the default material for the given render item. More...
 
GraphicsDriverAPI BaseMaterialHandle GetSolidMaterial () const
 Get the solid material assigned to the current node. More...
 
GraphicsDriverAPI void SetSolidMaterial (const BaseMaterialHandle &solidMaterial)
 Set the solid material. More...
 
GraphicsDriverAPI BaseMaterialHandle GetWireframeMaterial () const
 Get the wireframe material assigned to the current node. More...
 
GraphicsDriverAPI void SetWireframeMaterial (const BaseMaterialHandle &wireframeMaterial)
 Set the wirefrmame material. More...
 
GraphicsDriverAPI void ClearAllRenderItems ()
 Remove all render items from this node. 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 class describes a graphics node.

A graphics node is the container of render items. It also contains a material to shade all those render items. One render item could be added to multiple node to share the graphics data.

Constructor & Destructor Documentation

◆ RenderNodeHandle() [1/2]

◆ RenderNodeHandle() [2/2]

◆ ~RenderNodeHandle()

virtual GraphicsDriverAPI ~RenderNodeHandle ( )
virtual

Member Function Documentation

◆ operator=()

GraphicsDriverAPI RenderNodeHandle& operator= ( const RenderNodeHandle from)

◆ Initialize()

GraphicsDriverAPI bool Initialize ( )

Initialize this graphics node.

Returns
true if successfully initialized, false otherwise.

◆ GetWorldMatrix()

virtual GraphicsDriverAPI const Matrix44& GetWorldMatrix ( ) const
virtual

Returns the world matrix of this node.

Returns
the world matrix.

◆ SetWorldMatrix()

GraphicsDriverAPI void SetWorldMatrix ( const Matrix44 matWorld)

Set the world matrix of this node.

Parameters
matWorldthe world matrix of this node.

◆ SetObjectBox()

GraphicsDriverAPI void SetObjectBox ( const Box3 bbox)

Set the bounding box of this node in its own space.

Parameters
bboxthe bounding box of this node in its own space.

◆ GetMaxNode()

GraphicsDriverAPI INode* GetMaxNode ( ) const

Returns the max node.

Returns
the max node.

◆ GetPrimaryVisibility()

GraphicsDriverAPI bool GetPrimaryVisibility ( ) const

Returns whether this node would be visible to cameras in the scene.

Returns
true if this node is visible to cameras in the scene, false otherwise.

◆ GetSecondaryVisibility()

GraphicsDriverAPI bool GetSecondaryVisibility ( ) const

Returns whether this node would appear in rendered reflections and refractions.

Returns
true if this node would appear in rendered reflections and refractions, false otherwise.

◆ GetReceiveShadows()

GraphicsDriverAPI bool GetReceiveShadows ( ) const

Returns whether this node could receive shadows.

Returns
true if this node could receiver shadows, false otherwise.

◆ GetCastShadows()

GraphicsDriverAPI bool GetCastShadows ( ) const

Returns whether this node could case shadows.

Returns
true if this node could case shadows, false otherwise.

◆ GetNoCulling()

GraphicsDriverAPI bool GetNoCulling ( ) const

Returns whether this node should not be culled when rendering.

Returns
true if this node should not be culled when rendering, false otherwise.

◆ SetNoCulling()

GraphicsDriverAPI void SetNoCulling ( bool  onOff)

◆ GetSelected()

GraphicsDriverAPI bool GetSelected ( ) const

Returns whether this node is selected.

Returns
true if this node is selected, false otherwise.

◆ GetBoxMode()

GraphicsDriverAPI bool GetBoxMode ( ) const

Returns whether this node is in bounding box mode.

A node is in bounding box mode means that only the bounding box of this node would be shown in the view port.

Returns
true if this node is in bounding box mode, false otherwise.

◆ GetBackFaceCull()

GraphicsDriverAPI bool GetBackFaceCull ( ) const

Returns whether back face cull is enabled on this node.

Returns
true if back face cull is enabled on this node, false otherwise.

◆ GetWireColor()

GraphicsDriverAPI DWORD GetWireColor ( ) const

Returns the wire color of this node.

Returns
the wire color of this node.

◆ GetOpacity()

GraphicsDriverAPI float GetOpacity ( ) const

Returns the opacity of this node.

Returns
the opacity of this node.

◆ GetNumberOfRenderItems()

GraphicsDriverAPI size_t GetNumberOfRenderItems ( ) const

Get the number of render items that this node contains.

Returns
the number of render items that this node contains.

◆ GetRenderItem()

GraphicsDriverAPI RenderItemHandle GetRenderItem ( size_t  i) const

Get the i-th render item of this node.

This function will not modify the reference count of the returned render item.

Parameters
ithe index to the render item.
Returns
the i-th render item of this node.

◆ AddRenderItem()

GraphicsDriverAPI void AddRenderItem ( const RenderItemHandle pRenderItem)

Add a render item to this node.

This function will add reference to the input render item.

Parameters
pRenderItemthe render item to add.

◆ RemoveRenderItem()

GraphicsDriverAPI void RemoveRenderItem ( size_t  i)

Remove the render item with the specified index from this node.

Parameters
ithe index of the render item to be removed.

◆ SetRenderItemDefaultMaterial()

GraphicsDriverAPI void SetRenderItemDefaultMaterial ( size_t  i,
const BaseMaterialHandle hMaterial 
)

Set the default material for the given render item.

The material for a render item could be determined by three parameters:

  • the override material of the render item (highest priority).
  • the "default" material of the render item (medium priority).
  • the node material (lowest priority).

According to this priority, the "default" material will be used, if the render item doesn't have an override material.

Different render item could has different "default" material for the same node. For example: the default material for wireframe render item could be a solid white material.

Parameters
ithe index of the render item.
hMaterialthe default material of that render item.

◆ GetSolidMaterial()

GraphicsDriverAPI BaseMaterialHandle GetSolidMaterial ( ) const

Get the solid material assigned to the current node.

Note
A custom solid material could be specified when updating per node items. This material would be passed to the inner mesh whose solid mesh render item will be assign this material.

◆ SetSolidMaterial()

GraphicsDriverAPI void SetSolidMaterial ( const BaseMaterialHandle solidMaterial)

Set the solid material.

◆ GetWireframeMaterial()

GraphicsDriverAPI BaseMaterialHandle GetWireframeMaterial ( ) const

Get the wireframe material assigned to the current node.

◆ SetWireframeMaterial()

GraphicsDriverAPI void SetWireframeMaterial ( const BaseMaterialHandle wireframeMaterial)

Set the wirefrmame material.

◆ ClearAllRenderItems()

GraphicsDriverAPI void ClearAllRenderItems ( )

Remove all render items from this node.

Also release reference to those render items.