OpShapeToggleStellation Class Reference

This class is an operation that toggles the stellation state of all selected QuickShapes. More...

#include <shapeops.h>

Inheritance diagram for OpShapeToggleStellation:

OpShapeToggleBase SelOperation UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

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.

Detailed Description

This class is an operation that toggles the stellation state of all selected QuickShapes.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/04/95
See also:
OpShapeToggleBase

Definition at line 597 of file shapeops.h.


Constructor & Destructor Documentation

OpShapeToggleStellation::OpShapeToggleStellation  ) 
 

Constructs an OpShapeToggleStellation object.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/04/95

Definition at line 3640 of file shapeops.cpp.

03640                                                 : OpShapeToggleBase()
03641 {
03642 }


Member Function Documentation

BOOL OpShapeToggleStellation::DoAction NodeRegularShape pShape  )  [protected, virtual]
 

Toggles the stellation state of a shape.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/95
Parameters:
pShape - points to the shape to toggle [INPUTS]
- [OUTPUTS]
Returns:
TRUE/FALSE for successful toggle

Errors: -

See also:
-

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 }

OpState OpShapeToggleStellation::GetState String_256 UIDescription,
OpDescriptor
[static]
 

Find the state of the OpShapeToggleStellation operation.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/04/95
Parameters:
UIDescription - the name of the opertaion to display [INPUTS] OpDescriptor - To help update the state
UIDescription - The name of the operation [OUTPUTS]
Returns:
The state of the operation

Errors: -

See also:
-

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 }                                    

BOOL OpShapeToggleStellation::Init void   )  [static]
 

Initialise the toggle stellation operation by registering it.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE/FALSE for successful init

Errors: -

See also:
-

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 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:56 2007 for Camelot by  doxygen 1.4.4