#include <shapeops.h>
Inheritance diagram for OpShapeToggleCurvature:
Public Member Functions | |
OpShapeToggleCurvature () | |
Constructs an OpShapeToggleCurvature object. | |
Static Public Member Functions | |
static BOOL | Init () |
Initialise the toggle curvature operation by registering it. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
Find the state of the OpShapeToggleCurvature operation. | |
Protected Member Functions | |
BOOL | DoAction (NodeRegularShape *pShape) |
Toggles the curvature state of a shape. |
Definition at line 571 of file shapeops.h.
|
Constructs an OpShapeToggleCurvature object.
Definition at line 3785 of file shapeops.cpp. 03785 : OpShapeToggleBase() 03786 { 03787 }
|
|
Toggles the curvature state of a shape.
Reimplemented from OpShapeToggleBase. Definition at line 3899 of file shapeops.cpp. 03900 { 03901 BOOL Success = TRUE; 03902 03903 // Do the primary curvature 03904 if (Success) 03905 Success = (ChangeShapeDataAction::DoToggle(this, &UndoActions, pShape, 03906 ChangeShapeDataAction::CHANGE_PRIMARYCURVATURE, pShape->IsPrimaryCurvature() ? 1.0 : 0.0) != AC_FAIL); 03907 if (Success) 03908 pShape->SetPrimaryCurvature(!pShape->IsPrimaryCurvature()); 03909 03910 // Do the stellation curvature 03911 if (Success) 03912 Success = (ChangeShapeDataAction::DoToggle(this, &UndoActions, pShape, 03913 ChangeShapeDataAction::CHANGE_STELLATIONCURVATURE, pShape->IsStellationCurvature() ? 1.0 : 0.0) != AC_FAIL); 03914 if (Success) 03915 pShape->SetStellationCurvature(!pShape->IsStellationCurvature()); 03916 03917 return Success; 03918 }
|
|
Find the state of the OpShapeToggleCurvature operation.
Definition at line 3807 of file shapeops.cpp. 03808 { 03809 OpState OpSt; 03810 OpSt.Greyed = TRUE; 03811 BOOL FoundCurved = FALSE; 03812 BOOL FoundNotCurved = FALSE; 03813 BOOL AllEllipses = TRUE; 03814 ObjChangeFlags cFlags; 03815 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL); 03816 03817 SelRange* pSelection = GetApplication()->FindSelection(); 03818 Node* pNode = pSelection->FindFirst(); 03819 03820 while (pNode != NULL) 03821 { 03822 if (IS_A(pNode, NodeRegularShape)) 03823 { 03824 NodeRegularShape* pShape = (NodeRegularShape*)pNode; 03825 03826 AllEllipses = AllEllipses && pShape->IsCircular(); 03827 03828 // Convert this shape if it's parents allow 03829 if (pShape->AllowOp(&ObjChange)) 03830 { 03831 if (pShape->IsPrimaryCurvature() && pShape->IsStellationCurvature()) 03832 FoundCurved = TRUE; 03833 else 03834 FoundNotCurved = TRUE; 03835 } 03836 } 03837 03838 // Get the next selected thing 03839 pNode = pSelection->FindNext(pNode); 03840 } 03841 03842 if (AllEllipses) 03843 UIDescription->Load(_R(IDS_REGSHAPE_ALLELLIPSES)); 03844 else 03845 { 03846 if (FoundCurved || FoundNotCurved) 03847 OpSt.Greyed = FALSE; 03848 if (FoundCurved && !FoundNotCurved) 03849 UIDescription->Load(_R(IDS_OPSHAPETOGGLE_CURVE_REM)); 03850 if (!FoundCurved && FoundNotCurved) 03851 UIDescription->Load(_R(IDS_OPSHAPETOGGLE_CURVE_ADD)); 03852 } 03853 03854 return(OpSt); 03855 }
|
|
Initialise the toggle curvature operation by registering it.
Reimplemented from SimpleCCObject. Definition at line 3874 of file shapeops.cpp. 03875 { 03876 return(RegisterOpDescriptor(0, 03877 _R(IDS_OPSHAPETOGGLE_CURVE), 03878 CC_RUNTIME_CLASS(OpShapeToggleCurvature), 03879 OPTOKEN_TOGGLECURVATURE, 03880 OpShapeToggleCurvature::GetState)); 03881 }
|