OpRetroFit Class Reference

This operation handles the updating of a freehand path after it has been retro fitted. More...

#include <opretro.h>

Inheritance diagram for OpRetroFit:

SelOperation UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpRetroFit ()
BOOL BuildUndo (NodePath *, NodePath *)
 Builds the necessary Undo information for the refitting of a freehand path.
void Do (OpDescriptor *pOp)
 Builds all the undo info etc for retro fitting a freehand path.

Static Public Member Functions

static BOOL Init ()
 Adds the operation to the list of all known operations.
static OpState GetState (String_256 *Description, OpDescriptor *)
 Find out the state of the operation at the specific time.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpRetroFit)

Detailed Description

This operation handles the updating of a freehand path after it has been retro fitted.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/94

Definition at line 124 of file opretro.h.


Constructor & Destructor Documentation

OpRetroFit::OpRetroFit  )  [inline]
 

Definition at line 130 of file opretro.h.

00130 {}


Member Function Documentation

BOOL OpRetroFit::BuildUndo NodePath pPreviousNode,
NodePath pNewNode
 

Builds the necessary Undo information for the refitting of a freehand path.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/5/94
Parameters:
pPreviousNode - The original path. We will place our new path immediatly [INPUTS] after this node in the tree pNewNode - The new refitted path.
Returns:
TRUE if it worked, FALSE if it did not

Definition at line 188 of file opretro.cpp.

00189 {
00190     // A few quick error checks
00191     ENSURE(pPreviousNode!=NULL, "Previous Node was NULL in RetroFit::BuildUndo()");
00192     ENSURE(pPreviousNode->IsKindOf(CC_RUNTIME_CLASS(NodePath)), "Previous Node not a path");
00193 
00194     ENSURE(pNewNode!=NULL, "New Node was NULL in RetroFit::BuildUndo()");
00195     ENSURE(pNewNode->IsKindOf(CC_RUNTIME_CLASS(NodePath)), "New Node not a path");
00196 
00197     // Falg to see if it has worked
00198     BOOL IsOperationOk = TRUE;
00199 
00200     // Start the undo of the selected item
00201     IsOperationOk = DoStartSelOp(FALSE);
00202 
00203     // Will the node allow this op to take place?
00204     ObjChangeFlags cFlags;
00205     cFlags.ReplaceNode = TRUE;
00206     ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,pPreviousNode,this);
00207     if (IsOperationOk)
00208         IsOperationOk = pPreviousNode->AllowOp(&ObjChange);
00209     
00210     // insert our new object
00211     if (IsOperationOk)
00212     {
00213         // Insert the new node into the tree
00214         IsOperationOk = DoInsertNewNode(pNewNode, pPreviousNode, NEXT, TRUE);
00215     }
00216 
00217     // Invalidate the region covered by the old node
00218     if (IsOperationOk)
00219         IsOperationOk = DoInvalidateNodeRegion(pPreviousNode, TRUE);
00220 
00221     // Make sure everything has worked
00222     if (IsOperationOk)
00223     {
00224         // Remove the old node
00225         IsOperationOk = DoHideNode(pPreviousNode, TRUE);
00226     }
00227 
00228     ObjChange.Define(OBJCHANGE_FINISHED,cFlags,pPreviousNode,this);
00229     IsOperationOk = UpdateChangedNodes(&ObjChange);
00230 
00231     // If something went wrong then fail
00232     if (!IsOperationOk)
00233         FailAndExecute();
00234     
00235     // End the operation properly
00236     End();
00237 
00238     // return a value back to the caller
00239     return IsOperationOk;
00240 }

OpRetroFit::CC_DECLARE_DYNCREATE OpRetroFit   )  [private]
 

void OpRetroFit::Do OpDescriptor pOpDesc  )  [virtual]
 

Builds all the undo info etc for retro fitting a freehand path.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/94
Parameters:
pOpDesc - An OpDescriptor thing [INPUTS]

Reimplemented from Operation.

Definition at line 257 of file opretro.cpp.

00258 {
00259 //  if (IsUserName("Rik")) TRACE( _T("Write code here.."));
00260 }

OpState OpRetroFit::GetState String_256 Description,
OpDescriptor
[static]
 

Find out the state of the operation at the specific time.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/94
Parameters:
Description - GetState fills this string with an approriate description [OUTPUTS] of the current state of the push tool
Returns:
The state of the operation, so that menu items (ticks and greying can be done properly

Definition at line 162 of file opretro.cpp.

00163 {
00164     OpState Blobby;
00165     
00166     return Blobby;
00167 }

BOOL OpRetroFit::Init void   )  [static]
 

Adds the operation to the list of all known operations.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/94
Returns:
TRUE if all went OK, False otherwise

Reimplemented from SimpleCCObject.

Definition at line 134 of file opretro.cpp.

00135 {
00136     return (RegisterOpDescriptor(
00137                                 0, 
00138                                 _R(IDS_RETROFITOP),
00139                                 CC_RUNTIME_CLASS(OpRetroFit), 
00140                                 OPTOKEN_RETROFIT,
00141                                 OpRetroFit::GetState,
00142                                 0,  /* help ID */
00143                                 0,
00144                                 0   /* bitmap ID */));
00145 }


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