OpMouldLib Class Reference

Provides a library of undoable functions for moulding objects. More...

#include <moldedit.h>

Inheritance diagram for OpMouldLib:

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

Public Member Functions

 OpMouldLib ()
 OpMouldLib() constructor.

Protected Member Functions

BOOL DoRotateMould (NodeMould *pMould)
 Simply rotates the orientation of all objects within the geometry.

Detailed Description

Provides a library of undoable functions for moulding objects.

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

Definition at line 195 of file moldedit.h.


Constructor & Destructor Documentation

OpMouldLib::OpMouldLib  ) 
 

OpMouldLib() constructor.

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

Definition at line 1017 of file moldedit.cpp.

01018 {
01019     // Dummy constructor
01020 }


Member Function Documentation

BOOL OpMouldLib::DoRotateMould NodeMould pMould  )  [protected]
 

Simply rotates the orientation of all objects within the geometry.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/01/95
Parameters:
pMould = pointer to a mould object [INPUTS]
Returns:
TRUE if successfully rotated the geometry around by one path element

Definition at line 1074 of file moldedit.cpp.

01075 {
01076     ERROR2IF(pMould==NULL, FALSE, "DoRotateMould() called with no mould pointer");
01077 
01078     MouldGeometry* pGeometry=pMould->GetGeometry();
01079     NodeMouldPath* pMouldPath=pMould->GetPathShape();
01080     if (!pMouldPath || !pGeometry)
01081         return FALSE;
01082 
01083     // save the bits we need on the undo
01084     if ((pMould->StartSaveContext(this, REC_REBUILD | REC_GEOMCONTEXT | REC_PATHARRAYS)) == CC_FAIL)
01085         return FALSE;
01086 
01087     Path* pEditPath = &(pMouldPath->InkPath);
01088     // rotate the path around
01089     INT32 index=0;
01090     if (!pEditPath->FindNextEndPoint(&index))
01091         return FALSE;
01092     if (!pEditPath->ChangeStartElement(index))
01093         return FALSE;
01094 
01095     // set the geometry using this new mould shape
01096     if (!pGeometry->Define(pEditPath, NULL))
01097         return FALSE;
01098 
01099     // finally generate some new mould shapes.
01100     if (pMould->RemouldAll(this)==CC_FAIL)
01101         return FALSE;
01102 
01103     // Ilan 7/5/00
01104     // Inform geom linked attrs of the change. Nb outside the normal AllowOp mechanism
01105     NodeAttribute* pNA = pMould->FindFirstGeometryLinkedAttr();
01106     while(pNA)
01107     {
01108         pNA->LinkedNodeGeometryHasChanged(this);
01109         pNA = pNA->FindNextGeometryLinkedAttr();
01110     }
01111 
01112     if ((pMould->EndSaveContext(this, REC_REBUILD | REC_GEOMCONTEXT | REC_PATHARRAYS)) == CC_FAIL)
01113         return FALSE;
01114 
01115     return TRUE;
01116 }


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