RecordPerspectiveAction Class Reference

This class records undo/redo information for the Perspective shape object. More...

#include <moldpers.h>

Inheritance diagram for RecordPerspectiveAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 RecordPerspectiveAction ()
 Constructor for the action to undo Perspective modification.
 ~RecordPerspectiveAction ()
 Destructor for the action to undo Perspective modification.
virtual ActionCode Execute ()
 This is the virtual function that is called when the action is executed by the Undo/Redo system. This is the function that actually undoes the Perspective change action by swapping the current internal definition of the Perspective with the contexts of itself.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, MouldPerspective *pPerspective, Action **NewAction)
 This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NORECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.

Private Attributes

MouldPerspectivepCPerspective
POINT RecordArray [4]

Detailed Description

This class records undo/redo information for the Perspective shape object.

class RecordPerspectiveAction : public Action

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

Definition at line 292 of file moldpers.h.


Constructor & Destructor Documentation

RecordPerspectiveAction::RecordPerspectiveAction  ) 
 

Constructor for the action to undo Perspective modification.

RecordPerspectiveAction::RecordPerspectiveAction()

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

Definition at line 1513 of file moldpers.cpp.

01514 {
01515     pCPerspective=NULL;
01516 }

RecordPerspectiveAction::~RecordPerspectiveAction  ) 
 

Destructor for the action to undo Perspective modification.

RecordPerspectiveAction::~RecordPerspectiveAction()

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

Definition at line 1529 of file moldpers.cpp.

01530 {
01531 }


Member Function Documentation

ActionCode RecordPerspectiveAction::Execute  )  [virtual]
 

This is the virtual function that is called when the action is executed by the Undo/Redo system. This is the function that actually undoes the Perspective change action by swapping the current internal definition of the Perspective with the contexts of itself.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, = AC_OK if the action was created correctly = AC_NORECORD if no memory to undo/redo but go ahead anyway without undo = AC_FAIL stop the operation

Errors: -

See also:
-

Reimplemented from Action.

Definition at line 1608 of file moldpers.cpp.

01609 {
01610     // try to create a redo record
01611     RecordPerspectiveAction* EnvAction;
01612     ActionCode Act;
01613     Act = RecordPerspectiveAction::Init(pOperation, pOppositeActLst, pCPerspective, (Action**)(&EnvAction));
01614     
01615     // for undo, simply copy 'this' record over the shape.
01616     // No No , we dont need to check for AC_OK, hands off! we've done all that in the
01617     // init function which tries to record the current state of the Perspective
01618     if (pCPerspective)
01619         pCPerspective->BuildShape(RecordArray,NULL);
01620 
01621     return Act;
01622 }

ActionCode RecordPerspectiveAction::Init Operation pOp,
ActionList pActionList,
MouldPerspective pPerspective,
Action **  NewAction
[static]
 

This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NORECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Parameters:
pOp = a pointer to the operation to which this action belongs [INPUTS] pActionList = is the action list to which this action should be added
NewAction = a pointer to a pointer to an action, allowing the function to [OUTPUTS] return a pointer to the created action.
Returns:
ActionCode, = AC_OK if the action was created correctly = AC_NORECORD if no memory to undo/redo but go ahead anyway without undo = AC_FAIL stop the operation

Errors: -

See also:
Action::Init()

Definition at line 1564 of file moldpers.cpp.

01568 {
01569     ActionCode Ac = AC_FAIL;
01570     if (pPerspective!=NULL)
01571     {
01572         UINT32 ActSize = sizeof(RecordPerspectiveAction);
01573         Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(RecordPerspectiveAction), NewAction);
01574         if (Ac==AC_OK)
01575         {
01576             RecordPerspectiveAction* pAct = ((RecordPerspectiveAction*)*NewAction);
01577             if (pAct)
01578             {
01579                 pAct->pCPerspective = pPerspective;
01580                 pPerspective->Perspective.CopyShape(pAct->RecordArray);
01581             }
01582         }
01583     }
01584     return Ac;
01585 }


Member Data Documentation

MouldPerspective* RecordPerspectiveAction::pCPerspective [private]
 

Definition at line 305 of file moldpers.h.

POINT RecordPerspectiveAction::RecordArray[4] [private]
 

Definition at line 306 of file moldpers.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