#include <shapeops.h>
Inheritance diagram for OpShapeToggleStellation:
Public Member Functions | |
OpShapeToggleStellation () | |
Constructs an OpShapeToggleStellation object. | |
Static Public Member Functions | |
static BOOL | Init () |
Initialise the toggle stellation operation by registering it. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
Find the state of the OpShapeToggleStellation operation. | |
Protected Member Functions | |
BOOL | DoAction (NodeRegularShape *pShape) |
Toggles the stellation state of a shape. |
Definition at line 597 of file shapeops.h.
|
Constructs an OpShapeToggleStellation object.
Definition at line 3640 of file shapeops.cpp. 03640 : OpShapeToggleBase() 03641 { 03642 }
|
|
Toggles the stellation state of a shape.
Reimplemented from OpShapeToggleBase. Definition at line 3754 of file shapeops.cpp. 03755 { 03756 BOOL Success = TRUE; 03757 03758 if (Success) 03759 Success = (ChangeShapeDataAction::DoToggle(this, &UndoActions, pShape, 03760 ChangeShapeDataAction::CHANGE_STELLATED, pShape->IsStellated() ? 1.0 : 0.0) != AC_FAIL); 03761 if (Success) 03762 pShape->SetStellated(!pShape->IsStellated()); 03763 03764 return Success; 03765 }
|
|
Find the state of the OpShapeToggleStellation operation.
Definition at line 3662 of file shapeops.cpp. 03663 { 03664 OpState OpSt; 03665 OpSt.Greyed = TRUE; 03666 BOOL FoundStellated = FALSE; 03667 BOOL FoundNotStellated = FALSE; 03668 BOOL AllEllipses = TRUE; 03669 ObjChangeFlags cFlags; 03670 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL); 03671 03672 SelRange* pSelection = GetApplication()->FindSelection(); 03673 Node* pNode = pSelection->FindFirst(); 03674 03675 while (pNode != NULL) 03676 { 03677 if (IS_A(pNode, NodeRegularShape)) 03678 { 03679 NodeRegularShape* pShape = (NodeRegularShape*)pNode; 03680 03681 AllEllipses = AllEllipses && pShape->IsCircular(); 03682 03683 // Convert this shape if it's parents allow 03684 if (pShape->AllowOp(&ObjChange)) 03685 { 03686 if (pShape->IsStellated()) 03687 FoundStellated = TRUE; 03688 else 03689 FoundNotStellated = TRUE; 03690 } 03691 } 03692 03693 // Get the next selected thing 03694 pNode = pSelection->FindNext(pNode); 03695 } 03696 03697 if (AllEllipses) 03698 UIDescription->Load(_R(IDS_REGSHAPE_ALLELLIPSES)); 03699 else 03700 { 03701 if (FoundStellated || FoundNotStellated) 03702 OpSt.Greyed = FALSE; 03703 if (FoundStellated && !FoundNotStellated) 03704 UIDescription->Load(_R(IDS_OPSHAPETOGGLE_STELL_REM)); 03705 if (!FoundStellated && FoundNotStellated) 03706 UIDescription->Load(_R(IDS_OPSHAPETOGGLE_STELL_ADD)); 03707 } 03708 03709 return(OpSt); 03710 }
|
|
Initialise the toggle stellation operation by registering it.
Reimplemented from SimpleCCObject. Definition at line 3729 of file shapeops.cpp. 03730 { 03731 return(RegisterOpDescriptor(0, 03732 _R(IDS_OPSHAPETOGGLE_STELL), 03733 CC_RUNTIME_CLASS(OpShapeToggleStellation), 03734 OPTOKEN_TOGGLESTELLATION, 03735 OpShapeToggleStellation::GetState)); 03736 }
|