OpRectangularEnvelope Class Reference

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

#include <moldtool.h>

Inheritance diagram for OpRectangularEnvelope:

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

Public Member Functions

 OpRectangularEnvelope ()
 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 585 of file moldtool.h.


Constructor & Destructor Documentation

OpRectangularEnvelope::OpRectangularEnvelope  ) 
 

Constructor for Detach mould operation.

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

Definition at line 3074 of file moldtool.cpp.

03075 {
03076     // Dummy constructor
03077 }


Member Function Documentation

void OpRectangularEnvelope::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 3183 of file moldtool.cpp.

03184 {
03185     BeginSlowJob();
03186 
03187     // Assume faied until proven otherwise.
03188     BOOL Failed=TRUE;
03189 
03190     // Create a manifold to use 
03191     Path* pDefShape = new Path;
03192     if (pDefShape!=NULL)
03193     {
03194         if (pDefShape->Initialise(12,12))
03195         {
03196             if (EnvelopeShapes::Rectangular(pDefShape))
03197             {
03198                 Failed=!CreateNewMould(pDefShape, MOULDSPACE_ENVELOPE, TRUE, FALSE);
03199             }
03200         }
03201         // remove the shape once used
03202         delete pDefShape;
03203     }
03204 
03205     if (Failed)
03206         FailAndExecute();
03207 
03208     End();
03209 }

void OpRectangularEnvelope::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 3160 of file moldtool.cpp.

03161 {
03162     *OpName = String_256(_R(IDS_UNDO_RECTANGULARENVELOPE));
03163 }

OpState OpRectangularEnvelope::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 3124 of file moldtool.cpp.

03125 {
03126     OpState OpSt;
03127     String_256 DisableReason; 
03128     OpSt.Greyed = TRUE;
03129     
03130     ObjChangeFlags cFlags;
03131     cFlags.MultiReplaceNode = TRUE;
03132     ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL);
03133     
03134     SelRange* pSelRange = GetApplication()->FindSelection();
03135     Node* pNode = pSelRange->FindFirst();
03136 
03137     while (pNode != NULL && OpSt.Greyed)
03138     {
03139         OpSt.Greyed = !(pNode->AllowOp(&ObjChange,FALSE));
03140         pNode = pSelRange->FindNext(pNode);
03141     }
03142 
03143     return (OpSt);   
03144 }

BOOL OpRectangularEnvelope::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 3098 of file moldtool.cpp.

03099 {
03100     return (RegisterOpDescriptor(0,                                     // tool ID
03101                                 _R(IDS_RECTANGULARENVELOPE),                // string resource ID
03102                                 CC_RUNTIME_CLASS(OpRectangularEnvelope),// runtime class for Op
03103                                 OPTOKEN_RECTANGULARENVELOPE,            // Ptr to token string
03104                                 OpRectangularEnvelope::GetState,        // GetState function
03105                                 0,                                      // help ID
03106                                 _R(IDBBL_RECTANGULARENVELOPE)
03107                                 )); 
03108 }               


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