Class used by EnumGeomPipeline to notify the pipeline of a collapse as well as maintaing the Custom Attributes.
This class is used in conjunction with ICustAttribCollapseManager. The calling code needs to make sure they call the correct version of the enumeration. The following is a code example of its usage.
ICustAttribCollapseManager * iCM = ICustAttribCollapseManager::GetICustAttribCollapseManager();
if(iCM && iCM->GetCustAttribSurviveCollapseState()) { NotifyCollapseMaintainCustAttribEnumProc2 PostNCEP(false,oldObj,true,obj); //use the CA safe version EnumGeomPipeline(&PostNCEP,oldObj); } else { NotifyCollapseEnumProc PostNCEP(false,node,obj); //use the original EnumGeomPipeline(&PostNCEP,oldObj); }
#include <modstack.h>
Public Member Functions |
|
CoreExport | NotifyCollapseMaintainCustAttribEnumProc2 (bool preCollapse, INode *node, bool ignoreBaseObjectCAs=false, Object *collapsedObj=NULL) |
Constructor. The private data members are
initialized by the passed parameters. |
|
virtual CoreExport PipeEnumResult | proc (ReferenceTarget *object, IDerivedObject *derObj, int index) |
This is the implementation of the
EnumGeomPipeline callback method
proc(). |
CoreExport NotifyCollapseMaintainCustAttribEnumProc2 | ( | bool | preCollapse, |
INode * | node, | ||
bool | ignoreBaseObjectCAs =
false , |
||
Object * | collapsedObj =
NULL |
||
) |
Constructor. The private data members are initialized by the passed parameters.
[in] | preCollapse | Indicates if this is a pre- collapse or a post- collapse. Pass true for pre and false for post. |
[in] | node | Points to the node at the beginning of the pipeline that was collapsed. |
[in] | ignoreBaseObjectCAs | If this is a post- collapse then specifies whether to apply CAs collected from the node's base object. |
[in] | collapsedObj | If this is a post- collapse then points to the object which is the result of the collapse. |
virtual CoreExport PipeEnumResult proc | ( | ReferenceTarget * | object, |
IDerivedObject * | derObj, | ||
int | index | ||
) | [virtual] |
This is the implementation of the EnumGeomPipeline callback method proc().
On a pre-collapse enumeration, collects the custom attributes on each object and its references (recursively), and calls NotifyPreCollapse on the object. On a post-collapse enumeration, applies the custom attributes previously collected to the collapsed object, and calls NotifyPostCollapse on the object. If ignoreBaseObjectCAs is true, CAs that were collected from the base object and its references are not applied. This is to account for cases of collapsing the stack where the base object is cloned. When the base object is cloned, it will create its own copy of the CAs.
Implements GeomPipelineEnumProc.