Public Member Functions

NodeDisplayCallback Class Reference

Search for all occurrences

Detailed Description

See also:
Class InterfaceServer, Class INodeDisplayControl, Class INode, Class ViewExp, Class IPoint2.

Description:
This class is available in release 4.0 and later only.

A callback to allow plug-ins that aren't actually objects (such as utilities) to control a Node's display.

This class enables you to display extra information on top of a node in a viewport. Once activated, a plug-in will control the display (on/off) of a node's world space representation as well as add data in a viewport on a per node basis. This approach allows you to replace the drawing code of every node without adding modifiers on top of each of them.

#include <nodedisp.h>

Inheritance diagram for NodeDisplayCallback:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void  StartDisplay (TimeValue t, ViewExp *vpt, int flags)=0
virtual void  EndDisplay (TimeValue t, ViewExp *vpt, int flags)=0
virtual bool  Display (TimeValue t, ViewExp *vpt, int flags, INode *node, Object *pObj)=0
virtual bool  SuspendObjectDisplay (TimeValue t, INode *node)=0
virtual void  AddNodeCallbackBox (TimeValue t, INode *node, ViewExp *vpt, Box3 &box, Object *pObj)=0
virtual bool  HitTest (TimeValue t, INode *node, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt, Object *pObj)=0
virtual void  Activate ()=0
virtual void  Deactivate ()=0
virtual MSTR  GetName () const =0

Member Function Documentation

virtual void StartDisplay ( TimeValue  t,
ViewExp vpt,
int  flags 
) [pure virtual]
Remarks:
This method is called just before 3ds Max draws the nodes in the scene.
Parameters:
TimeValue t

The time at which the nodes are being drawn.

ViewExp *vpt

Points to an interface for the viewport the node is being drawn in.

int flags

These flags are used internally.
virtual void EndDisplay ( TimeValue  t,
ViewExp vpt,
int  flags 
) [pure virtual]
Remarks:
This method is called just after 3ds Max draws the nodes in the scene.
Parameters:
TimeValue t

The time at which the nodes were drawn.

ViewExp *vpt

Points to an interface for the viewport the node is being drawn in.

int flags

These flags are used internally.
virtual bool Display ( TimeValue  t,
ViewExp vpt,
int  flags,
INode node,
Object pObj 
) [pure virtual]
Remarks:
This method is called for every node to allow it display itself.
Parameters:
TimeValue t

The time at which the node is to be drawn.

ViewExp *vpt

Points to an interface for the viewport in which the node is being drawn in.

int flags

The display flags, which are;

USE_DAMAGE_RECT

If this flag is set, only the damaged area needs to be displayed. The damaged rectangle may be retrieved using INode::GetDamagedRect(). See Class INode.

DISP_SHOWSUBOBJECT

This indicates if an item should display its sub-object selection state. The system will set this flag is the item is selected, the user is in the modify branch, and the item is in sub-object selection mode.

INode *node

Points to the node being drawn.
Returns:
true if displayed, otherwise false.
virtual bool SuspendObjectDisplay ( TimeValue  t,
INode node 
) [pure virtual]
Remarks:
This method is called to determine if the node mesh should be displayed. It should return true; otherwise return false.
Parameters:
TimeValue t

The time at which to check if the node should be displayed.

INode *node

The node to check.
virtual void AddNodeCallbackBox ( TimeValue  t,
INode node,
ViewExp vpt,
Box3 box,
Object pObj 
) [pure virtual]
Remarks:
This method will ask the callback to participate in the bounding box calculation.
Parameters:
TimeValue t

The time at which to calculate the bounding box.

INode *node

The node to calculate the bounding box for.

ViewExp *vpt

Points to an interface for the viewport in which the node is being drawn in.

Box3& box

A reference to the bounding box.
virtual bool HitTest ( TimeValue  t,
INode node,
int  type,
int  crossing,
int  flags,
IPoint2 p,
ViewExp vpt,
Object pObj 
) [pure virtual]
Remarks:
This method hit tests the callback's mesh.
Parameters:
TimeValue t

The time at which to hit test.

INode *node

A pointer to the node to test.

int type

The type of hit testing to perform. See Scene and Node Hit Test Types..

int crossing

The state of the crossing setting. If TRUE crossing selection is on.

int flags

The hit test flags. See Scene and Node Hit Testing Flags for details.

IPoint2 *p

The screen point to test.

ViewExp* vpt

An interface pointer that may be used to call methods associated with the viewports.
Returns:
true if the item was hit, otherwise false.
virtual void Activate ( ) [pure virtual]
Remarks:
This method is called when the callback gets activated. It is up to the callback to invalidate the screen.
virtual void Deactivate ( ) [pure virtual]
Remarks:
This method is called when the callback is deactivated.
virtual MSTR GetName ( ) const [pure virtual]
Remarks:
This method returns the name of the callback which is used for display in the menu. The user must delete the string returned.

NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback
NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback NodeDisplayCallback