#include <ndoptmz.h>
Inheritance diagram for LocaliseCommonAttrAct:
Public Member Functions | |
LocaliseCommonAttrAct () | |
LocaliseCommonAttrAct constructor. | |
virtual ActionCode | Execute () |
Executes the LocaliseCommonAttrAct which copies all attributes common to the compound object to each child object within the group which requires each attribute. The groups common attributes are deleted. | |
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 213 of file ndoptmz.h.
|
LocaliseCommonAttrAct constructor.
Definition at line 1337 of file ndoptmz.cpp.
|
|
Executes the LocaliseCommonAttrAct which copies all attributes common to the compound object to each child object within the group which requires each attribute. The groups common attributes are deleted.
Reimplemented from Action. Definition at line 1359 of file ndoptmz.cpp. 01360 { 01361 FactorOutCommonChildAttrAct* NewAct; 01362 ActionCode ActCode; 01363 01364 // Attempt to initialise the FactorOutCommonChildAttrAct action 01365 if ((ActCode = FactorOutCommonChildAttrAct::Init(pOperation, 01366 pOppositeActLst, 01367 CompoundObj, 01368 Global, 01369 pSetOfAffectedAttrTypes, 01370 ( Action**)(&NewAct))) != AC_FAIL) 01371 { 01372 if (!CompoundObj->LocaliseCommonAttributes(TRUE, // Always check for duplicates when undoing 01373 Global, 01374 pSetOfAffectedAttrTypes)) 01375 { 01376 return AC_FAIL; 01377 } 01378 } 01379 return (ActCode); 01380 }
|
|
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: TRUE indicates that we should localise the attributes on all parent compound nodes (top down), before localising the attributes for this compound. pAffectedAttrTypes: An optional set of attribute types. If this is specified then we only consider localising 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 LocaliseCommonAttrAct.
Definition at line 1436 of file ndoptmz.cpp. 01443 { 01444 ActionCode Ac = (Action::Init(pOp, 01445 pActionList, 01446 sizeof(LocaliseCommonAttrAct), 01447 CC_RUNTIME_CLASS(LocaliseCommonAttrAct), 01448 NewAction)); 01449 01450 if (*NewAction != NULL) 01451 { 01452 ((LocaliseCommonAttrAct*)(*NewAction))->CompoundObj = pCompound; 01453 ((LocaliseCommonAttrAct*)(*NewAction))->Global = global; 01454 ((LocaliseCommonAttrAct*)(*NewAction))->pSetOfAffectedAttrTypes = pAffectedAttrTypes; 01455 01456 } 01457 01458 return (Ac); 01459 }
|
|
destructor which gets called when an operation is deleted
Reimplemented from Action. Definition at line 1477 of file ndoptmz.cpp. 01478 { 01479 // Destroy the set of attribute types 01480 if (pSetOfAffectedAttrTypes) 01481 { 01482 pSetOfAffectedAttrTypes->DeleteAll(); 01483 delete pSetOfAffectedAttrTypes; 01484 } 01485 01486 // call the base class to destroy the action 01487 Action::Slaughter(); 01488 }
|
|
|
|
|
|
|