IObjectDisplay Class Reference

This reference page is linked to from the following overview topics: Porting Object Plug-ins to Nitrous, Handling Requests for Interfaces.



Detailed 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. A render item should be created by calling XXXRenderItem::CreateInstance() and release via its ReleaseInterface function. plugin needs to decide the type of the most fit render items and fill in correct graphics data into them.

#include <IObjectDisplay.h>

Inheritance diagram for IObjectDisplay:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  IObjectDisplay ()
virtual  ~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 (unsigned long renderItemCategories, const MaterialRequiredStreams &materialRequiredStreams, TimeValue t)=0
  Manually update all render items of this object.
virtual const
RenderItemHandleArray
GetRenderItems () const =0
  Retrieves the render items to be displayed.
virtual Interface_ID  GetID ()
virtual BaseInterface GetInterface (Interface_ID id)
void  SetDirtyFlag (unsigned long flags)
unsigned long  GetDirtyFlag () const

Constructor & Destructor Documentation

IObjectDisplay ( ) [inline]
{}
virtual ~IObjectDisplay ( ) [inline, 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 ( unsigned long  renderItemCategories,
const MaterialRequiredStreams materialRequiredStreams,
TimeValue  t 
) [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:
renderItemCategories A combination of RenderItemCategory
materialRequiredStreams required streams of render items
t current time.
Returns:
true if update successfully, false otherwise.
virtual const RenderItemHandleArray& GetRenderItems ( ) const [pure virtual]

Retrieves the render items to be displayed.

Returns:
the render items to be displayed.
virtual Interface_ID GetID ( ) [inline, virtual]
Remarks:
This method returns the unique interface ID.

Reimplemented from BaseInterface.

                                 {
        return IOBJECT_DISPLAY_INTERFACE_ID;
    }
virtual BaseInterface* GetInterface ( Interface_ID  id ) [inline, 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.

                                                         {
        if (id == IOBJECT_DISPLAY_INTERFACE_ID) {
            return this;
        }

        return BaseInterface::GetInterface(id);
    }
void SetDirtyFlag ( unsigned long  flags ) [inline]
                                           {
        mFlags = flags;
    }
unsigned long GetDirtyFlag ( ) const [inline]
                                       {
        return mFlags;
    }

IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay
IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay IObjectDisplay