#include <ndoptmz.h>
Inheritance diagram for FactorOutCommonChildAttrAct:
Public Member Functions | |
FactorOutCommonChildAttrAct () | |
FactorOutCommonChildAttrAct constructor. | |
virtual ActionCode | Execute () |
Executes the FactorOutCommonChildAttrAct which factors out all attributes which are common to all children of the compound object. All common attributes become first children of the compound object. | |
virtual void | Slaughter () |
destructor which gets called when an operation is deleted | |
Static Public Member Functions | |
static ActionCode | Init (Operation *const pOp, ActionList *pActionList, NodeRenderableInk *CompoundObject, BOOL Global, AttrTypeSet *pAffectedAttrTypes, Action **NewAction) |
To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list. | |
Private Attributes | |
NodeRenderableInk * | CompoundObj |
AttrTypeSet * | pSetOfAffectedAttrTypes |
BOOL | Global |
Definition at line 171 of file ndoptmz.h.
|
FactorOutCommonChildAttrAct constructor.
Definition at line 1171 of file ndoptmz.cpp.
|
|
Executes the FactorOutCommonChildAttrAct which factors out all attributes which are common to all children of the compound object. All common attributes become first children of the compound object.
Reimplemented from Action. Definition at line 1193 of file ndoptmz.cpp. 01194 { 01195 LocaliseCommonAttrAct* NewAct; 01196 ActionCode ActCode; 01197 01198 // Attempt to initialise the LocaliseCommonAttrAct action which will localise the attributes 01199 if ((ActCode = LocaliseCommonAttrAct::Init(pOperation, 01200 pOppositeActLst, 01201 CompoundObj, 01202 Global, 01203 pSetOfAffectedAttrTypes, 01204 ( Action**)(&NewAct))) != AC_FAIL) 01205 { 01206 if (!CompoundObj->FactorOutCommonChildAttributes(Global, pSetOfAffectedAttrTypes)) 01207 { 01208 return AC_FAIL; 01209 } 01210 } 01211 return (ActCode); 01212 }
|
|
To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.
pCompound: The compound object Global: When TRUE the attributes on all parent compounds are also factored out. pAffectedAttrTypes: An optional set of attribute types. If this is specified then we only consider factoring out those attributes which have a type which is in this set.
AC_OK : The action was successfully initialised and added to the operation. The function calls the Action::Init function passing the runtime class of a FactorOutCommonChildAttrAct.
Definition at line 1265 of file ndoptmz.cpp. 01272 { 01273 ActionCode Ac = (Action::Init(pOp, 01274 pActionList, 01275 sizeof(FactorOutCommonChildAttrAct), 01276 CC_RUNTIME_CLASS(FactorOutCommonChildAttrAct), 01277 NewAction)); 01278 01279 if (*NewAction != NULL) 01280 { 01281 ((FactorOutCommonChildAttrAct*)(*NewAction))->CompoundObj = pCompound; 01282 ((FactorOutCommonChildAttrAct*)(*NewAction))->pSetOfAffectedAttrTypes = pAffectedAttrTypes; 01283 ((FactorOutCommonChildAttrAct*)(*NewAction))->Global = global; 01284 } 01285 01286 return (Ac); 01287 }
|
|
destructor which gets called when an operation is deleted
Reimplemented from Action. Definition at line 1304 of file ndoptmz.cpp. 01305 { 01306 // Destroy the set of attribute types 01307 if (pSetOfAffectedAttrTypes) 01308 { 01309 pSetOfAffectedAttrTypes->DeleteAll(); 01310 delete pSetOfAffectedAttrTypes; 01311 } 01312 01313 // call the base class to destroy the action 01314 Action::Slaughter(); 01315 }
|
|
|
|
|
|
|