IObjectDisplay Class Reference
 
 
 
IObjectDisplay Class Reference

#include <IObjectDisplay.h>

Inheritance diagram for IObjectDisplay:
BaseInterface InterfaceServer MaxHeapOperators

Class Description

This is the base interface for all objects that want to be displayed in viewport.

A plug-in which desires to be displayed in the viewport must expose this interface to 3ds Max via the GetInterface function. Max will then obtain graphics data via this interfaces. The possible plug-in types that need this interface are: Modifiers, Objects and Controllers.

Internally plugin should maintain a set of render items and manage the life time of all those items. Plugin needs to decide the type of the most fit render items and fill in correct graphics data into them.

Public Member Functions

GraphicsDriverAPI  IObjectDisplay ()
virtual GraphicsDriverAPI  ~IObjectDisplay ()
virtual bool  RequiresSupportForLegacyDisplayMode () const =0
  Check if this plugin contains legacy display code and want legacy code to be called as well.
virtual bool  UpdateDisplay (const MaxContext &maxContext, const UpdateDisplayContext &displayContext)=0
  Manually update all render items of this object.
virtual GraphicsDriverAPI bool  AddRenderItems (const MaxContext &maxContext, RenderNodeHandle &hTargetNode, IRenderItemContainer &targetRenderItemContainer)
  Add render items of this plugin to the given node.
virtual const
RenderItemHandleArray
GetRenderItems () const =0
  Retrieves the render items to be displayed.
virtual GraphicsDriverAPI
Interface_ID 
GetID ()
virtual GraphicsDriverAPI
BaseInterface
GetInterface (Interface_ID id)
GraphicsDriverAPI void  SetFrameStamp (size_t framestamp)
GraphicsDriverAPI size_t  GetFrameStamp () const

Static Public Member Functions

static GraphicsDriverAPI bool  DefaultAddRenderItems (const MaxContext &maxContext, RenderNodeHandle &hTargetNode, IRenderItemContainer &targetRenderItemContainer, const IRenderItemContainer &sourceRenderItemContainer)
  This is the default implementation to add render items to the given node.

Constructor & Destructor Documentation

GraphicsDriverAPI IObjectDisplay ( )
virtual GraphicsDriverAPI ~IObjectDisplay ( ) [virtual]

Member Function Documentation

virtual bool RequiresSupportForLegacyDisplayMode ( ) const [pure virtual]

Check if this plugin contains legacy display code and want legacy code to be called as well.

Returns:
true if contains legacy display code, false otherwise.
Remarks:
default return value is false.
virtual bool UpdateDisplay ( const MaxContext maxContext,
const UpdateDisplayContext displayContext 
) [pure virtual]

Manually update all render items of this object.

Plugin should build render items in this function to satisfy the input category, flags and required streams.

Parameters:
maxContext Contains all viewports in which this object will be displayed.
displayContext The display context, which contains all the requirements for plugin to generate render items.
Returns:
true if update successfully, false otherwise.
virtual GraphicsDriverAPI bool AddRenderItems ( const MaxContext maxContext,
RenderNodeHandle hTargetNode,
IRenderItemContainer targetRenderItemContainer 
) [virtual]

Add render items of this plugin to the given node.

Parameters:
maxContext Contains all viewports in which this object will be displayed.
hTargetNode the render node handle that reference this plugin object.
targetRenderItemContainer the target render item container to which this plugin object will be added.
Returns:
true if added successfully, false otherwise.
virtual const RenderItemHandleArray& GetRenderItems ( ) const [pure virtual]

Retrieves the render items to be displayed.

Returns:
the render items to be displayed.
static GraphicsDriverAPI bool DefaultAddRenderItems ( const MaxContext maxContext,
RenderNodeHandle hTargetNode,
IRenderItemContainer targetRenderItemContainer,
const IRenderItemContainer sourceRenderItemContainer 
) [static]

This is the default implementation to add render items to the given node.

Parameters:
maxContext Contains all viewports in which the object will be displayed.
hTargetNode the render node handle that reference the plugin object.
targetRenderItemContainer the target render item container to which this plugin object will be added.
sourceRenderItemContainer the source render item container.
Returns:
true if update successfully, false otherwise.
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.

GraphicsDriverAPI void SetFrameStamp ( size_t  framestamp )
GraphicsDriverAPI size_t GetFrameStamp ( ) const