Class ITrackViewNode

3DS Max Plug-In SDK

Class ITrackViewNode

See Also: Class ReferenceTarget, Class Interface, Class Control, Class ImageFilter, Class TVNodeNotify.

class ITrackViewNode : public ReferenceTarget

Description:

This class provides an interface to Track View Nodes. A Track View Node is simpy a class that has zero or more sub-track view nodes and zero or more sub-controllers. This is mainly used to provide a place for Global Variable tracks (labeled "Global Tracks" in Track View) and Video Post tracks (labelled "Video Post" in Track View).

The TrackViewNode sub-nodes and sub-controllers are identified by a unique ID in the form of a Class_ID variable. This does not necessarily have to be the Class_ID of an existing plug-in, however plug-ins may wish to use their Class_ID for any items they add to be sure they are unique.

The Interface class provides access to the root track view node:

virtual ITrackViewNode *GetTrackViewRootNode()=0;

From the root track view node, new nodes may be added. There are two defined sub nodes identified by the following #defined Class_IDs:

#define GLOBAL_VAR_TVNODE_CLASS_ID Class_ID(0xb27e9f2a, 0x73fad370)

#define VIDEO_POST_TVNODE_CLASS_ID Class_ID(0x482b8d30, 0xb72c8511)

These can be retreived by calling GetNode() on the track view root node and passing in one of the above IDs.

All methods of this class are implemented by the system.

Note: Developers can also create their own track view node using the following global function:

 

Function:

ITrackViewNode *CreateITrackViewNode(BOOL hidden=FALSE);

Remarks:

This method is used to add a track view node.

Parameters:

BOOL hidden=FALSE

If FALSE the node is hidden; otherwise it is visible in the viewports.

Methods:

Prototype:

virtual void AddNode(ITrackViewNode *node, TCHAR *name, Class_ID cid, int pos=TVNODE_APPEND)=0;

Remarks:

This method is used to add a track view node.

Parameters:

ITrackViewNode *node

Points to the Track View Node to add.

TCHAR *name

The name for the node that appears in Track View.

Class_ID cid

The Class_ID which identifies the plug-in that added the node.

int pos=TVNODE_APPEND

The position in the list of nodes where this one is added. If this defaults to TVNODE_APPEND the node is added at the end of the list.

Prototype:

virtual void AddController(Control *c, TCHAR *name, Class_ID cid, int pos=TVNODE_APPEND)=0;

Remarks:

This method is used to add a track view controller.

Parameters:

Control *c

Points to the controller to add.

TCHAR *name

The name that will appear in Track View.

Class_ID cid

The Class_ID of the plug-in that adds the controller.

int pos=TVNODE_APPEND

The position in the list where the controller is added. If this defaults to TVNODE_APPEND the controller is added at the end of the list.

Prototype:

virtual int FindItem(Class_ID cid)=0;

Remarks:

A Track View Node maintains a table that contains the sub-nodes and sub-controllers. This method returns the index into the table of the node or controller whose Class_ID is passed. If the Class_ID could not be found then -1 is returned.

Parameters:

Class_ID cid

The Class_ID to find.

Prototype:

virtual void RemoveItem(int i)=0;

Remarks:

A Track View Node maintains a table that contains the sub-nodes and sub-controllers. This method removes the 'i-th' sub-node or sub-controller of the table.

Parameters:

int i

The zero based index into the table of the item to remove.

Prototype:

virtual void RemoveItem(Class_ID cid)=0;

Remarks:

A Track View Node maintains a table that contains the sub-nodes and sub-controllers. This method removes the sub-node or sub-controller whose Class_ID is passed from the table.

Parameters:

Class_ID cid

The Class_ID used when the node or controller was added.

Prototype:

virtual Control *GetController(int i)=0;

Remarks:

This method returns a pointer to the 'I-th' sub-controller.

Parameters:

int i

The zero based index of the sub-controller.

Prototype:

virtual Control *GetController(Class_ID cid)=0;

Remarks:

This method returns a pointer to the sub-controller whose Class_ID is passed.

Parameters:

Class_ID cid

The Class_ID used when the controller was added.

Prototype:

virtual ITrackViewNode *GetNode(int i)=0;

Remarks:

This method returns a pointer to the 'i-th' sub-node.

Parameters:

int i

The zero based index of the sub-node.

Prototype:

virtual ITrackViewNode *GetNode(Class_ID cid)=0;

Remarks:

This method returns a pointer to the sub-node whose Class_ID is passed.

Parameters:

Class_ID cid

The Class_ID used when the controller was added.

Prototype:

virtual int NumItems()=0;

Remarks:

This method returns the total number of sub-nodes and/or sub-controllers in the table.

Prototype:

virtual void SwapPositions(int i1, int i2)=0;

Remarks:

This method is used to rearrange the elements in the table so item i1 is where i2 was and i2 is where i1 was.

Parameters:

int i1

The zero based index into the table of one of the items to swap.

int i2

The zero based index into the table of the other item to swap.

Prototype:

virtual TCHAR *GetName(int i)=0;

Remarks:

Returns the name of the 'i-th' sub-node or sub-controller.

Parameters:

int i

The zero based index into the table of the item whose name to return.

Prototype:

virtual void SetName(int i,TCHAR *name)=0;

Remarks:

Sets the name of the 'i-th' sub-node or sub-controller to the name passed.

Parameters:

int i

The zero based index into the table of the item whose name to set.

TCHAR *name

The new name for the sub-node or sub-controller.

Prototype:

virtual void RegisterTVNodeNotify(TVNodeNotify *notify)=0;

Remarks:

Registers the track view notify callback object so it recieves reference messages.

Parameters:

TVNodeNotify *notify

Points to the callback object to register.

Prototype:

virtual void UnRegisterTVNodeNotify(TVNodeNotify *notify)=0;

Remarks:

Un-Registers the track view notify callback object.

Parameters:

TVNodeNotify *notify

Points to the callback object to register.

Prototype:

virtual void HideChildren(BOOL chide)=0;

Remarks:

This method is available in release 4.0 and later only.

This may be used to prevent child nodes from showing up in Track View.

Parameters:

BOOL chide

Pass TRUE to have children hidden; FALSE to have them visible.