OpRectangularPerspective Class Reference

Simple operations to handle the creation of default envelope and perspective shapes. More...

#include <moldtool.h>

Inheritance diagram for OpRectangularPerspective:

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

Public Member Functions

 OpRectangularPerspective ()
 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

Simple operations to handle the creation of default envelope and perspective shapes.

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

Definition at line 609 of file moldtool.h.


Constructor & Destructor Documentation

OpRectangularPerspective::OpRectangularPerspective  ) 
 

Constructor for Detach mould operation.

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

Definition at line 3226 of file moldtool.cpp.

03227 {
03228     // Dummy constructor
03229 }


Member Function Documentation

void OpRectangularPerspective::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 3335 of file moldtool.cpp.

03336 {
03337     BeginSlowJob();
03338 
03339     // Assume faied until proven otherwise.
03340     BOOL Failed=TRUE;
03341 
03342     // Create a manifold to use 
03343     Path* pDefShape = new Path;
03344     if (pDefShape!=NULL)
03345     {
03346         if (pDefShape->Initialise(12,12))
03347         {
03348             if (PerspectiveShapes::Rectangular(pDefShape))
03349             {
03350                 Failed=!CreateNewMould(pDefShape, MOULDSPACE_PERSPECTIVE, TRUE, FALSE);
03351             }
03352         }
03353         // remove the shape once used
03354         delete pDefShape;
03355     }
03356 
03357     if (Failed)
03358         FailAndExecute();
03359 
03360     End();
03361 }

void OpRectangularPerspective::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 3312 of file moldtool.cpp.

03313 {
03314     *OpName = String_256(_R(IDS_UNDO_RECTANGULARPERSPECTIVE));
03315 }

OpState OpRectangularPerspective::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 3276 of file moldtool.cpp.

03277 {
03278     OpState OpSt;
03279     String_256 DisableReason; 
03280     OpSt.Greyed = TRUE;
03281     
03282     ObjChangeFlags cFlags;
03283     cFlags.MultiReplaceNode = TRUE;
03284     ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL);
03285     
03286     SelRange* pSelRange = GetApplication()->FindSelection();
03287     Node* pNode = pSelRange->FindFirst();
03288 
03289     while (pNode != NULL && OpSt.Greyed)
03290     {
03291         OpSt.Greyed = !(pNode->AllowOp(&ObjChange,FALSE));
03292         pNode = pSelRange->FindNext(pNode);
03293     }
03294 
03295     return (OpSt);   
03296 }

BOOL OpRectangularPerspective::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 3250 of file moldtool.cpp.

03251 {
03252     return (RegisterOpDescriptor(0,                                         // tool ID
03253                                 _R(IDS_RECTANGULARPERSPECTIVE),                 // string resource ID
03254                                 CC_RUNTIME_CLASS(OpRectangularPerspective), // runtime class for Op
03255                                 OPTOKEN_RECTANGULARPERSPECTIVE,             // Ptr to token string
03256                                 OpRectangularPerspective::GetState,         // GetState function
03257                                 0,                                          // help ID
03258                                 _R(IDBBL_RECTANGULARPERSPECTIVE)
03259                                 )); 
03260 }               


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