OpCreateNewMould Class Reference

Creates a new mould object and all its various children to form a valid mould structure. The operation will execute only when there is one or more selected objects to work on. These selected objects will to all intense and purpose dissappear from the tree. They will move from their current positions and move inside the new mould node. More...

#include <moldtool.h>

Inheritance diagram for OpCreateNewMould:

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

Public Member Functions

 OpCreateNewMould ()
 OpCreateNewMould() constructor.
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.
void DoWithParam (OpDescriptor *, OpParam *)
 This operation will create a new mould object, and thus start off quite a complicated chain of events. First off, a mouldgroup node is created and all objects are moved into it as children, along with any inherited attributes. Secondly a mould object is created and initialise with the shape passed to this do function. The mouldgroup node is now added to the mould node as a first child. A moulder object is then created and added as the last child of the mould node. It is not added to the next object of the mouldgroup, as there may be more than one moulder object. The moulder object is then asked to initialise itself. In doing so it will scan the mould group children and ask them to make shapes of themselves. These shapes are stored in a list within the moulder class, (not in the tree). Having constructed the moulder, a mould operation is triggered, whence all current moulder list objects are mangled by the mould shape class functions (held within the mould parent class). These mangled objects are added as children of the moulder object. Having done all this without running out of memory, the mouldgroup object is hidden.

Static Public Member Functions

static BOOL Init ()
 OpDeletePoints initialiser method.
static OpState GetState (String_256 *, OpDescriptor *)
 For finding the OpCreateNewMould state.

Private Member Functions

BOOL AllMouldObjects (List *pNodeList)
 Scans the list of nodes provided. If any objects which are not node moulds are found, false is returned.

Private Attributes

MouldSpace m_space

Detailed Description

Creates a new mould object and all its various children to form a valid mould structure. The operation will execute only when there is one or more selected objects to work on. These selected objects will to all intense and purpose dissappear from the tree. They will move from their current positions and move inside the new mould node.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/94

Definition at line 313 of file moldtool.h.


Constructor & Destructor Documentation

OpCreateNewMould::OpCreateNewMould  ) 
 

OpCreateNewMould() constructor.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/94
See also:
-

Definition at line 1468 of file moldtool.cpp.

01469 {
01470     m_space = MOULDSPACE_UNDEFINED;
01471 }


Member Function Documentation

BOOL OpCreateNewMould::AllMouldObjects List pNodeList  )  [private]
 

Scans the list of nodes provided. If any objects which are not node moulds are found, false is returned.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/03/95
Parameters:
pNodeList = a list of object pointers to objects to mould. [INPUTS]
Returns:
TRUE if the list contains mould objects only, at the top level. FALSE if there are other object types.

Reimplemented from OpMouldLibSel.

void OpCreateNewMould::DoWithParam OpDescriptor pOpDescr,
OpParam pParam
[virtual]
 

This operation will create a new mould object, and thus start off quite a complicated chain of events. First off, a mouldgroup node is created and all objects are moved into it as children, along with any inherited attributes. Secondly a mould object is created and initialise with the shape passed to this do function. The mouldgroup node is now added to the mould node as a first child. A moulder object is then created and added as the last child of the mould node. It is not added to the next object of the mouldgroup, as there may be more than one moulder object. The moulder object is then asked to initialise itself. In doing so it will scan the mould group children and ask them to make shapes of themselves. These shapes are stored in a list within the moulder class, (not in the tree). Having constructed the moulder, a mould operation is triggered, whence all current moulder list objects are mangled by the mould shape class functions (held within the mould parent class). These mangled objects are added as children of the moulder object. Having done all this without running out of memory, the mouldgroup object is hidden.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/94
Parameters:
pOpDescr = pointer to an OpDescriptor (unused) [INPUTS] pOpParam = pointer to an OpParam
- [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 1608 of file moldtool.cpp.

01609 {
01610     ERROR3IF(pParam == NULL, "OpCreateNewMould::DoWithParam - NULL Param passed in");
01611 
01612     BeginSlowJob();
01613 
01614     // Initialise ourselves from the supplied parameters
01615     CreateMouldParam* CreateMould = (CreateMouldParam*)pParam;
01616 
01617     if (!CreateNewMould(CreateMould->ParamShape, 
01618                         CreateMould->ParamSpace,
01619                         CreateMould->FitSelection,
01620                         CreateMould->LockAspect))
01621         FailAndExecute();
01622 
01623     End();
01624 }

void OpCreateNewMould::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:
11/12/94
Parameters:
- [INPUTS]
The undo string for the operation [OUTPUTS]
Returns:

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 1526 of file moldtool.cpp.

01527 {
01528     switch (m_space)
01529     {
01530         case MOULDSPACE_ENVELOPE:
01531             *OpName = String_256(_R(IDS_UNDO_ENVELOPE));
01532             break;
01533         case MOULDSPACE_ENVELOPE2X2:
01534             *OpName = String_256(_R(IDS_UNDO_ENVELOPE));
01535             break;
01536         case MOULDSPACE_PERSPECTIVE:
01537             *OpName = String_256(_R(IDS_UNDO_PERSPECTIVE));
01538             break;
01539         default:
01540             *OpName = String_256(_R(IDS_UNDO_CREATENEWMOULD));
01541             break;
01542     }
01543 }

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

For finding the OpCreateNewMould state.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpCreateNewMould

Definition at line 1559 of file moldtool.cpp.

01560 {
01561     OpState OpSt;
01562     OpSt.Greyed = TRUE;
01563 
01564     // only ungrey if we have a selection
01565     SelRange* pSelRange = GetApplication()->FindSelection();
01566     if (pSelRange && pSelRange->FindFirst() != NULL)
01567         OpSt.Greyed=FALSE;
01568 
01569     return OpSt;   
01570 }

BOOL OpCreateNewMould::Init void   )  [static]
 

OpDeletePoints initialiser method.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/94
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.

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 1494 of file moldtool.cpp.

01495 {
01496     return (RegisterOpDescriptor(0,                                 // tool ID
01497                                 _R(IDS_CREATENEWMOULD),                 // string resource ID
01498                                 CC_RUNTIME_CLASS(OpCreateNewMould), // runtime class for Op
01499                                 OPTOKEN_CREATENEWMOULD,             // Ptr to token string
01500                                 OpCreateNewMould::GetState,         // GetState function
01501                                 0,                                  // help ID
01502                                 _R(IDBBL_CREATENEWMOULD),               // bubble help ID
01503                                 0                                   // resource ID
01504                                 ));
01505 
01506 }               


Member Data Documentation

MouldSpace OpCreateNewMould::m_space [private]
 

Definition at line 329 of file moldtool.h.


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