#include <opretro.h>
Inheritance diagram for OpRetroFit:
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) |
Definition at line 124 of file opretro.h.
|
Definition at line 130 of file opretro.h.
|
|
Builds the necessary Undo information for the refitting of a freehand path.
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 }
|
|
|
|
Builds all the undo info etc for retro fitting a freehand path.
Reimplemented from Operation. Definition at line 257 of file opretro.cpp.
|
|
Find out the state of the operation at the specific time.
Definition at line 162 of file opretro.cpp. 00163 { 00164 OpState Blobby; 00165 00166 return Blobby; 00167 }
|
|
Adds the operation to the list of all known operations.
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 }
|