OpRotateMould Class Reference

An operation to rotate a set of objects within a mould manifold. The op simply changes the start point of a mould path object by rotating it around one logical element. The result is simply to spin the orientation of the moulded objects within the mould shape. More...

#include <moldtool.h>

Inheritance diagram for OpRotateMould:

OpMouldLib UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpRotateMould ()
 Constructor for Detach mould operation.
void Do (OpDescriptor *)
 Scan through the selection finding mould objects. Each mould will have its contents remoulded, having has its mould path rotated around logically by one element. The result will be to spin the orientation of the moulded objects around.
void GetOpName (String_256 *OpName)
 The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.

Static Public Member Functions

static BOOL Init ()
 Initialise the rotate mould operation so that it can be accessed from the interface.
static OpState GetState (String_256 *, OpDescriptor *)
 For finding the OpRotateMould state.

Detailed Description

An operation to rotate a set of objects within a mould manifold. The op simply changes the start point of a mould path object by rotating it around one logical element. The result is simply to spin the orientation of the moulded objects within the mould shape.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
See also:
-

Definition at line 521 of file moldtool.h.


Constructor & Destructor Documentation

OpRotateMould::OpRotateMould  ) 
 

Constructor for Detach mould operation.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
See also:
-

Definition at line 2905 of file moldtool.cpp.

02906 {
02907     // Dummy constructor
02908 }


Member Function Documentation

void OpRotateMould::Do OpDescriptor  )  [virtual]
 

Scan through the selection finding mould objects. Each mould will have its contents remoulded, having has its mould path rotated around logically by one element. The result will be to spin the orientation of the moulded objects around.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
pointer to an OpDescriptor (unused) [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: failandexecute will be called if the operation fails in some way, most likely when no memory is available.

Reimplemented from Operation.

Definition at line 3033 of file moldtool.cpp.

03034 {
03035     BeginSlowJob();
03036     SelRange* Selected = GetApplication()->FindSelection();
03037     Node* pNode = Selected->FindFirst();
03038     while (pNode)
03039     {
03040         if (pNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeMould))
03041         {
03042             NodeMould* pMould = (NodeMould*)pNode;
03043 
03044             if (!DoInvalidateNodeRegion(pMould,TRUE))
03045             {
03046                 FailAndExecute(); End(); return;
03047             }
03048 
03049             if (!DoRotateMould(pMould))
03050             {
03051                 FailAndExecute(); End(); return;
03052             }
03053         }
03054         pNode = Selected->FindNext(pNode);
03055     }
03056     End();
03057 }

void OpRotateMould::GetOpName String_256 OpName  )  [virtual]
 

The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
- [INPUTS]
The undo string for the operation [OUTPUTS]
Returns:

Reimplemented from Operation.

Definition at line 3010 of file moldtool.cpp.

03011 {
03012     *OpName = String_256(_R(IDS_UNDO_ROTATEMOULD));
03013 }

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

For finding the OpRotateMould state.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/03/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpRotateMould

Definition at line 2964 of file moldtool.cpp.

02965 {
02966     OpState OpSt;
02967     String_256 DisableReason; 
02968     OpSt.Greyed = FALSE;
02969 
02970     BOOL Sel = FALSE;
02971     if (Document::GetCurrent() != NULL)
02972     {
02973         SelRange* Selected = GetApplication()->FindSelection();
02974         if (Selected)
02975         {
02976             Node* pNode = Selected->FindFirst();
02977             while ((pNode!=NULL) && (!Sel))
02978             {
02979                 // only rotate mould objects if they're not detached.
02980                 if (pNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeMould))
02981                 {
02982                     if ( !((NodeMould*)pNode)->IsDetached() )
02983                         Sel=TRUE;
02984                 }
02985                 pNode = Selected->FindNext(pNode);
02986             }
02987         }
02988     }
02989 
02990     if (!Sel)
02991         OpSt.Greyed = TRUE;
02992 
02993     return (OpSt);   
02994 }

BOOL OpRotateMould::Init void   )  [static]
 

Initialise the rotate mould operation so that it can be accessed from the interface.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/03/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the operation could be successfully initialised FALSE if no more memory could be allocated

Errors: ERROR will be called if there was insufficient memory to allocate the operation.

Reimplemented from SimpleCCObject.

Definition at line 2929 of file moldtool.cpp.

02930 {
02931     return (RegisterOpDescriptor(0,                                 // tool ID
02932                                 _R(IDS_ROTATEMOULD),                    // string resource ID
02933                                 CC_RUNTIME_CLASS(OpRotateMould),    // runtime class for Op
02934                                 OPTOKEN_ROTATEMOULD,                // Ptr to token string
02935                                 OpRotateMould::GetState,            // GetState function
02936                                 0,                                  // help ID
02937                                 _R(IDBBL_ROTATEMOULD),                  // bubble help ID
02938                                 _R(IDD_MOULDTOOLBAR),                   // resource ID
02939                                 _R(IDC_BTN_ROTATEMOULD),                // control ID
02940                                 SYSTEMBAR_EDIT,                     // Group bar ID
02941                                 TRUE,                               // Receive messages
02942                                 FALSE,                              // Smart
02943                                 FALSE,                              // Clean
02944                                 0,                                  // One open Instance ID
02945                                 (GREY_WHEN_NO_CURRENT_DOC | GREY_WHEN_NO_SELECTION)
02946                                 )); 
02947              
02948 }               


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