#include <opcntr.h>
Inheritance diagram for OpChangeContourToOuter:
Public Member Functions | |
OpChangeContourToOuter () | |
Constructor. | |
~OpChangeContourToOuter () | |
Destructor. | |
virtual void | Do (OpDescriptor *pOpDesc) |
Changes all contours in the selection to outer contours. | |
virtual void | DoWithParam (OpDescriptor *pOp, OpParam *pParam) |
Applys a Bevel to the selected node after a mouse click. | |
Static Public Member Functions | |
static BOOL | Declare () |
Adds the operation to the list of all known operations. | |
static OpState | GetState (String_256 *Description, OpDescriptor *) |
Find out the state of the new regular shape at the specific time. |
Definition at line 436 of file opcntr.h.
|
Constructor.
Definition at line 2206 of file opcntr.cpp.
|
|
Destructor.
Definition at line 2220 of file opcntr.cpp.
|
|
Adds the operation to the list of all known operations.
Definition at line 2380 of file opcntr.cpp. 02381 { 02382 return (RegisterOpDescriptor( 02383 0, 02384 _R(IDS_OP_CONTOUROUTER), 02385 CC_RUNTIME_CLASS(OpChangeContourToOuter), 02386 OPTOKEN_CHANGECONTOUR_OUTER, 02387 OpChangeContourToOuter::GetState, 02388 0, 02389 _R(IDBBL_CONTOUROUTER) 02390 )); 02391 02392 }
|
|
Changes all contours in the selection to outer contours.
Reimplemented from Operation. Definition at line 2237 of file opcntr.cpp. 02238 { 02239 TRACEUSER( "DavidM", _T("OpChangeContourToOuter - Do !\n")); 02240 BeginSlowJob(-1, TRUE); 02241 DoStartSelOp(TRUE, TRUE); 02242 02243 // get all the contour nodes in the selection 02244 List ContourList; 02245 02246 BevelTools::BuildListOfSelectedNodes(&ContourList, CC_RUNTIME_CLASS(NodeContourController), 02247 TRUE); 02248 02249 NodeListItem * pItem = (NodeListItem *)ContourList.GetHead(); 02250 02251 ChangeContourToOuterAction * pAction = NULL; 02252 02253 NodeContourController * pControl = NULL; 02254 02255 BOOL ok = TRUE; 02256 02257 // set up the object changed param 02258 ObjChangeFlags flgs(FALSE, FALSE, FALSE, TRUE); 02259 flgs.RegenerateNode = TRUE; 02260 ObjChangeParam MyObjChangeParam(OBJCHANGE_FINISHED, flgs, NULL, this, OBJCHANGE_CALLEDBYOP); 02261 02262 Node * pParent = NULL; 02263 02264 Document * pDoc = Document::GetCurrent(); 02265 02266 // run through the list, changing all widths to be positive 02267 while (pItem && ok) 02268 { 02269 if (pItem->pNode) 02270 { 02271 pControl = (NodeContourController *)pItem->pNode; 02272 02273 if (pControl->GetWidth() > 0) 02274 { 02275 // redraw the node 02276 if (pDoc) 02277 pDoc->ForceRedraw(pControl->FindParentSpread(), pControl->GetBoundingRect(), FALSE, pControl); 02278 02279 // invalidate the parents 02280 pParent = pControl->FindParent(); 02281 pControl->ReleaseCached(); // Associated with DoInvalidateRegion, does parents itself 02282 02283 while (pParent) 02284 { 02285 if (pParent->IsAnObject()) 02286 { 02287 DoInvalidateRegion(pParent->FindParentSpread(), ((NodeRenderableInk *)pParent)->GetBoundingRect()); 02288 } 02289 02290 pParent = pParent->FindParent(); 02291 } 02292 02293 if (ChangeContourToOuterAction::Init(this, this->GetUndoActionList(), 02294 pControl, &pAction) != AC_OK) 02295 { 02296 ok = FALSE; 02297 } 02298 02299 // set the width to negative 02300 pControl->SetWidth(-pControl->GetWidth()); 02301 02302 // move the node 02303 if (ok) 02304 { 02305 Node * pContourNode = pControl->FindFirstChild(CC_RUNTIME_CLASS(NodeContour)); 02306 02307 if (pContourNode) 02308 { 02309 Node * pInsertNode = pControl->FindFirstChild(CC_RUNTIME_CLASS(NodeRenderableInk)); 02310 02311 if (pInsertNode != pContourNode) 02312 ok = DoMoveNode(pContourNode, pInsertNode, PREV); 02313 } 02314 } 02315 02316 02317 // regenerate the node 02318 pControl->RegenerateNode(NULL, FALSE); 02319 02320 // Ilan 7/5/00 02321 // Inform geom linked attrs of the change. Nb outside the normal AllowOp mechanism 02322 NodeAttribute* pNA = pControl->FindFirstGeometryLinkedAttr(); 02323 while(pNA) 02324 { 02325 pNA->LinkedNodeGeometryHasChanged(this); 02326 pNA = pNA->FindNextGeometryLinkedAttr(); 02327 } 02328 02329 // redraw the node 02330 if (pDoc) 02331 pDoc->ForceRedraw(pControl->FindParentSpread(), pControl->GetBoundingRect(), FALSE, pControl); 02332 } 02333 } 02334 02335 pItem = (NodeListItem *)ContourList.GetNext(pItem); 02336 } 02337 02338 ContourList.DeleteAll(); 02339 02340 if (!ok) 02341 { 02342 FailAndExecute(); 02343 End(); 02344 return; 02345 } 02346 02347 End(); 02348 }
|
|
Applys a Bevel to the selected node after a mouse click.
Reimplemented from Operation. Definition at line 2362 of file opcntr.cpp. 02363 { 02364 // first, begin the operation 02365 BeginSlowJob(-1, TRUE); 02366 02367 End(); 02368 }
|
|
Find out the state of the new regular shape at the specific time.
Definition at line 2407 of file opcntr.cpp. 02408 { 02409 OpState Blobby; 02410 02411 if (Description) 02412 { 02413 Description->Load(_R(IDS_CONTOUROUTEROPNAME)); 02414 } 02415 02416 return Blobby; 02417 }
|