RenderNodeHandle Class Reference
 
 
 
RenderNodeHandle Class Reference

#include <RenderNodeHandle.h>

Inheritance diagram for RenderNodeHandle:
SmartHandle Noncopyable MaxHeapOperators

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

Public Member Functions

GraphicsDriverAPI  RenderNodeHandle ()
GraphicsDriverAPI  RenderNodeHandle (const RenderNodeHandle &from)
GraphicsDriverAPI
RenderNodeHandle
operator= (const RenderNodeHandle &from)
virtual GraphicsDriverAPI  ~RenderNodeHandle ()
GraphicsDriverAPI bool  Initialize ()
  Initialize this graphics node.
virtual GraphicsDriverAPI
const Matrix44
GetWorldMatrix () const
  Returns the world matrix of this node.
GraphicsDriverAPI INode GetMaxNode () const
  Returns the max node.
GraphicsDriverAPI bool  GetPrimaryVisibility () const
  Returns whether this node would be visible to cameras in the scene.
GraphicsDriverAPI bool  GetSecondaryVisibility () const
  Returns whether this node would appear in rendered reflections and refractions.
GraphicsDriverAPI bool  GetReceiveShadows () const
  Returns whether this node could receive shadows.
GraphicsDriverAPI bool  GetCastShadows () const
  Returns whether this node could case shadows.
GraphicsDriverAPI bool  GetNoCulling () const
  Returns whether this node should not be culled when rendering.
GraphicsDriverAPI bool  GetSelected () const
  Returns whether this node is selected.
GraphicsDriverAPI bool  GetBoxMode () const
  Returns whether this node is in bounding box mode.
GraphicsDriverAPI bool  GetBackFaceCull () const
  Returns whether back face cull is enabled on this node.
GraphicsDriverAPI DWORD  GetWireColor () const
  Returns the wire color of this node.
GraphicsDriverAPI float  GetOpacity () const
  Returns the opacity of this node.
GraphicsDriverAPI size_t  GetNumberOfRenderItems () const
  Get the number of render items that this node contains.
GraphicsDriverAPI RenderItemHandle  GetRenderItem (size_t i) const
  Get the i-th render item of this node.
GraphicsDriverAPI void  AddRenderItem (const RenderItemHandle &pRenderItem)
  Add a render item to this node.
GraphicsDriverAPI void  RemoveRenderItem (size_t i)
  Remove the render item with the specified index from this node.
GraphicsDriverAPI void  SetRenderItemDefaultMaterial (size_t i, const BaseMaterialHandle &hMaterial)
  Set the default material for the given render item.
GraphicsDriverAPI
BaseMaterialHandle 
GetSolidMaterial () const
  Get the solid material assigned to the current node.
GraphicsDriverAPI void  SetSolidMaterial (const BaseMaterialHandle &solideMaterial)
  Set the solid material.
GraphicsDriverAPI void  ClearAllRenderItems ()
  Remove all render items from this node.

Constructor & Destructor Documentation

GraphicsDriverAPI RenderNodeHandle ( )
GraphicsDriverAPI RenderNodeHandle ( const RenderNodeHandle from )
virtual GraphicsDriverAPI ~RenderNodeHandle ( ) [virtual]

Member Function Documentation

GraphicsDriverAPI RenderNodeHandle& operator= ( const RenderNodeHandle from )
GraphicsDriverAPI bool Initialize ( )

Initialize this graphics node.

Returns:
true if successfully initialized, false otherwise.
virtual GraphicsDriverAPI const Matrix44& GetWorldMatrix ( ) const [virtual]

Returns the world matrix of this node.

Returns:
the world matrix.
GraphicsDriverAPI INode* GetMaxNode ( ) const

Returns the max node.

Returns:
the max node.
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.
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.
GraphicsDriverAPI bool GetReceiveShadows ( ) const

Returns whether this node could receive shadows.

Returns:
true if this node could receiver shadows, false otherwise.
GraphicsDriverAPI bool GetCastShadows ( ) const

Returns whether this node could case shadows.

Returns:
true if this node could case shadows, false otherwise.
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.
GraphicsDriverAPI bool GetSelected ( ) const

Returns whether this node is selected.

Returns:
true if this node is selected, false otherwise.
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.
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.
GraphicsDriverAPI DWORD GetWireColor ( ) const

Returns the wire color of this node.

Returns:
the wire color of this node.
GraphicsDriverAPI float GetOpacity ( ) const

Returns the opacity of this node.

Returns:
the opacity of this node.
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.
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:
i the index to the render item.
Returns:
the i-th render item of this node.
GraphicsDriverAPI void AddRenderItem ( const RenderItemHandle pRenderItem )

Add a render item to this node.

This function will add reference to the input render item.

Parameters:
pRenderItem the render item to add.
GraphicsDriverAPI void RemoveRenderItem ( size_t  i )

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

Parameters:
i the index of the render item to be removed.
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:
i the index of the render item.
hMaterial the default material of that render item.
GraphicsDriverAPI BaseMaterialHandle GetSolidMaterial ( ) const

Get the solid material assigned to the current node.

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.

GraphicsDriverAPI void SetSolidMaterial ( const BaseMaterialHandle solideMaterial )

Set the solid material.

GraphicsDriverAPI void ClearAllRenderItems ( )

Remove all render items from this node.

Also release reference to those render items.