#include <shapeops.h>
Inheritance diagram for OpShapeToggleBase:
Public Member Functions | |
OpShapeToggleBase () | |
Constructs an OpShapeToggleBase object. | |
void | Do (OpDescriptor *) |
Runs through all selected Quickshapes, toggling their one of their member states. | |
Protected Member Functions | |
virtual BOOL | DoAction (NodeRegularShape *pShape) |
Definition at line 519 of file shapeops.h.
|
Constructs an OpShapeToggleBase object.
Definition at line 3390 of file shapeops.cpp. 03390 : SelOperation() 03391 { 03392 }
|
|
Runs through all selected Quickshapes, toggling their one of their member states.
Reimplemented from Operation. Definition at line 3411 of file shapeops.cpp. 03412 { 03413 // Start the operation 03414 BOOL Success = DoStartSelOp(FALSE, FALSE, FALSE, FALSE); 03415 03416 // Check with our parent nodes 03417 ObjChangeParam ObjChange(OBJCHANGE_STARTING,ObjChangeFlags(),NULL,this); 03418 03419 // Run through the selected nodes 03420 if (Success) 03421 { 03422 SelRange* pSelection = GetApplication()->FindSelection(); 03423 Node* pNode = pSelection->FindFirst(); 03424 03425 while ((pNode != NULL) && Success) 03426 { 03427 if (IS_A(pNode, NodeRegularShape)) 03428 { 03429 NodeRegularShape* pShape = (NodeRegularShape*)pNode; 03430 03431 // Convert this shape if it's parents allow 03432 if (pShape->AllowOp(&ObjChange)) 03433 { 03434 // Create an action to will cause the shape to recalc its bounds 03435 if (Success) 03436 Success = (RecalcBoundsAction::DoRecalc(this, &UndoActions, pShape) != AC_FAIL); 03437 03438 // Toggle its ellipseness 03439 if (Success) 03440 Success = DoAction(pShape); 03441 03442 // Invalidate the shapes bounding rect as it's changed 03443 if (Success) 03444 { 03445 pShape->InvalidateBoundingRect(); 03446 pShape->InvalidateCache(); 03447 } 03448 03449 // And redraw its final state 03450 if (Success) 03451 Success = (RecordBoundsAction::DoRecord(this, &UndoActions, pShape) != AC_FAIL); 03452 03453 // Tell our parents we have finished 03454 if (Success) 03455 { 03456 ObjChange.Define(OBJCHANGE_FINISHED,ObjChangeFlags(),NULL,this); 03457 Success = UpdateChangedNodes(&ObjChange); 03458 } 03459 } 03460 } 03461 03462 // Get the next selected thing 03463 pNode = pSelection->FindNext(pNode); 03464 } 03465 } 03466 03467 // Clean up after any failure 03468 if (!Success) 03469 { 03470 InformError(); 03471 FailAndExecute(); 03472 } 03473 03474 End(); 03475 }
|
|
Reimplemented in OpShapeToggleElipPoly, OpShapeToggleCurvature, and OpShapeToggleStellation. Definition at line 3479 of file shapeops.cpp.
|