LocaliseCommonAttrAct Class Reference

This action copies all attributes common to the group to each child object within the group which requires each attribute. The groups common attributes are deleted. More...

#include <ndoptmz.h>

Inheritance diagram for LocaliseCommonAttrAct:

Action ListItem CCObject SimpleCCObject List of all members.

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

NodeRenderableInkCompoundObj
AttrTypeSetpSetOfAffectedAttrTypes
BOOL Global

Detailed Description

This action copies all attributes common to the group to each child object within the group which requires each attribute. The groups common attributes are deleted.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/9/93
A FactorOutCommonChildAttrAct action twin is generated to redo

See also:
UndoableOperation::DoFactorOutCommonChildAttributes

Definition at line 213 of file ndoptmz.h.


Constructor & Destructor Documentation

LocaliseCommonAttrAct::LocaliseCommonAttrAct  ) 
 

LocaliseCommonAttrAct constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1337 of file ndoptmz.cpp.

01338 {
01339 }   


Member Function Documentation

ActionCode LocaliseCommonAttrAct::Execute  )  [virtual]
 

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.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/93
Parameters:
- [INPUTS]
ActionCode indicating if the action was successfully executed or not [OUTPUTS]
Returns:
-

Errors: -

See also:
FactorOutCommonChildAttrAct

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 }    

ActionCode LocaliseCommonAttrAct::Init Operation *const   pOp,
ActionList pActionList,
NodeRenderableInk pCompound,
BOOL  global,
AttrTypeSet pAffectedAttrTypes,
Action **  NewAction
[static]
 

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.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/9/93
Parameters:
pOp,: The operation to which the action should be added [INPUTS]
pActionList: The action list in the operation object

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.

Parameters:
NewAction,: A pointer to the action if it could be allocated. [OUTPUTS]
Returns:
AC_FAIL: There was not enough room in the operation history for the action and the user did not wish to continue. Usually End() should be called in this situation.
AC_NORECORD: There was not enough room in the operation history for the action, but the user requested that he wished to continue without undo.

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.

Returns:
Errors: -
See also:
Action::Init

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 }   

void LocaliseCommonAttrAct::Slaughter void   )  [virtual]
 

destructor which gets called when an operation is deleted

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/05/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
Action::Slaughter

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 }   


Member Data Documentation

NodeRenderableInk* LocaliseCommonAttrAct::CompoundObj [private]
 

Definition at line 232 of file ndoptmz.h.

BOOL LocaliseCommonAttrAct::Global [private]
 

Definition at line 234 of file ndoptmz.h.

AttrTypeSet* LocaliseCommonAttrAct::pSetOfAffectedAttrTypes [private]
 

Definition at line 233 of file ndoptmz.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:56:05 2007 for Camelot by  doxygen 1.4.4