Class NotifyCollapseEnumProc

3DS Max Plug-In SDK

Class NotifyCollapseEnumProc

See Also: Class GeomPipelineEnumProc, Class BaseObject, Class Object, Class IDerivedObject.

class NotifyCollapseEnumProc : public GeomPipelineEnumProc

Description:

This class is available in release 4.0 and later only.

Whenever the modifier stack is collapsed the code has to notify all objects in the stack with a Pre and a Post notification. In order to do this, this class can be used in conjunction with the method EnumGeomPipleine(). In the constructor one can specify, if it is a pre- or post- collapse notification. In case it is a post collapse the object that represents the result of the collapse has to be provided as well. The INode pointer to the beginning of the pipeline that was collapsed has to be provided in both cases.

All methods of this class are implemented by the System.

Methods:

public:

Prototype:

NotifyCollapseEnumProc(bool preCollapse, INode *n, Object *collapsedObj = NULL) : bPreCollapse(preCollapse), node(n), collapsedObject(collapsedObj);

Remarks:

Constructor. The private data members are initialized by the passed parameters.

Parameters:

bool preCollapse

Indicates if this is a pre- collapse or a post- collapse. Pass true for pre and false for post.

INode *n

Points to the node at the beginning of the pipeline that was collapsed.

Object *collapsedObj = NULL

If this is a post- collapse then points to the object which is the result of the collapse.

Sample Code:

The following code fragment shows using this constructor and then the EnumGeomPipeline with this object:

NotifyCollapseEnumProc PreNCEP(true,node);

EnumGeomPipeline(&PreNCEP,node);

Prototype:

virtual PipeEnumResult proc(ReferenceTarget *object,IDerivedObject *derObj, int index);

Remarks:

This is the implementation of the EnumGeomPipeline callback method proc() which calls BaseObject::NotifyPreCollapse or BaseObject::NotifyPostCollapse as required.