IObjectDisplay2 Class Reference
 
 
 
IObjectDisplay2 Class Reference

This reference page is linked to from the following overview topics: Nitrous Graphics SDK Extensions, Plug-in Display Interface, About RenderItem.


#include <IObjectDisplay2.h>

Inheritance diagram for IObjectDisplay2:
BaseInterface InterfaceServer MaxHeapOperators

Class Description

To give object plugins better control of display, now object plugins can expose IObjectDisplay2 interface.

This interface allows object plugins to provide different RenderItem for different nodes and different views.

If an object plugin provides both IObjectDisplay2 and IObjectDisplay interface, only IObjectDisplay2 will be used. IObjectDisplay interface is still supported by Nitrous, however, we don�t suggest plugins to use it anymore. In the future it will be obsoleted.

Public Member Functions

GraphicsDriverAPI  IObjectDisplay2 ()
virtual GraphicsDriverAPI  ~IObjectDisplay2 ()
virtual GraphicsDriverAPI
unsigned long 
GetObjectDisplayRequirement () const
  Return the object display requirement of this object.
virtual bool  PrepareDisplay (const MaxContext &maxContext, const UpdateDisplayContext &prepareDisplayContext)=0
  An object could be referenced by multiple nodes at the same time, while different node may requires different display of the object (backface cull vs.
virtual bool  UpdatePerNodeItems (const MaxContext &maxContext, const UpdateDisplayContext &updateDisplayContext, UpdateNodeContext &nodeContext, IRenderItemContainer &targetRenderItemContainer)=0
  This function will be called for each owner nodes of a given object plugin.
virtual GraphicsDriverAPI bool  UpdatePerViewItems (const MaxContext &maxContext, const UpdateDisplayContext &updateDisplayContext, UpdateNodeContext &nodeContext, UpdateViewContext &viewContext, IRenderItemContainer &targetRenderItemContainer)
  This function will be called for each viewport and for each owner nodes of a given object plugin.
virtual GraphicsDriverAPI
Interface_ID 
GetID ()
virtual GraphicsDriverAPI
BaseInterface
GetInterface (Interface_ID id)

Constructor & Destructor Documentation

GraphicsDriverAPI IObjectDisplay2 ( )
virtual GraphicsDriverAPI ~IObjectDisplay2 ( ) [virtual]

Member Function Documentation

virtual GraphicsDriverAPI unsigned long GetObjectDisplayRequirement ( ) const [virtual]

Return the object display requirement of this object.

virtual bool PrepareDisplay ( const MaxContext maxContext,
const UpdateDisplayContext prepareDisplayContext 
) [pure virtual]

An object could be referenced by multiple nodes at the same time, while different node may requires different display of the object (backface cull vs.

non-backface cull, vertex color shading vs. material shading, etc.). IObjectDisplay2::PrepareDisplay gives object plugins a chance to prepare display data for all nodes, thus avoid duplicate display data generation for each node or each view. If an object contains a Mesh or MNMesh and wants to display it, then Mesh::PrepareDisplay or MNMesh::PrepareDisplay must be called in this function.

Parameters:
maxContext Contains all viewports in which this object will be displayed.
prepareDisplayContext The display context, which contains all the requirements for plugin to generate render items.
Returns:
true if prepare successfully, false otherwise.
virtual bool UpdatePerNodeItems ( const MaxContext maxContext,
const UpdateDisplayContext updateDisplayContext,
UpdateNodeContext nodeContext,
IRenderItemContainer targetRenderItemContainer 
) [pure virtual]

This function will be called for each owner nodes of a given object plugin.

Plugins can follow the input node properties, and create appropriate RenderItem. For example, if an object wants to display high-resolution mesh when node is selected, and display low-resolution mesh when node is not selected, it can use this function to create different DisplayItem for different notes.

Parameters:
maxContext Contains all viewports in which this object will be displayed.
updateDisplayContext The display context, which contains all the requirements for plugin to generate render items.
nodeContext which contains all infos required for adding per node relevant render items.
targetRenderItemContainer the target render item container to which this plugin object will be added.
Returns:
true if successful or false otherwise
virtual GraphicsDriverAPI bool UpdatePerViewItems ( const MaxContext maxContext,
const UpdateDisplayContext updateDisplayContext,
UpdateNodeContext nodeContext,
UpdateViewContext viewContext,
IRenderItemContainer targetRenderItemContainer 
) [virtual]

This function will be called for each viewport and for each owner nodes of a given object plugin.

If plugin wants to display / hide certain RenderItem for a given view property, plugin can override this function and update RenderItem based on the input view properties.

Note:
that this function is optional. If plugin doesn�t have view-dependent RenderItem, it doesn�t need to override this function.
Parameters:
maxContext Contains all viewports in which this object will be displayed.
pView the view for which render items will be updated
updateDisplayContext The display context, which contains all the requirements for plugin to generate render items.
nodeContext which contains all infos required for adding per node relevant render items.
targetRenderItemContainer the target render item container to which this plugin object will be added.
Returns:
true if the plugin has updated any render items for hTargetNode or false otherwise. We STRONGLY suggest return false for performance sake when no any render item has been actually updated.
virtual GraphicsDriverAPI Interface_ID GetID ( ) [virtual]
Remarks:
This method returns the unique interface ID.

Reimplemented from BaseInterface.

virtual GraphicsDriverAPI BaseInterface* GetInterface ( Interface_ID  id ) [virtual]
Remarks:
Returns a pointer to the interface whose ID is specified.
Parameters:
Interface_ID id

The ID of the interface to return.
Default Implementation:
{ return NULL; }

Reimplemented from BaseInterface.