RecordGeometryAction Class Reference

This action records the current mould geometry being used by a particular mould node. Once recorded this allows the geometry to be changed. During undo the old geometry will be replaced but not initialised. More...

#include <moldedit.h>

Inheritance diagram for RecordGeometryAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 RecordGeometryAction ()
 RecordGeometryAction constructor.
 ~RecordGeometryAction ()
virtual ActionCode Execute ()
 Executes the InvalidateRectAction which invalidates a rectangular region of the current document.

Static Public Member Functions

static ActionCode Init (Operation *const pOp, ActionList *pActionList, NodeMould *const pMould, Action **NewAction)
 This simple action saves away the current mould space (geometry) defined by this mould object. The mould space may then be deleted externally and replaced with another. During undo the new space will be recorded and the old space rebuilt.
static ActionCode DoRecord (Operation *const pOp, NodeMould *const pMould)
 This simple action saves away the current mould space (geometry) defined by this mould object. The mould space may then be deleted externally and replaced with another. During undo the new space will be recorded and the old space rebuilt.

Private Attributes

NodeMouldpSavedMould
MouldGeometrypSavedGeometry

Detailed Description

This action records the current mould geometry being used by a particular mould node. Once recorded this allows the geometry to be changed. During undo the old geometry will be replaced but not initialised.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/03/95
See also:
NodeMould::SaveContext()

Definition at line 221 of file moldedit.h.


Constructor & Destructor Documentation

RecordGeometryAction::RecordGeometryAction  ) 
 

RecordGeometryAction constructor.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/95

Definition at line 1130 of file moldedit.cpp.

01131 {
01132     pSavedMould=NULL;
01133     pSavedGeometry=NULL;
01134 }

RecordGeometryAction::~RecordGeometryAction  ) 
 

Definition at line 1136 of file moldedit.cpp.

01137 {
01138     if (pSavedGeometry!=NULL)
01139     {
01140         delete pSavedGeometry;
01141         pSavedGeometry=NULL;
01142     }
01143 }


Member Function Documentation

ActionCode RecordGeometryAction::DoRecord Operation *const   pOp,
NodeMould *const   pMould
[static]
 

This simple action saves away the current mould space (geometry) defined by this mould object. The mould space may then be deleted externally and replaced with another. During undo the new space will be recorded and the old space rebuilt.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/03/95
Parameters:
pOp = The operation to which the action should be added [INPUTS] pMould = a pointer to a mould object we wish to record the geometry of
- [OUTPUTS]
Returns:
ActionCode: one of AC_OK, AC_NORESTORE, AC_FAIL

Definition at line 1165 of file moldedit.cpp.

01167 {
01168     ERROR2IF(pMould==NULL,AC_FAIL,"Mould pointer is NULL in RecordGeometryAction()");
01169     RecordGeometryAction* GeomAction;
01170     // Attempt to initialise the next action    
01171     return RecordGeometryAction::Init(pOp, pOp->GetUndoActionList(), pMould, (Action**)(&GeomAction));
01172 }

ActionCode RecordGeometryAction::Execute  )  [virtual]
 

Executes the InvalidateRectAction which invalidates a rectangular region of the current document.

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

Reimplemented from Action.

Definition at line 1238 of file moldedit.cpp.

01239 {
01240     RecordGeometryAction* GeomAction;  
01241     ActionCode Ac;  
01242     // Attempt to initialise the next action    
01243     Ac = RecordGeometryAction::Init(pOperation, pOppositeActLst, pSavedMould, (Action**)(&GeomAction));
01244     
01245     if (Ac!=AC_FAIL)
01246     {   
01247         // set the geometry using this new mould shape
01248         if (!pSavedMould->SetGeometry(pSavedGeometry))
01249             return AC_FAIL;
01250 
01251         // Make sure the destructor doesn't vape it
01252         pSavedGeometry=NULL;
01253     }
01254     return Ac;
01255 }   

ActionCode RecordGeometryAction::Init Operation *const   pOp,
ActionList pActionList,
NodeMould *const   pMould,
Action **  NewAction
[static]
 

This simple action saves away the current mould space (geometry) defined by this mould object. The mould space may then be deleted externally and replaced with another. During undo the new space will be recorded and the old space rebuilt.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/03/95
Parameters:
pOp,: The operation to which the action should be added [INPUTS] pActionList: The action list in the operation object pMould: A pointer to a mould object whose geometry we will record.
NewAction,: A pointer to the action if it could be allocated. [OUTPUTS]
Returns:
ActionCode: one of AC_OK, AC_NORESTORE, AC_FAIL

Definition at line 1199 of file moldedit.cpp.

01203 {       
01204     ERROR2IF(pMould==NULL,AC_FAIL,"Mould pointer is NULL in RecordGeometryAction()");
01205     MouldGeometry* pGeometry = pMould->GetGeometry();
01206     ERROR2IF(pGeometry==NULL, AC_FAIL, "There was no defined geometry in RecordGeometryAction");
01207 
01208     // find the size of the geometry we need to save
01209     ActionCode Ac = (Action::Init(pOp,
01210                                   pActionList,
01211                                   sizeof(RecordGeometryAction), 
01212                                   CC_RUNTIME_CLASS(RecordGeometryAction), 
01213                                   NewAction));
01214     if (*NewAction != NULL)
01215     {
01216         ((RecordGeometryAction*)(*NewAction))->pSavedMould = pMould;
01217         ((RecordGeometryAction*)(*NewAction))->pSavedGeometry = pGeometry;
01218     }
01219 
01220     return (Ac); 
01221 } 


Member Data Documentation

MouldGeometry* RecordGeometryAction::pSavedGeometry [private]
 

Definition at line 240 of file moldedit.h.

NodeMould* RecordGeometryAction::pSavedMould [private]
 

Definition at line 239 of file moldedit.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:21 2007 for Camelot by  doxygen 1.4.4