NodeMould Class Reference

This class defines the structure of a mould node object. This object is the parent of a MouldGroup node and a Moulder node. Objects being moulded are placed inside MouldGroup and all resulting moulded objects are placed inside the Moulder node. More...

#include <nodemold.h>

Inheritance diagram for NodeMould:

NodeGroup NodeCompound NodeRenderableInk NodeRenderableBounded NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 NodeMould ()
 NodeMould (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.
 ~NodeMould ()
 This destructor calls the parent class destructor and then checks whether it is necessary to delete the mould geometry class. If so the shape geometry is deleted.
void InitialiseVars ()
 Common place to set up the classes private variables.
virtual void PreExportRender (RenderRegion *pRender)
 Called before this node or any of its children have been rendered to the export region. This outputs the "start mould" command. Supports ArtWorks EPS and Camelot EPS.
virtual BOOL ExportRender (RenderRegion *pRender)
 Called after this node and all of its children have been rendered to the export region. This outputs the "end mould" command. Supports ArtWorks EPS and Camelot EPS.
virtual BOOL PostImport ()
 This function is called after a document is imported. Nodes should override this function to do any post-import processing.
virtual void RenderObjectBlobs (RenderRegion *pRender)
 This renders all the blobs associated with this mould node This node doesn't do any rendering itself. All it does is ask the shape object to render itself.
virtual void RenderTinyBlobs (RenderRegion *pRender)
 Draws the paths Tiny blob into the render region supplied.
virtual DocRect GetBlobBoundingRect ()
 This calculates the bounding box of the mould and adds in the influence of the selection blobs. It does not consider if the blobs are visible or not, it just gives the bounding box that they would occupy if they were visible Note, the mould blob bounds are simply made up of the nodemouldpath bounds and thats yer lot.
virtual void Transform (TransformBase &Trans)
 Transforms the mould object and all its children.
virtual String Describe (BOOL Plural, BOOL Verbose)
 To return a description of the Mould object in either the singular or the plural. This method is called by the DescribeRange method.
virtual NodeSimpleCopy ()
 This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual BOOL IsANodeMould () const
 Virtual function to determine whether this node is a NodeMould.
virtual BOOL OnClick (DocCoord, ClickType, ClickModifiers, Spread *)
 Allows the Node to respond to clicks by selecting its blobs or starting drags etc. Here we check for clicks over a moulds shape. If a blob has been clicked on we start a new drag operation to alter the shape of the mould.
BOOL OnMouseMove (DocCoord, Spread *, ClickModifiers, INT32 *, INT32 *)
 A very unusual function to find in a node. This must exist so that the mould tool can ask the mould object what cursor to show as the mouse moves around. The function is called for each selected mould object when the mould tool is current. The nub of the problem is that a mould object can basically be made up of virtually anything. We actually need to ask the mould shape handler inside the mould object what type of cursor it wants to show and what sort of resouced message it would like to display. This cannot be determined from outside the object.
virtual ChangeCode OnChildChange (ObjChangeParam *pParam)
 An object has or is currently being edited inside our mould so we need to perform actions related to this change. The parameter block passed to us will define what to do (if we recognise it). Otherwise we will simply perform the default action of remoulding ourselves on receiving a HasChanged reason.
virtual NodeHasEditableChild (CCRuntimeClass *ChildClass, Node *pPrevEditable)
 This function returns our edit node (the nodemouldpath) which forms part of the mould objects editable surface.
virtual BOOL OnNodePopUp (Spread *pSpread, DocCoord PointerPos, ContextMenu *pMenu)
 This provides descriptions for the mould records. Allows the Mould object to respond to pop up menu clicks on itself.
virtual BOOL CanBecomeA (BecomeA *pBecomeA)
 This function is used by the convert to shapes operation. It determines if the node or any of its children can convert themselves into an InkClass object.
virtual BOOL DoBecomeA (BecomeA *pBecomeA)
 Transforms the object into another type of object. This converts all its children, and replaces itself in the tree with a NodeGroup.
virtual BOOL AllowSelectInside () const
void GetDebugDetails (StringBase *Str)
 Displays debugging info of the tree For obtaining debug information about the Node.
void PreExportCAMEPS (RenderRegion *pRegion)
BOOL PostExportCAMEPS (RenderRegion *pRegion)
void PreExportAWEPS (RenderRegion *pRegion)
BOOL PostExportAWEPS (RenderRegion *pRegion)
void ToggleDetachFlag ()
 Switch the logical value of the detached mould flag inside this mould object.
BOOL IsDetached () const
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes out a records associated with this node.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL IsTypeExtendible () const
virtual DocRect ValidateExtend (const ExtendParams &ExtParams)
 NodeMould uses Node's base-class implementation, as we don't want to inherit NodeGroup's extend behaviour - see Node::ValidateExtend() for details. See also: Node::ValidateExtend().
virtual void Extend (const ExtendParams &ExtParams)
 NodeMould uses Node's base-class implementation, as we don't want to inherit NodeGroup's extend behaviour - see Node::Extend() for details. See also: Node::Extend().
virtual DocRect GetExtendTargetBounds (const ExtendParams &ExtParams)
 NodeMould uses NodeRenderableBounded's base-class implementation, as we don't want to inherit NodeGroup's extend behaviour - see base class for details. See also: NodeRenderableBounded::Extend().
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
MouldSpace DescribeGeometry ()
 Find out what type of geometry is defined for this mould object.
MouldGeometryGetGeometry () const
NodeMouldPathGetPathShape ()
 A useful function to find the first node mould shape object within a NodeMould object. As this is used quite a lot its been 'function'alised.
PathGetPath ()
 A useful function to find the actual path used for moulding As this is used quite a lot its been 'function' alised.
DocRect GetRenderBounds ()
 Return the bounding rect of the mould. This rectangle includes only those items in the mould which are visible and hence will be invalidated by the OS. Items such as the NodeMouldGroup (which are of course invisible) do not get involved in the renderbounds.
DocRect GetChildrensBounds ()
void DisableBlobs ()
void EnableBlobs ()
BOOL CreateGeometry (MouldSpace mSpace)
 Changes the mould space used by this mould to that described by mSpace. Currently the defined spaces are MOULDSPACE_ENVELOPE MOULDSPACE_PERSPECTIVE.
NodeMoulderCreateNewMoulder (UndoableOperation *)
 Creates a NodeMoulder object and returns a pointer to it.
NodeMouldPathCreateNewMouldShape (Path *pPath, DocRect *const pDestin, UndoableOperation *pOp)
 Creates a node mould path object using the path pointer given and the destination rectangle described. The objects pointer is returned.
NodeMouldGroupCreateNewMouldGroup (UndoableOperation *pOp)
 Creates a MouldGroup object and returns a pointer to it.
BOOL CreateAllMoulderObjects (UndoableOperation *pOp)
 Scan through the children of a mould object, getting all NodeMoulders to regenerate their moulded objects.
NodeMoulderAddNewMoulder (Node *, AttachNodeDirection, UndoableOperation *)
 Creates a NodeMoulder object and sticks it in the tree at the specified position.
NodeMouldPathAddNewMouldShape (Path *pPath, DocRect *const pDestin, UndoableOperation *pOp)
 Creates a node mould path object using the path pointer given and the destination rectangle described. The object is inserted as the first child of this node mould object and its pointer is returned.
NodeMouldGroupAddNewMouldGroup (UndoableOperation *pOp)
 Creates a MouldGroup object inside the MouldParent and moves all the objects specified by NodeList into the group. Only object which can become either a path or a nodebitmap are actually moved.
BOOL FillMouldGroup (NodeMouldGroup *, List *, UndoableOperation *)
 Moves all the objects specified by NodeList into the mould group. Only objects which can become either a path or a nodebitmap are actually moved.
NodeMoulderFindFirstMoulder (BOOL errorcheck=TRUE)
 A useful function to find the first node moulder object within a NodeMould object. As this is used quite a lot its been 'function'alised.
NodeMoulderFindNextMoulder (NodeMoulder *pNodeMoulder)
 A useful function to find the next node moulder object within a NodeMould object.
NodeMouldGroupFindMouldGroup (BOOL errorcheck=TRUE)
 A useful function to find the mould group node within a NodeMould object. As this is used quite a lot its been 'function'alised.
ChangeCode RemouldAll (UndoableOperation *pUndoOp)
 Creates a new set of moulded objects, now the mould shape has changed.
ChangeCode StartSaveContext (UndoableOperation *pUndoOp, INT32)
 Tries to save the current state of the mould shape on the undo. If you want to edit the mould in any way you should use this function to record various parts of the mould before going ahead and changing any data. The corresponding EndSaveContext should be called after you have altered any data.
ChangeCode EndSaveContext (UndoableOperation *pUndoOp, INT32)
 Tries to save the current state of the mould shape on the undo.
BOOL CreateAttrSetFromChildren (AttrTypeSet &AttSet)
 Builds a set of AttrTypeSet set of attributes from the children of a node.
BOOL SetGeometry (MouldGeometry *)
 Not to be used.
INT32 CountMoulders ()
 Count the number of moulder objects which have been created within this mould. This does not include hidden moulder objects of course.
virtual BOOL IsValidEffectAttr (NodeAttribute *pAttr) const
 Get width of pixels for use in capturing this group as a tight group bitmapDetermine whether this type of attribute can be an effect attribute On this node at this time.Determine whether this attribute instance can be an effect attribute On this node at this time.
virtual BOOL GroupCanTransformCached (TransformBase &Trans) const

Static Public Member Functions

static void RemovePerspectiveFills (Node *pParentNode, UndoableOperation *pUndoOp)
 This function scans the children of a given parent for perspectivised bitmap fills. It replaces these attributes with standard bitmap fill atts in order to avoid perspective bitmap fills from escaping during a make shapes.

Private Member Functions

 CC_DECLARE_DYNAMIC (NodeMould)
void RedrawMould ()
 Forces a redraw over the mould object.
void CopyNodeContents (NodeMould *pCopyOfNode)
 Copies the data from this node to pCopyOfNode by first calling the base class to get it to copy its stuff, and then copying its own stuff Scope: protected.
ChangeCode HandleMouldShapeChange (ObjChangePathEdit *pParam)
 The user is about to edit, in the action of editing, or has edited, our mould shape. We as a parent need to sort out whether they are allowed to continue. If so we need to perform various actions dependent on what stage the change is in. AboutToEdit: we need to decide whether there is a good reason to prevent the edit from taking place Editing: we need to eor our edit blobs on when necessary HasEdited: we need to perform a remould of all children.
void IncludeChildrensBoundingRects (DocRect &BoundingRect)
 The childrens Blob bounding rects are added to the BoundingRect.
BOOL OverMouldEndPoint (DocCoord coord, Spread *pSpread)
 This routine checks for the mouse being over end points of our mould path.
ChangeCode RecordChangeCodes (UndoableOperation *pOp)
 Record the CRC codes held within the mould object.
ChangeCode ConvertCode (ActionCode Act)
 Convert a action code to a change code.

Private Attributes

String_32 MouldName
MouldGeometrypMouldGeometry
BOOL DetachedGeometry
INT32 OnCC_CRC
INT32 OnCC_Width
INT32 OnCC_Height
BOOL RenderBlobs

Friends

class RecordChangeCodesAction

Detailed Description

This class defines the structure of a mould node object. This object is the parent of a MouldGroup node and a Moulder node. Objects being moulded are placed inside MouldGroup and all resulting moulded objects are placed inside the Moulder node.

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

Definition at line 161 of file nodemold.h.


Constructor & Destructor Documentation

NodeMould::NodeMould  ) 
 

NodeMould::NodeMould Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
 

This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
ContextNode,: Pointer to a node which this node is to be attached to. [INPUTS]
Direction:

Specifies the direction in which this node is to be attached to the ContextNode. The values this variable can take are as follows:

PREV : Attach node as a previous sibling of the context node NEXT : Attach node as a next sibling of the context node FIRSTCHILD: Attach node as the first child of the context node LASTCHILD : Attach node as a last child of the context node

The remaining inputs specify the status of the node:

Locked: Is node locked ? Mangled: Is node mangled ? Marked: Is node marked ? Selected: Is node selected ?

Parameters:
- [OUTPUTS]
Returns:
-

Errors: An assertion error will occur if ContextNode is NULL

Definition at line 229 of file nodemold.cpp.

00235                 :NodeGroup(ContextNode, Direction, Locked, Mangled, Marked, 
00236                 Selected) 
00237 { 
00238     NodeMould::InitialiseVars();
00239 } 

NodeMould::~NodeMould  ) 
 

This destructor calls the parent class destructor and then checks whether it is necessary to delete the mould geometry class. If so the shape geometry is deleted.

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

Definition at line 253 of file nodemold.cpp.

00254 {
00255     if (pMouldGeometry != NULL)
00256     {
00257         delete pMouldGeometry;
00258         pMouldGeometry = NULL;
00259     }
00260 }


Member Function Documentation

NodeMoulder * NodeMould::AddNewMoulder Node pContextNode,
AttachNodeDirection  Direction,
UndoableOperation pOp
 

Creates a NodeMoulder object and sticks it in the tree at the specified position.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/94
Parameters:
pContextNode = The node to which NewNode is to be attached [INPUTS] Direction = The direction the new node should be attached to the context node. pOp = A pointer to an active operation (can be null)
Returns:
a pointer to the moulder object (not in the tree). NULL if failed to create this moulder.
See also:
-

Definition at line 1616 of file nodemold.cpp.

01619 {
01620     BOOL ok;
01621 
01622     // create a new moulder object
01623     NodeMoulder* pMoulder = CreateNewMoulder(pOp);
01624     if (pMoulder==NULL)
01625         return NULL;
01626 
01627     if (pOp!=NULL)
01628     {
01629         // now insert it in the tree in an undoable way
01630         CALL_WITH_FAIL(pOp->DoInsertNewNode(pMoulder, pContextNode, Direction, FALSE, FALSE, FALSE, FALSE), pOp, ok);   
01631     }
01632     else
01633     {
01634         // all right then, insert it in a none undoable way
01635         pMoulder->AttachNode(pContextNode, Direction); 
01636         pMoulder->SetSelected(FALSE); 
01637         ok = TRUE;
01638     }
01639 
01640     // if failed get rid of what we have
01641     if (!ok)
01642     {
01643         delete pMoulder;
01644         return NULL;
01645     }
01646 
01647     return pMoulder;
01648 }

NodeMouldGroup * NodeMould::AddNewMouldGroup UndoableOperation pOp  ) 
 

Creates a MouldGroup object inside the MouldParent and moves all the objects specified by NodeList into the group. Only object which can become either a path or a nodebitmap are actually moved.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/94
Parameters:
pOp = A pointer to an active operation (can be null) [INPUTS]
Returns:
a pointer to the created mould group (inserted into the tree) NULL if unable to create the node
See also:
-

Definition at line 1836 of file nodemold.cpp.

01837 {
01838     BOOL ok;
01839 
01840     // Create a mould group object
01841     NodeMouldGroup* pMouldGroup = CreateNewMouldGroup(pOp);
01842     if (pMouldGroup==NULL)
01843         return NULL;
01844 
01845     if (pOp!=NULL)
01846     {
01847         // Now stick the mould group inside the mould parent, but dont alter the selection
01848         CALL_WITH_FAIL(pOp->DoInsertNewNode(pMouldGroup, this, LASTCHILD, FALSE, FALSE, FALSE, FALSE), pOp, ok);    
01849     }
01850     else
01851     {
01852         // all right then, insert it in a none undoable way
01853         pMouldGroup->AttachNode(this, LASTCHILD); 
01854         pMouldGroup->SetSelected(FALSE); 
01855         ok = TRUE;
01856     }
01857 
01858     // if failed get rid of what we have
01859     if (!ok)
01860     {
01861         delete pMouldGroup;
01862         return NULL;
01863     }
01864 
01865     return pMouldGroup;
01866 }

NodeMouldPath * NodeMould::AddNewMouldShape Path pShape,
DocRect *const   pDestin,
UndoableOperation pOp
 

Creates a node mould path object using the path pointer given and the destination rectangle described. The object is inserted as the first child of this node mould object and its pointer is returned.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/94
Parameters:
pPath = pointer to a path to use as a shape [INPUTS] pDestin = a rectangular area to place the shape over. If this is NULL the path is used as is. pOp = A pointer to an active operation (can be null)
Returns:
a pointer to the created node mould path (inserted into the tree) NULL if unable to create the node
See also:
-

Definition at line 1749 of file nodemold.cpp.

01752 {
01753     ERROR2IF(pShape==NULL, NULL, "NodeMould::AddNewMouldShape() called with a null path");
01754 
01755     NodeMouldPath* pNodeMPath = CreateNewMouldShape(pShape, pDestin, pOp);
01756     if (pNodeMPath==NULL)
01757         return NULL;
01758 
01759     NodeMouldGroup* pGroup = FindMouldGroup(FALSE);
01760     NodeMoulder* pMoulder = FindFirstMoulder(FALSE);
01761 
01762     Node* pContext = this;
01763     AttachNodeDirection Dir = LASTCHILD;
01764 
01765     if (pMoulder!=NULL)
01766     {
01767         pContext = pMoulder;
01768         Dir = PREV;
01769     }
01770 
01771     if (pGroup!=NULL)
01772     {
01773         pContext = pGroup;
01774         Dir = PREV;
01775     }
01776 
01777     BOOL ok = TRUE;
01778 
01779     if (pOp!=NULL)
01780         ok = pOp->DoInsertNewNode(pNodeMPath, pContext, Dir, FALSE, FALSE, FALSE, FALSE);
01781     else
01782     {
01783         pNodeMPath->AttachNode(pContext, Dir); 
01784         pNodeMPath->SetSelected(FALSE); 
01785     }
01786     
01787     if (!ok)
01788     {
01789         delete pNodeMPath;
01790         return NULL;
01791     }
01792 
01793     return pNodeMPath;
01794 }

virtual BOOL NodeMould::AllowSelectInside  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 211 of file nodemold.h.

00211 { return FALSE; }

BOOL NodeMould::CanBecomeA BecomeA pBecomeA  )  [virtual]
 

This function is used by the convert to shapes operation. It determines if the node or any of its children can convert themselves into an InkClass object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/12/94
Parameters:
InkClass,: The class of object [INPUTS] pNumObjects = ptr to place number of objects of type pClass that will be created (Note: can be NULL). pNumObects in undefined on entry
Returns:
TRUE if the node, or any of its children can transmogrify themselves to become an InkClass object
The number you put into pNumObjects (if it's not NULL) should exactly equal the total number of pClass objects you create. It should NOT contain any additional objects you may produce such as group objects for containing the pClass object, or attributes.

Also, the entry value of *pNumObjects cannot be assumed to be 0.

Reimplemented from NodeCompound.

Definition at line 809 of file nodemold.cpp.

00810 {
00811     // The NodeMoulder can become a NodePath
00812     if (pBecomeA->BAPath())
00813     {
00814         if (pBecomeA->IsCounting())
00815         {
00816             // We need to count how many paths it will create
00817             // We do this by adding the values received by each child NodeMoulder
00818             NodeMoulder* pNodeMoulder = FindFirstMoulder();
00819             while (pNodeMoulder != NULL)
00820             {
00821                 pNodeMoulder->CanBecomeA(pBecomeA);             // Increments count
00822 
00823                 pNodeMoulder = FindNextMoulder(pNodeMoulder);
00824             }
00825         }
00826 
00827         return TRUE;
00828     }
00829 
00830     return FALSE;
00831 }

NodeMould::CC_DECLARE_DYNAMIC NodeMould   )  [private]
 

ChangeCode NodeMould::ConvertCode ActionCode  Act  )  [private]
 

Convert a action code to a change code.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Parameters:
Action code [INPUTS]
Returns:
Change code

Definition at line 2254 of file nodemold.cpp.

02255 {
02256     switch (Act)
02257     {
02258         case AC_FAIL:       return CC_FAIL;
02259         case AC_NORECORD:   return CC_NORECORD;
02260         case AC_OK:         return CC_OK;
02261     }
02262     return CC_OK;
02263 }

void NodeMould::CopyNodeContents NodeMould pCopyOfNode  )  [private]
 

Copies the data from this node to pCopyOfNode by first calling the base class to get it to copy its stuff, and then copying its own stuff Scope: protected.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
pCopyOfNode - The node to copy data to [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
NodeGroup::CopyNodeContents

Definition at line 472 of file nodemold.cpp.

00473 {
00474     ERROR3IF(pCopyOfNode==NULL,"NodeMould::CopyNodeContents() was asked to copy into a NULL pointer");
00475     NodeGroup::CopyNodeContents(pCopyOfNode);
00476 
00477     // Make sure we copy all our personal data here
00478     pCopyOfNode->DetachedGeometry = DetachedGeometry;
00479 
00480     // Need to copy the shape and adjust our pointer.
00481     MouldGeometry* pNewGeom = (MouldGeometry*) pMouldGeometry->MakeCopy();
00482 
00483     // if the shape is NULL ie we couldn't build it what do we do?
00484     if (pNewGeom)
00485         pCopyOfNode->pMouldGeometry = pNewGeom;
00486 
00487 }

INT32 NodeMould::CountMoulders  ) 
 

Count the number of moulder objects which have been created within this mould. This does not include hidden moulder objects of course.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/03/95
Parameters:
[INPUTS] 
Returns:
The number of moulder objects within this mould

Definition at line 1452 of file nodemold.cpp.

01453 {
01454     INT32 Count=0;
01455     Node* pNode = FindFirstChild();
01456     ERROR2IF(pNode == NULL,0, "No children found in MouldObject during NodeMould::CountMoulders()");
01457     while (pNode!=NULL)
01458     {
01459         // check for the right class
01460         if (pNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeMoulder))
01461             Count+=1;
01462 
01463         pNode=pNode->FindNext();
01464     }
01465     return Count;
01466 }

BOOL NodeMould::CreateAllMoulderObjects UndoableOperation pOp  ) 
 

Scan through the children of a mould object, getting all NodeMoulders to regenerate their moulded objects.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/94
Parameters:
pOp = pointer to an operation (can be null) [INPUTS]
Returns:
TRUE if all moulder objects have rebuilt themselves FALSE if one failed.

Definition at line 1529 of file nodemold.cpp.

01530 {
01531     // Scan inside the mould object for the first moulder
01532     NodeMoulder* pMoulder = FindFirstMoulder();
01533     if (!pMoulder)
01534         // there's no moulder object inside this mould so we still can't do anything.
01535         return FALSE;
01536 
01537     // first find the mould group 
01538     NodeMouldGroup* pMouldGroup = FindMouldGroup();
01539     if (!pMouldGroup) 
01540         // there's no mould group inside this mould so we still can't do anything.
01541         return FALSE;
01542 
01543     while (pMoulder)
01544     {
01545         // create moulds for this moulder
01546         if (!pMoulder->CreateMouldedObjects(pMouldGroup, pMouldGeometry, pOp))
01547             return FALSE;
01548         // skip to the next moulder object
01549         pMoulder = (NodeMoulder*) pMoulder->FindNext(CC_RUNTIME_CLASS(NodeMoulder));
01550     }
01551     return TRUE;
01552 }

BOOL NodeMould::CreateAttrSetFromChildren AttrTypeSet AttSet  ) 
 

Builds a set of AttrTypeSet set of attributes from the children of a node.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/06/95
Parameters:
- [INPUTS]
AttSet = a set of attributes which are children of the compound node [OUTPUTS]
Returns:
TRUE - if the set was built correctly FALSE - if not

Definition at line 1094 of file nodemold.cpp.

01095 {
01096     Node* qNode = FindFirstChild();
01097     while (qNode && qNode->IsAnAttribute())
01098     {
01099         if (!AttSet.AddToSet(((NodeAttribute*)qNode)->GetAttributeType()))
01100             return FALSE;
01101         qNode=qNode->FindNext();
01102     }
01103     return TRUE;
01104 }

BOOL NodeMould::CreateGeometry MouldSpace  mSpace  ) 
 

Changes the mould space used by this mould to that described by mSpace. Currently the defined spaces are MOULDSPACE_ENVELOPE MOULDSPACE_PERSPECTIVE.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/94
Parameters:
mSpace = the type of mould to create. Currently use Envelope or Perspective [INPUTS] enum values. It can also be NULL if you wish to use the shape as is.
Returns:
TRUE if the geometry has been created successfully. FALSE then unable to create the geometry object (out of memory)

Definition at line 322 of file nodemold.cpp.

00323 {
00324     // now build the new vector space polymorphically
00325     MouldGeometry* pNewGeom=NULL;
00326 
00327     switch (mSpace)
00328     {
00329         case MOULDSPACE_ENVELOPE:
00330         {
00331             MouldEnvelope* mNewSpace = new MouldEnvelope;
00332             if (!mNewSpace)
00333                 return FALSE;
00334             if (!mNewSpace->Initialise())
00335             {
00336                 delete mNewSpace;
00337                 return FALSE;
00338             }
00339             pNewGeom = mNewSpace;
00340             break;
00341         }
00342 
00343         case MOULDSPACE_ENVELOPE2X2:
00344         {
00345             MouldEnvelope2x2* mNewSpace = new MouldEnvelope2x2;
00346             if (!mNewSpace)
00347                 return FALSE;
00348             if (!mNewSpace->Initialise())
00349             {
00350                 delete mNewSpace;
00351                 return FALSE;
00352             }
00353             pNewGeom = mNewSpace;
00354             break;
00355         }
00356 
00357         case MOULDSPACE_PERSPECTIVE:
00358         {
00359             MouldPerspective* mNewSpace = new MouldPerspective;
00360             if (!mNewSpace)
00361                 return FALSE;
00362             pNewGeom = mNewSpace;
00363             break;
00364         }
00365         default: break;
00366     }
00367 
00368     if (!pNewGeom)
00369         return FALSE;
00370 
00371     // Assign the class geometry pointer the new shape
00372     // Note, we do not record the mouldspace in our class because
00373     // we dont really need to. The shape is an abstract class with
00374     // concrete geometries derived from it and hence we can call a shape
00375     // function and the run time binder will call the correct class func.
00376 
00377     pMouldGeometry = pNewGeom;
00378     return TRUE;
00379 }

NodeMoulder * NodeMould::CreateNewMoulder UndoableOperation pOp  ) 
 

Creates a NodeMoulder object and returns a pointer to it.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/94
Parameters:
pOp = A pointer to an active operation (can be null) [INPUTS]
Returns:
a pointer to the moulder object (not in the tree). NULL if failed to create this moulder.
See also:
-

Definition at line 1570 of file nodemold.cpp.

01571 {
01572     BOOL ok;
01573 
01574     // first find the mould group 
01575     NodeMouldGroup* pMouldGroup = FindMouldGroup();
01576     if (!pMouldGroup) return NULL;
01577 
01578     // Now create a moulder object
01579     NodeMoulder* pMoulder;
01580     ALLOC_WITH_FAIL( pMoulder, new NodeMoulder, pOp);
01581     if (!pMoulder) return NULL;
01582 
01583     // get the moulder to initialise itself
01584     CALL_WITH_FAIL(pMoulder->Initialise(pMouldGroup), pOp, ok);
01585     if (!ok)
01586     {
01587         delete pMoulder;
01588         return NULL;
01589     }
01590 
01591     // its built so lets return it
01592     return pMoulder;
01593 }

NodeMouldGroup * NodeMould::CreateNewMouldGroup UndoableOperation pOp  ) 
 

Creates a MouldGroup object and returns a pointer to it.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/94
Parameters:
pOp = A pointer to an active operation (can be null) [INPUTS]
Returns:
a pointer to the created mould group (not in the tree) NULL if unable to create the node
See also:
-

Definition at line 1811 of file nodemold.cpp.

01812 {
01813     // Create a mould group object
01814     NodeMouldGroup* pMouldGroup;
01815     ALLOC_WITH_FAIL( pMouldGroup, new NodeMouldGroup, pOp);
01816     return pMouldGroup;
01817 }

NodeMouldPath * NodeMould::CreateNewMouldShape Path pShape,
DocRect *const   pDestin,
UndoableOperation pOp
 

Creates a node mould path object using the path pointer given and the destination rectangle described. The objects pointer is returned.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/94
Parameters:
pPath = pointer to a path to use as a shape [INPUTS] pDestin = a rectangular area to place the shape over. If this is NULL the path is used as is. pOp = A pointer to an active operation (can be null)
Returns:
a pointer to the created node mould path (not in the tree) NULL if unable to create the node
See also:
-

Definition at line 1673 of file nodemold.cpp.

01676 {
01677     ERROR2IF(pShape==NULL, NULL, "NodeMould::CreateNewMouldShape() called with a null path");
01678 
01679     // Note, we do not record the mouldspace in our class because
01680     // we dont really need to. The shape is an abstract class with
01681     // concrete geometries derived from it and hence we can call a shape
01682     // function and the run time binder will call the correct class func.
01683 
01684     BOOL ok;
01685 
01686     // build the new vector space polymorphically
01687     NodeMouldPath* pNodeMPath;
01688     ALLOC_WITH_FAIL( pNodeMPath, new NodeMouldPath, pOp);
01689     if (!pNodeMPath)
01690         return NULL;
01691 
01692     Path* pPath = (&(pNodeMPath->InkPath));
01693 
01694     CALL_WITH_FAIL(pPath->Initialise(pShape->GetNumCoords(), 12), pOp, ok);
01695     if (!ok)
01696     {
01697         delete pNodeMPath;
01698         return NULL;
01699     }
01700 
01701     CALL_WITH_FAIL(pPath->CopyPathDataFrom(pShape), pOp, ok);
01702     if (!ok)
01703     {
01704         delete pNodeMPath;
01705         return NULL;
01706     }
01707 
01708     // make sure our path has no fill bit
01709     pPath->IsFilled=FALSE;
01710 
01711     if (pDestin)
01712     {
01713         // we have been given a destination rectangle to map the path shape onto,
01714         // so first we need the source bbox
01715         DocRect Source = pPath->GetBoundingRect();
01716 
01717         // Build a transform matrix and apply it to this mould
01718         Matrix Mat(Source,*pDestin);
01719         Trans2DMatrix Trans(Mat);
01720         Trans.Transform( (DocCoord*)pPath->GetCoordArray(), pPath->GetNumCoords() );
01721     }
01722 
01723     return pNodeMPath;
01724 }

String NodeMould::Describe BOOL  Plural,
BOOL  Verbose
[virtual]
 

To return a description of the Mould object in either the singular or the plural. This method is called by the DescribeRange method.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
Plural,: Flag indicating if the string description should be plural or [INPUTS] singular.
- [OUTPUTS] Retuns: Description of the mould node
The description will always begin with a lower case letter.

Reimplemented from NodeGroup.

Definition at line 418 of file nodemold.cpp.

00419 {     
00420     if (Plural)
00421         return(String(_R(IDS_MOULD_DESCRP)));  
00422     else
00423         return(String(_R(IDS_MOULD_DESCRS))); 
00424 }; 

MouldSpace NodeMould::DescribeGeometry  ) 
 

Find out what type of geometry is defined for this mould object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/12/94
Parameters:
[INPUTS] 
Returns:
The current mould space defined for this mould object. ie what type of mould geometry it uses, eg envelope, perspective etc.

Definition at line 1303 of file nodemold.cpp.

01304 {
01305     if (pMouldGeometry)
01306         return pMouldGeometry->Describe();
01307 
01308     return MOULDSPACE_UNDEFINED;
01309 }

void NodeMould::DisableBlobs  )  [inline]
 

Definition at line 259 of file nodemold.h.

00259 { RenderBlobs=FALSE;    }

BOOL NodeMould::DoBecomeA BecomeA pBecomeA  )  [virtual]
 

Transforms the object into another type of object. This converts all its children, and replaces itself in the tree with a NodeGroup.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
pBecomeA = ptr to a class that contains all the info needed to become a new [INPUTS] type of node.
- [OUTPUTS]
Returns:
TRUE if the object has been transformed, FALSE if we run out of memory

Errors: -

See also:
Node::CanBecomeA

Reimplemented from NodeCompound.

Definition at line 853 of file nodemold.cpp.

00854 {
00855     BOOL ok;
00856 
00857     switch (pBecomeA->GetReason())
00858     {
00859         case BECOMEA_REPLACE:
00860         {
00861 //          ERROR2IF(pBecomeA->GetUndoOp() == NULL,FALSE,"Trying to replace a NodeMould, but pUndoOp == NULL");
00862             UndoableOperation* pUndoOp = pBecomeA->GetUndoOp();
00863 
00864             // If replacing the mould with shapes, hide the mould, create a group, and move all the children
00865             // so they become children of the new group node
00866 
00867             NodeMoulder* pMoulder = FindFirstMoulder();
00868             if (pMoulder!=NULL)
00869             {
00870                 BOOL IsSelected = this->IsSelected();
00871                 SetSelected(FALSE);
00872 
00873                 // Localise only the current children so undo factors out only these
00874                 AttrTypeSet AttrTypes;
00875                 if (!CreateAttrSetFromChildren(AttrTypes))
00876                     return FALSE;
00877 
00878                 // localise common child attributes before moving objects!
00879                 if (pUndoOp)
00880                 {
00881                     if (!pUndoOp->DoLocaliseCommonAttributes(this, FALSE, FALSE, &AttrTypes))
00882                         return FALSE;
00883 
00884                     if (!pUndoOp->DoLocaliseCommonAttributes(pMoulder))
00885                         return FALSE;
00886                 }
00887                 else
00888                 {
00889                     if (!LocaliseCommonAttributes(FALSE, FALSE, &AttrTypes))
00890                         return FALSE;
00891 
00892                     if (!pMoulder->LocaliseCommonAttributes())
00893                         return FALSE;
00894                 }
00895 
00896                 // Pass on this message to our child ink nodes first
00897                 Node* pNode = pMoulder->FindFirstChild();
00898                 while (pNode != NULL)
00899                 {
00900                     Node* pThisNode = pNode;
00901                     pNode = pNode->FindNext();
00902                     pThisNode->DoBecomeA(pBecomeA);
00903                 }
00904 
00905                 // Allocate a new NodeGroup node
00906                 NodeGroup* pNodeGroup;
00907                 ALLOC_WITH_FAIL(pNodeGroup, (new NodeGroup), pUndoOp); 
00908                 if (pNodeGroup == NULL)
00909                     return FALSE;
00910 
00911                 // Insert the NodeGroup next to the NodeMould 
00912                 if (pUndoOp)
00913                 {
00914                     if (!pUndoOp->DoInsertNewNode(pNodeGroup,this,NEXT,FALSE,FALSE,FALSE,FALSE))
00915                         return FALSE;
00916 
00917                     // if we were selected the lets select our group
00918                     if (IsSelected)
00919                     {
00920                         // Select the group
00921                         if (!pUndoOp->DoSelectNode(pNodeGroup,FALSE))
00922                             return FALSE;
00923                     }
00924                 }
00925                 else
00926                 {
00927                     pNodeGroup->AttachNode(this,NEXT);
00928                 }
00929 
00930                 // Now move each node in turn.
00931                 pNode = pMoulder->FindLastChild();
00932                 while (pNode != NULL)
00933                 {                                                          
00934                     // Find the next node to move before we shift up the children
00935                     Node* pPrevNode = pNode->FindPrevious(); 
00936                     if (pNode->IsAnObject())
00937                     {
00938                         if (pUndoOp)
00939                         {
00940                             CALL_WITH_FAIL(pUndoOp->DoMoveNode(pNode, pNodeGroup, FIRSTCHILD), pUndoOp, ok);
00941                             if (!ok)
00942                                 return FALSE;
00943                         }
00944                         else
00945                         {
00946                             pNode->MoveNode(pNodeGroup, FIRSTCHILD);
00947                         }
00948                     }
00949                     pNode = pPrevNode;  
00950                 }
00951 
00952                 // Karim 15/05/2000 - this new loop copies non-optimising attrs applied to
00953                 // the NodeMould object, into the new group. Note that although CopyNode()
00954                 // is NOT undoable, things should be fine as the insertion of the group *was*.
00955                 pNode = FindLastChild();
00956                 while (pNode != NULL)
00957                 {
00958                     Node* pPrevNode = pNode->FindPrevious();
00959                     if (    pNode->IsAnAttribute() &&
00960                             !((NodeAttribute*)pNode)->ShouldBeOptimized() )
00961                     {
00962                         CALL_WITH_FAIL(pNode->CopyNode(pNodeGroup, FIRSTCHILD), pUndoOp, ok)
00963                         if (!ok)
00964                             return FALSE;
00965                     }
00966                     pNode = pPrevNode;  
00967                 }
00968 
00969                 // factor up on the group.
00970                 if (pUndoOp)
00971                 {
00972                     if (!pUndoOp->DoFactorOutCommonChildAttributes(pNodeGroup))
00973                         return FALSE;
00974                 }
00975                 else
00976                 {
00977                     if (!pNodeGroup->FactorOutCommonChildAttributes())
00978                         return FALSE;
00979                 }
00980 
00981                 // Remove any nasty perspective fills from the result
00982                 NodeMould::RemovePerspectiveFills(pNodeGroup, pUndoOp);
00983 
00984                 // Hide the mould node
00985                 if (pUndoOp)
00986                 {
00987                     if (!pUndoOp->DoHideNode(this, FALSE, NULL, FALSE))
00988                         return FALSE;
00989                 }
00990                 else
00991                 {
00992                     CascadeDelete();
00993                     delete this;
00994                 }
00995             }
00996         }
00997         break;
00998 
00999         case BECOMEA_PASSBACK:
01000         {
01001             // Sequentially ask the children of the blend to DoBecomeA
01002             // This is all that's required because the child objects are only passing back
01003             // the new node type, and NOT replacing themselves in the tree
01004             // This also ensures the receipient gets the list of paths in render order
01005             Node* pNode = FindFirstChild();
01006             while (pNode != NULL)
01007             {
01008                 Node* pThisNode = pNode;
01009                 pNode = pNode->FindNext();
01010                 if (IS_A(pThisNode,NodeMoulder))
01011                 {
01012                     if (!pThisNode->DoBecomeA(pBecomeA))
01013                         return FALSE;
01014                 }
01015             }
01016         }
01017         break;
01018 
01019         default:
01020             ERROR3_PF(("Unknown BecomeA reason %d",pBecomeA->GetReason()));
01021             break;
01022     }
01023     
01024     return TRUE;
01025 }

void NodeMould::EnableBlobs  )  [inline]
 

Definition at line 260 of file nodemold.h.

00260 { RenderBlobs=TRUE; }

ChangeCode NodeMould::EndSaveContext UndoableOperation pUndoOp,
INT32  rectype
 

Tries to save the current state of the mould shape on the undo.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/01/95
Parameters:
pUndoOp = pointer to an active undoable operation [INPUTS] NULL if none
Returns:
CC_OK if we have successfully saved the mould context CC_FAIL if we have failed to save the context. We've possible run out of memory

Definition at line 2187 of file nodemold.cpp.

02188 {
02189     ChangeCode Chge=CC_OK;
02190 #if !defined(EXCLUDE_FROM_RALPH)
02191 
02192     if (pUndoOp!=NULL)
02193     {
02194         if (NodeMould::pMouldGeometry)
02195         {
02196 //          if (rectype & REC_REBUILD)
02197 //          {
02198 //              Chge = ConvertCode(EndRebuildMouldAction::DoRecord(pUndoOp, this));
02199 //          }
02200 
02201             // no revese actions are required for geometry recording or blob recording
02202         }
02203     }   
02204 #endif
02205     return Chge;
02206 }

BOOL NodeMould::ExportRender RenderRegion pRegion  )  [virtual]
 

Called after this node and all of its children have been rendered to the export region. This outputs the "end mould" command. Supports ArtWorks EPS and Camelot EPS.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/03/95
Parameters:
pRegion = ptr to the export render region to export to [INPUTS]
[OUTPUTS] 
Returns:
TRUE if ok, FALSE if something went wrong

Errors:

Reimplemented from NodeGroup.

Definition at line 2513 of file nodemold.cpp.

02514 {
02515 #ifdef DO_EXPORT
02516     if (pRegion->IS_KIND_OF(NativeRenderRegion))
02517         return PostExportCAMEPS(pRegion);
02518 
02519     if (pRegion->IS_KIND_OF(ArtWorksEPSRenderRegion))
02520         return PostExportAWEPS(pRegion);
02521 #endif
02522     return FALSE;
02523 }

void NodeMould::Extend const ExtendParams ExtParams  )  [virtual]
 

NodeMould uses Node's base-class implementation, as we don't want to inherit NodeGroup's extend behaviour - see Node::Extend() for details. See also: Node::Extend().

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/26/00

Reimplemented from Node.

Definition at line 2779 of file nodemold.cpp.

02780 {
02781     Node::Extend(ExtParams);
02782 
02783     // once we've done the extension, we redefine our path.
02784     // I know it's bad, but I don't know what this does and I'm just copying the code
02785     // from NodeMould::Transform. This code does not cause the mould to visibly change
02786     // shape, that bit happens when the contents of the NodeMoulder are Extended.
02787     if (pMouldGeometry)
02788     {
02789         Path* pPath = GetPath();
02790         NodeMouldGroup* pMouldGroup = FindMouldGroup();
02791         if (pPath && pMouldGroup)
02792         {
02793             DocRect Rect = pMouldGroup->GetChildrensBounds(TRUE);
02794             pMouldGeometry->Define(pPath, &Rect);
02795         }
02796     }
02797 }

BOOL NodeMould::FillMouldGroup NodeMouldGroup pMouldGroup,
List NodeList,
UndoableOperation pOp
 

Moves all the objects specified by NodeList into the mould group. Only objects which can become either a path or a nodebitmap are actually moved.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/94
Parameters:
NodeList = A pointer to a list of nodes to move [INPUTS] pOp = A pointer to an active operation
Returns:
TRUE if filled the group NULL if unable transfer all necessary nodes
See also:
-

Definition at line 1889 of file nodemold.cpp.

01892 {
01893     BOOL ok;
01894     Node* pObj;
01895 
01896     // find the parent spread object
01897     Spread* pParentSpread=FindParentSpread();
01898     if (pParentSpread==NULL)
01899         return FALSE;
01900 
01901     Node* pDNode = (Node*)pMouldGroup;
01902     INT32 count = 0;
01903 
01904     BecomeA PathTester(BECOMEA_TEST, CC_RUNTIME_CLASS(NodePath));
01905     BecomeA BitmapTester(BECOMEA_TEST, CC_RUNTIME_CLASS(NodeBitmap));
01906 
01907     NodeListItem* CurItem = (NodeListItem*)(NodeList->GetHead());
01908     while (CurItem)
01909     {
01910         pObj = CurItem->pNode;
01911 
01912         if (
01913             (pObj->CanBecomeA(&PathTester)) ||
01914             (pObj->CanBecomeA(&BitmapTester))
01915            )
01916         {
01917             // Deselect the node first
01918             if (pObj->IsAnObject())
01919             {
01920                 CALL_WITH_FAIL(pOp->DoDeselectNode((NodeRenderableInk*)pObj,pParentSpread), pOp, ok);
01921                 if (!ok)
01922                     return FALSE;
01923             }
01924             CALL_WITH_FAIL(pOp->DoMoveNode(pObj, pDNode, LASTCHILD), pOp, ok);
01925             if (!ok)
01926                 return FALSE;
01927 
01928             count+=1;
01929         }
01930         CurItem = (NodeListItem*)(NodeList->GetNext(CurItem));
01931     }
01932 
01933     if (!pOp->DoFactorOutCommonChildAttributes(pMouldGroup))
01934         return FALSE;
01935 
01936     // remove the template attribute "names" from the MouldGroup
01937     // as if they are left in this the node group can be selected and
01938     // it should never be selected in the tree.
01939     // this should be recreated when the mould is removed - which it isn't currently
01940     Node * pNode = SliceHelper::FindNextNameNode(pMouldGroup, pMouldGroup);
01941     while (pNode)
01942     {
01943         pOp->DoHideNode(pNode, FALSE);
01944         pNode = SliceHelper::FindNextNameNode(pMouldGroup, pMouldGroup);
01945     }
01946 
01947     // if there's no objects at all fail
01948     return (count>0);
01949 }

NodeMoulder * NodeMould::FindFirstMoulder BOOL  errorcheck = TRUE  ) 
 

A useful function to find the first node moulder object within a NodeMould object. As this is used quite a lot its been 'function'alised.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/12/94
Parameters:
[INPUTS] 
Returns:
A pointer to the first node moulder object inside the NodeMould NULL if unable to find the object

Definition at line 1383 of file nodemold.cpp.

01384 {
01385     // try to find the first node moulder object
01386     Node* pNode = FindFirstChild();
01387     
01388     if (pNode==NULL)
01389     {
01390         if (errorcheck)
01391             ERROR2(NULL,"No children found in MouldObject during NodeMould::FindFirstMoulder()");
01392         return NULL;
01393     }
01394 
01395     // check for the right class
01396     if (pNode->GetRuntimeClass() != CC_RUNTIME_CLASS(NodeMoulder))
01397         pNode = pNode->FindNext(CC_RUNTIME_CLASS(NodeMoulder));
01398 
01399     // there's no moulder object inside this mould so we still can't do anything.
01400     if (pNode==NULL)
01401     {
01402         if (errorcheck)
01403             ERROR2(NULL,"Can't find first NodeMoulder as a child of NodeMould");
01404         return NULL;
01405     }
01406 
01407     // do a type conversion for speed
01408     NodeMoulder* pMoulder = (NodeMoulder*)pNode;
01409 
01410     return pMoulder;
01411 }

NodeMouldGroup * NodeMould::FindMouldGroup BOOL  errorcheck = TRUE  ) 
 

A useful function to find the mould group node within a NodeMould object. As this is used quite a lot its been 'function'alised.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/12/94
Parameters:
[INPUTS] 
Returns:
A pointer to the first node mould group object inside the NodeMould NULL if unable to find the object

Definition at line 1483 of file nodemold.cpp.

01484 {
01485     // try to find the first child node
01486     Node* pNode = FindFirstChild();
01487 
01488     if (pNode==NULL)
01489     {
01490         if (errorcheck)
01491             ERROR2(NULL,"No children found in MouldObject during NodeMould::FindMouldGroup()");
01492         return NULL;
01493     }
01494 
01495     // check for the right class
01496     if (pNode->GetRuntimeClass() != CC_RUNTIME_CLASS(NodeMouldGroup))
01497         pNode = pNode->FindNext(CC_RUNTIME_CLASS(NodeMouldGroup));
01498 
01499     // there's no moulder object inside this mould so we still can't do anything.
01500     
01501     if (pNode==NULL)
01502     {
01503         if (errorcheck)
01504             ERROR2(NULL,"Can't find first NodeMouldGroup as a child of NodeMould");
01505         return NULL;
01506     }
01507 
01508     // do a type conversion for speed
01509     NodeMouldGroup* pMouldGrp = (NodeMouldGroup*)pNode;
01510 
01511     return pMouldGrp;
01512 }

NodeMoulder * NodeMould::FindNextMoulder NodeMoulder pNodeMoulder  ) 
 

A useful function to find the next node moulder object within a NodeMould object.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/1/96
Parameters:
pNodeMoulder = ptr to current node moulder [INPUTS]
Returns:
A pointer to the next node moulder object inside the NodeMould NULL if unable to find the object

Definition at line 1427 of file nodemold.cpp.

01428 {
01429     ERROR2IF(pNodeMoulder == NULL,NULL,"pNodeMoulder == NULL");
01430 
01431     NodeMoulder* pNextNodeMoulder = (NodeMoulder*)pNodeMoulder->FindNext();
01432 
01433     while (pNextNodeMoulder != NULL && !IS_A(pNextNodeMoulder,NodeMoulder))
01434         pNextNodeMoulder = (NodeMoulder*)pNextNodeMoulder->FindNext();
01435 
01436     return pNextNodeMoulder;
01437 }

DocRect NodeMould::GetBlobBoundingRect  )  [virtual]
 

This calculates the bounding box of the mould and adds in the influence of the selection blobs. It does not consider if the blobs are visible or not, it just gives the bounding box that they would occupy if they were visible Note, the mould blob bounds are simply made up of the nodemouldpath bounds and thats yer lot.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/94
Returns:
DocRect - Returns the bounding rect of the path and its blobs

Reimplemented from NodeGroup.

Definition at line 550 of file nodemold.cpp.

00551 {
00552 #if !defined(EXCLUDE_FROM_RALPH)
00553     DocRect Rect;
00554     // Get our blob bounds
00555     if (pMouldGeometry)
00556         Rect = pMouldGeometry->GetBlobBoundingRect();
00557 
00558     // Note I Should really be using NodeRenderableBounded::IncludeChildrensBoundingRects()
00559     // But sadly I cannot, simply due to the fact that it doesn't work!!!
00560     // When given a null rectangle it gets totally confused. 
00561 
00562     // Make sure we include the Bounds of our children
00563     NodeMould::IncludeChildrensBoundingRects(Rect);
00564 
00565     // return the rectangle with the blobs included
00566     return Rect;
00567 #else
00568     return DocRect(0,0,0,0);
00569 #endif
00570 }

DocRect NodeMould::GetChildrensBounds  ) 
 

Definition at line 599 of file nodemold.cpp.

00600 {
00601     DocRect Rect;
00602     NodeMould::IncludeChildrensBoundingRects(Rect);
00603     return Rect;
00604 /*  DocRect Rect,BlobRect;
00605     Node* pNode = FindFirstChild();
00606     while (pNode)
00607     {
00608         if (!(pNode->IsNodeHidden()))
00609         {
00610             if (pNode->IsNodeRenderableClass())
00611             {
00612                 if (!(pNode->IsKindOf(CC_RUNTIME_CLASS(NodeMouldGroup))))
00613                 {
00614                     BlobRect=((NodeRenderable*)pNode)->GetBlobBoundingRect();
00615                     Rect=Rect.Union(BlobRect);
00616                 }
00617             }
00618         }
00619         pNode=pNode->FindNext();
00620     }
00621     return Rect;*/
00622 }

void NodeMould::GetDebugDetails StringBase Str  )  [virtual]
 

Displays debugging info of the tree For obtaining debug information about the Node.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/94
Parameters:
Str,: String giving debug info about the node [OUTPUTS]

Reimplemented from NodeRenderableBounded.

Definition at line 1238 of file nodemold.cpp.

01239 {
01240 #ifdef _DEBUG
01241     // Call base class
01242     NodeRenderableInk::GetDebugDetails( Str );
01243     
01244     String_256 TempStr;
01245         
01246     (*Str) += TEXT( "\r\nMould Data Dump\r\n" );
01247 
01248     DocRect BlobRect = GetBlobBoundingRect();
01249     TempStr._MakeMsg( TEXT("Blob Bounding Rect :-\r\n\t#1%ld,\t#2%ld\r\n\t#3%ld,\t#4%ld\r\n"),
01250                       BlobRect.lo.x, BlobRect.lo.y, BlobRect.hi.x, BlobRect.hi.y );
01251     (*Str) += TempStr;
01252 
01253     // call the mould shape debug function
01254     if (pMouldGeometry)
01255         pMouldGeometry->GetDebugDetails( Str );
01256 #endif
01257 }

DocRect NodeMould::GetExtendTargetBounds const ExtendParams ExtParams  )  [virtual]
 

NodeMould uses NodeRenderableBounded's base-class implementation, as we don't want to inherit NodeGroup's extend behaviour - see base class for details. See also: NodeRenderableBounded::Extend().

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/06/2000

Reimplemented from NodeCompound.

Definition at line 2812 of file nodemold.cpp.

02813 {
02814     return NodeRenderableBounded::GetExtendTargetBounds(ExtParams);
02815 }

MouldGeometry* NodeMould::GetGeometry  )  const [inline]
 

Definition at line 253 of file nodemold.h.

00253 { return pMouldGeometry; }

UINT32 NodeMould::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from NodeGroup.

Definition at line 528 of file nodemold.cpp.

00529 {     
00530     return (sizeof(NodeMould)); 
00531 }  

Path * NodeMould::GetPath  ) 
 

A useful function to find the actual path used for moulding As this is used quite a lot its been 'function' alised.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/01/95
Parameters:
- [INPUTS]
Returns:
A pointer to the path object inside the first node mould shape object inside the NodeMould! NULL if unable to find the object

Definition at line 1329 of file nodemold.cpp.

01330 {
01331     NodeMouldPath* pNodeMPath = GetPathShape();
01332     if (pNodeMPath)
01333         return (&(pNodeMPath->InkPath));
01334     return NULL;
01335 }

NodeMouldPath * NodeMould::GetPathShape  ) 
 

A useful function to find the first node mould shape object within a NodeMould object. As this is used quite a lot its been 'function'alised.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/12/94
Parameters:
- [INPUTS]
Returns:
A pointer to the first node mould path object inside the NodeMould NULL if unable to find the object

Definition at line 1351 of file nodemold.cpp.

01352 {
01353     // try to find the first node moulder object
01354     Node* pNode = FindFirstChild();
01355     ERROR2IF(pNode == NULL,NULL, "No children found in MouldObject during NodeMould::GetPathShape()");
01356 
01357     // check for the right class
01358     if (pNode->GetRuntimeClass() != CC_RUNTIME_CLASS(NodeMouldPath))
01359         pNode = pNode->FindNext(CC_RUNTIME_CLASS(NodeMouldPath));
01360 
01361     // there's no geometry object inside this mould so we still can't do anything.
01362     ERROR2IF(pNode==NULL,NULL, "Can't find first NodeMouldPath as a child of NodeMould");
01363 
01364     return (NodeMouldPath*)pNode;
01365 }

DocRect NodeMould::GetRenderBounds  ) 
 

Return the bounding rect of the mould. This rectangle includes only those items in the mould which are visible and hence will be invalidated by the OS. Items such as the NodeMouldGroup (which are of course invisible) do not get involved in the renderbounds.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/94
Returns:
DocRect - the bounding rect of the mould

Definition at line 588 of file nodemold.cpp.

00589 {
00590     DocRect Rect;
00591     if (pMouldGeometry)
00592         Rect = pMouldGeometry->GetBlobBoundingRect();
00593 
00594     Rect = Rect.Union(GetChildrensBounds());
00595     return Rect;
00596 }

virtual BOOL NodeMould::GroupCanTransformCached TransformBase Trans  )  const [inline, virtual]
 

Reimplemented from NodeGroup.

Definition at line 288 of file nodemold.h.

00288 {return TRUE;}

ChangeCode NodeMould::HandleMouldShapeChange ObjChangePathEdit pParam  )  [private]
 

The user is about to edit, in the action of editing, or has edited, our mould shape. We as a parent need to sort out whether they are allowed to continue. If so we need to perform various actions dependent on what stage the change is in. AboutToEdit: we need to decide whether there is a good reason to prevent the edit from taking place Editing: we need to eor our edit blobs on when necessary HasEdited: we need to perform a remould of all children.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/01/95
Parameters:
pParam = pointer to a object change parameter class [INPUTS]
Returns:
CC_OK if we have successfully processed the change. CC_FAIL if we cannot handle this particular change and must prevent the child from continuing

Definition at line 2292 of file nodemold.cpp.

02293 {
02294 #if defined(EXCLUDE_FROM_RALPH)
02295     ERROR3("NodeMould::HandleMouldShapeChange called");
02296     return (ChangeCode)CC_OK;
02297 #else
02298     ObjChangeType pType = pParam->GetChangeType();
02299     ObjChangeFlags pFlags = pParam->GetChangeFlags();
02300     ChangeCode Chge = CC_OK;
02301     BOOL ok;
02302 
02303     if (pMouldGeometry)
02304     {
02305         switch (pType)
02306         {
02307             case OBJCHANGE_STARTING:
02308                 Chge=StartSaveContext(pParam->GetOpPointer(), REC_REBUILD | REC_BLOBS | REC_GEOMCONTEXT);
02309                 pParam->ChangeMask.ClaimAll();
02310                 pMouldGeometry->DisableControlBlobs();
02311                 break;
02312 
02313             case OBJCHANGE_RENDERCURRENTBLOBS:
02314                 pMouldGeometry->RenderDragBlobs(pParam->pChangeSpread);
02315                 break;
02316 
02317             case OBJCHANGE_RENDERCHANGEDBLOBS:
02318                 ok=pMouldGeometry->Define(pParam->pChangePath,NULL);
02319                 pMouldGeometry->RenderDragBlobs(pParam->pChangeSpread);
02320                 if (!ok)
02321                     Chge=CC_FAIL;
02322                 break;
02323 
02324             case OBJCHANGE_FINISHED:
02325             {
02326                 pMouldGeometry->EnableControlBlobs();
02327                 if (Chge==CC_OK)
02328                 {
02329                     Spread* pSpread = FindParentSpread();
02330                     Chge=pMouldGeometry->RecordBlobs(pParam->GetOpPointer(), pSpread);
02331                     if (Chge==CC_OK)
02332                     {
02333                         Chge = RemouldAll(pParam->GetOpPointer());
02334                         if (Chge==CC_OK)
02335                             Chge=EndSaveContext(pParam->GetOpPointer(), REC_REBUILD | REC_BLOBS | REC_GEOMCONTEXT);
02336                     }
02337                 }
02338             }
02339             break;
02340 
02341             case OBJCHANGE_FAILED:
02342                 pMouldGeometry->RenderDragBlobs(pParam->pChangeSpread);
02343                 pMouldGeometry->EnableControlBlobs();
02344                 RedrawMould();
02345                 break;
02346 
02347             default:
02348                 break;
02349         }
02350     }
02351     return Chge;
02352 #endif
02353 }

Node * NodeMould::HasEditableChild CCRuntimeClass ChildClass,
Node pPreviousChild
[virtual]
 

This function returns our edit node (the nodemouldpath) which forms part of the mould objects editable surface.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/3/95
Parameters:
ChildClass = the runtime class of the editable object [INPUTS] pPreviousChild = a pointer to the previous editable child returned by 'this' node, NULL if this is the first call to this node.
- [OUTPUTS]
Returns:
A node pointer, to an object which forms part of the editable surface of its parent (this node).

Reimplemented from Node.

Definition at line 1971 of file nodemold.cpp.

01972 {
01973     if (ChildClass != CC_RUNTIME_CLASS(NodePath))
01974         return NULL;
01975 
01976     NodeMouldPath* pNodeMPath = GetPathShape();
01977     // check to see if this has already been asked for once
01978     if (((Node*)pNodeMPath)==pPreviousChild)
01979         return NULL;
01980 
01981     return GetPathShape();
01982 }

void NodeMould::IncludeChildrensBoundingRects DocRect BoundingRect  )  [private]
 

The childrens Blob bounding rects are added to the BoundingRect.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/01/95
Parameters:
BoundingRect is updated to include the childrens bounding rects. [OUTPUTS]

Definition at line 636 of file nodemold.cpp.

00637 {
00638     Node* pNode;
00639     DocRect BlobRect;
00640 
00641     // Start scanning the children
00642     pNode = this->FindFirstChild();
00643     while (pNode!=NULL)
00644     {
00645         if (!pNode->IsNodeHidden())
00646         {
00647             if (pNode->IsAnObject())
00648             {
00649                 BlobRect=((NodeRenderable*)pNode)->GetBlobBoundingRect();
00650                 BoundingRect=BoundingRect.Union(BlobRect);
00651             }
00652         }
00653         pNode=pNode->FindNext();
00654     }
00655 }

void NodeMould::InitialiseVars  ) 
 

Common place to set up the classes private variables.

void NodeMould::InitialiseVars()

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

Definition at line 275 of file nodemold.cpp.

00276 {
00277     pMouldGeometry=NULL;
00278     DetachedGeometry=FALSE;
00279     OnCC_CRC=0;
00280     OnCC_Width=0;
00281     OnCC_Height=0;
00282     RenderBlobs=TRUE;
00283 }

BOOL NodeMould::IsANodeMould  )  const [virtual]
 

Virtual function to determine whether this node is a NodeMould.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/12/2000

Reimplemented from Node.

Definition at line 296 of file nodemold.cpp.

00297 {
00298     return TRUE;
00299 }

BOOL NodeMould::IsDetached  )  const [inline]
 

Definition at line 225 of file nodemold.h.

00225 { return DetachedGeometry; }

virtual BOOL NodeMould::IsTypeExtendible  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 240 of file nodemold.h.

00240 { return TRUE; }

virtual BOOL NodeMould::IsValidEffectAttr NodeAttribute pAttr  )  const [inline, virtual]
 

Get width of pixels for use in capturing this group as a tight group bitmapDetermine whether this type of attribute can be an effect attribute On this node at this time.Determine whether this attribute instance can be an effect attribute On this node at this time.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/2005
Parameters:
Attribute [INPUTS]
Returns:
TRUE if the attr is a valid effect attr

Reimplemented from NodeGroup.

Definition at line 287 of file nodemold.h.

00287 {return FALSE;}

ChangeCode NodeMould::OnChildChange ObjChangeParam pParam  )  [virtual]
 

An object has or is currently being edited inside our mould so we need to perform actions related to this change. The parameter block passed to us will define what to do (if we recognise it). Otherwise we will simply perform the default action of remoulding ourselves on receiving a HasChanged reason.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/01/95
Parameters:
pParam = pointer to a object change parameter class [INPUTS]
Returns:
CC_OK if we have successfully processed the change. CC_FAIL if we cannot handle this particular change and must prevent the child from continuing

Reimplemented from NodeGroup.

Definition at line 2023 of file nodemold.cpp.

02024 {
02025 #if defined(EXCLUDE_FROM_RALPH)
02026     ERROR3("NodeMould::OnChildChange being called");
02027     return (ChangeCode)CC_OK;
02028 #else
02029     ERROR2IF(pParam==NULL,CC_FAIL,"NodeMould::OnChildChange() called with a null parameter");
02030 
02031     // check for a specific derived change type
02032     if (pParam->IS_KIND_OF(ObjChangePathEdit))
02033     {
02034         // see if its our shape path thats being altered
02035         Node* pChangedObj = pParam->GetChangeObj();
02036         NodeMouldPath* pShape = GetPathShape();
02037         if (pChangedObj==pShape)
02038             return HandleMouldShapeChange((ObjChangePathEdit*)pParam);
02039     }
02040 
02041     // now read the parameter block types
02042     ObjChangeType pType = pParam->GetChangeType();
02043     ObjChangeFlags cFlags = pParam->GetChangeFlags();
02044     ChangeCode Chge = CC_OK;
02045 
02046     // otherwise its not our mould shape thats changed so
02047     // simply perform a remould
02048     if (pType==OBJCHANGE_FINISHED)
02049     {
02050         // if this change is a copy the do nothing.
02051         if (!cFlags.CopyNode)
02052         {
02053             // Node* pChangedObj = pParam->GetChangeObj();
02054             NodeMouldPath* pShape = GetPathShape();
02055             NodeMouldGroup* pNodeMGroup = FindMouldGroup();
02056             UndoableOperation* UndoOp = pParam->GetOpPointer();
02057     
02058             if ((pNodeMGroup!=NULL) && (pShape!=NULL) && (UndoOp!=NULL))
02059             {
02060                 // Has the mould path changed shape?
02061                 INT32 newCRC = pShape->InkPath.CalcCRC();
02062         
02063                 // Have the bounds of the source objects changed?
02064                 DocRect Rect = pNodeMGroup->GetChildrensBounds(FALSE);
02065                 INT32 rw = Rect.Width();
02066                 INT32 rh = Rect.Height();
02067 
02068                 BOOL ch = ((newCRC!=OnCC_CRC) || (rw!=OnCC_Width) || (rh!=OnCC_Height));
02069 
02070                 if (ch)
02071                 {
02072                     if (newCRC!=OnCC_CRC)
02073                     {
02074                         // The mould path has changed so we better check it
02075                         UINT32 errID;
02076                         if (!pMouldGeometry->Validate( &(pShape->InkPath), errID ))
02077                             return CC_FAIL;
02078                     }
02079 
02080                     Chge=RecordChangeCodes(UndoOp);
02081                     if (Chge==CC_OK)
02082                     {
02083                         // Set the new CRC.
02084                         OnCC_CRC=newCRC;
02085                         OnCC_Width=rw;
02086                         OnCC_Height=rh;
02087 
02088                         Chge = StartSaveContext(UndoOp,REC_REBUILD | REC_GEOMCONTEXT);
02089                         if (Chge==CC_OK)
02090                         {
02091                             pMouldGeometry->Define(&(pShape->InkPath),&Rect);
02092                             Chge = RemouldAll(UndoOp);
02093                             if (Chge==CC_OK)
02094                                 Chge = EndSaveContext(UndoOp,1+4);
02095                         }
02096                     }
02097                 }
02098             }
02099         }
02100     }
02101 
02102     return Chge;    
02103 #endif
02104 }

BOOL NodeMould::OnClick DocCoord  PointerPos,
ClickType  Click,
ClickModifiers  ClickMods,
Spread pSpread
[virtual]
 

Allows the Node to respond to clicks by selecting its blobs or starting drags etc. Here we check for clicks over a moulds shape. If a blob has been clicked on we start a new drag operation to alter the shape of the mould.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
PointerPos - The Location of the mouse pointer at the time of the click [INPUTS] Click - The type of click received (single, double, drag etc) ClickMods - The modifiers to the click (eg shift, control etc )
Returns:
TRUE - if the node claims the click as its own FALSE - if it is not interested in the click

Reimplemented from NodeGroup.

Definition at line 678 of file nodemold.cpp.

00680 {
00681 #if !defined(EXCLUDE_FROM_RALPH)
00682     // we only handle the click if we can confirm that object blobs are being displayed.
00683     BlobManager* pBlobMgr = GetApplication()->GetBlobManager();
00684     if (pBlobMgr == NULL)
00685         return FALSE;
00686     if (!pBlobMgr->GetCurrentInterest().Object)
00687         return FALSE;
00688 
00689     // pass the click on to the shape handler if there is one.
00690     if (pMouldGeometry)
00691     {
00692         if (pMouldGeometry->OnClick(PointerPos, Click, ClickMods, pSpread, this))
00693             return TRUE;
00694     }
00695      
00696     // if none try the actual manifold shape itself.
00697     NodeMouldPath* pPathShape = GetPathShape();
00698     if (pPathShape)
00699     {
00700         if (pPathShape->OnClick(PointerPos, Click, ClickMods, pSpread))
00701             return TRUE;
00702     }
00703 #endif
00704     return FALSE;
00705 }

BOOL NodeMould::OnMouseMove DocCoord  PointerPos,
Spread pSpread,
ClickModifiers  ClickMods,
INT32 *  ctype,
INT32 *  msgres
 

A very unusual function to find in a node. This must exist so that the mould tool can ask the mould object what cursor to show as the mouse moves around. The function is called for each selected mould object when the mould tool is current. The nub of the problem is that a mould object can basically be made up of virtually anything. We actually need to ask the mould shape handler inside the mould object what type of cursor it wants to show and what sort of resouced message it would like to display. This cannot be determined from outside the object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
PointerPos - The Location of the mouse pointer [INPUTS] Click - The type of click received (single, double, drag etc) ClickMods - The modifiers to the click (eg shift, control etc )
- [OUTPUTS]
Returns:
TRUE - if the node has processed this event FALSE - if not

Definition at line 732 of file nodemold.cpp.

00733 {
00734 #if !defined(EXCLUDE_FROM_RALPH)
00735     // check for movement over our mould path end points and get
00736     // the caller to set the correct status bar and cursor stuff
00737     if (OverMouldEndPoint(PointerPos,pSpread))
00738     {
00739         *ctype=3;
00740         *msgres=3;
00741         return TRUE;
00742     }
00743 
00744     // pass the mouse move on to the shape handler if there is one.
00745     if (pMouldGeometry)
00746     {
00747         if (pMouldGeometry->OnMouseMove(PointerPos, pSpread, ClickMods, ctype, msgres))
00748             return TRUE;
00749     }
00750 
00751 #endif
00752     // otherwise, nothing to do with us matey
00753     return FALSE;
00754 }

BOOL NodeMould::OnNodePopUp Spread pSpread,
DocCoord  PointerPos,
ContextMenu pMenu
[virtual]
 

This provides descriptions for the mould records. Allows the Mould object to respond to pop up menu clicks on itself.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Parameters:
pSpread The spread in which things are happening [INPUTS] PointerPos The Location of the mouse pointer at the time of the click pMenu The menu to which items should be added
Returns:
BOOL - TRUE if the node claims the click as its own and FALSE if it is not interested in the click

Reimplemented from NodeRenderableInk.

Definition at line 3087 of file nodemold.cpp.

03088 {
03089 //WEBSTER-ranbirr-01/12/96  
03090 #ifndef WEBSTER
03091     BOOL ok = TRUE;
03092 //  WEBSTER-ranbirr-01/12/96    
03093 #ifndef WEBSTER
03094     
03095     ok = ok && pMenu->BuildCommand(TOOL_OPTOKEN_MOULD,  TRUE);
03096 //  ok = ok && pMenu->BuildCommand(OPTOKEN_DETACHMOULD, FALSE);
03097 //  ok = ok && pMenu->BuildCommand(OPTOKEN_ROTATEMOULD, FALSE);
03098 //  ok = ok && pMenu->BuildCommand(OPTOKEN_COPYMOULD,   TRUE);
03099 //  ok = ok && pMenu->BuildCommand(OPTOKEN_RECTANGULARENVELOPE,     FALSE);
03100 //  ok = ok && pMenu->BuildCommand(OPTOKEN_RECTANGULARPERSPECTIVE,  TRUE);
03101 #endif //webster
03102 
03103     return ok;
03104 #else //webster
03105     return FALSE;
03106 #endif //webster
03107 }

BOOL NodeMould::OverMouldEndPoint DocCoord  coord,
Spread pSpread
[private]
 

This routine checks for the mouse being over end points of our mould path.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/02/95
Parameters:
PointerPos = coordinate of mouse move, [INPUTS] pSpread = pointer to spread containing coord
- [OUTPUTS]
Returns:
TRUE if the coord is over one of the path end points. FALSE if not

Definition at line 772 of file nodemold.cpp.

00773 {
00774     // find the actual moulding path object inside ourselves.
00775     Path* pPath = GetPath();
00776     if (pPath)
00777     {
00778         INT32 Closest=0;
00779         if (pPath->FindNearestPoint(coord, POINTFLAG_ENDPOINTS | POINTFLAG_CONTROLPOINTS, &Closest))
00780             return TRUE;
00781     }
00782     return FALSE;
00783 }

void NodeMould::PolyCopyNodeContents NodeRenderable pNodeCopy  )  [virtual]
 

Polymorphically copies the contents of this node to another.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/2003
Parameters:
- [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Reimplemented from NodeGroup.

Definition at line 502 of file nodemold.cpp.

00503 {
00504     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00505     ENSURE(IS_A(pNodeCopy, NodeMould), "PolyCopyNodeContents given wrong dest node type");
00506 
00507     if (IS_A(pNodeCopy, NodeMould))
00508         CopyNodeContents((NodeMould*)pNodeCopy);
00509 }

BOOL NodeMould::PostExportAWEPS RenderRegion pRegion  ) 
 

Definition at line 2603 of file nodemold.cpp.

02604 {
02605     return TRUE;
02606 }

BOOL NodeMould::PostExportCAMEPS RenderRegion pRegion  ) 
 

Definition at line 2575 of file nodemold.cpp.

02576 {
02577 #ifdef DO_EXPORT
02578     MouldSpace mSpace = DescribeGeometry();
02579     EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
02580 
02581     switch (mSpace)
02582     {
02583         case MOULDSPACE_ENVELOPE:
02584             pDC->OutputToken(_T("ceev"));           // Camelot "end envelope" token
02585             break;
02586         case MOULDSPACE_PERSPECTIVE:
02587             pDC->OutputToken(_T("cepr"));           // Camelot "end perspective" token
02588             break;
02589         default:
02590             break;
02591     }
02592     pDC->OutputNewLine();
02593 #endif
02594 
02595     return TRUE;
02596 }

BOOL NodeMould::PostImport void   )  [virtual]
 

This function is called after a document is imported. Nodes should override this function to do any post-import processing.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/05/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE/FALSE for success/failure
See also:
-

Reimplemented from Node.

Definition at line 2625 of file nodemold.cpp.

02626 {
02627     // if theres already some moulded objects then fine....
02628     if (CountMoulders()>0)
02629         return TRUE;
02630 
02631     // find the created objects we need to set the geometry up
02632     NodeMouldPath* pNodeMPath = GetPathShape();
02633     NodeMouldGroup* pNodeMGroup = FindMouldGroup();
02634     
02635     if (pNodeMGroup==NULL || pNodeMPath==NULL)
02636         return FALSE;
02637 
02638     // Get the kids bounding rects
02639     DocRect Rect = pNodeMGroup->GetChildrensBounds(FALSE);
02640     // We need to set the geometry of our mould using the imported data
02641     // set the geometry using this new mould shape
02642     if (!GetGeometry()->Define(&(pNodeMPath->InkPath), &Rect))
02643         return FALSE;
02644 
02645     // Create a new moulder object
02646     NodeMoulder* pMoulder = AddNewMoulder(this, LASTCHILD, NULL);
02647     if (pMoulder==NULL)
02648         return FALSE;
02649 
02650     // and finally create all the moulded objects inside the moulder
02651     if (!pMoulder->CreateMouldedObjects(pNodeMGroup, GetGeometry(), NULL))
02652     {
02653         // Vape the whole lot.
02654         pMoulder->CascadeDelete();
02655         return FALSE;
02656     }
02657 
02658     // Force a redraw over the extent of the mould (for importing)
02659     // Document* pDoc=Document::GetSelected();
02660     // Naughty Naughty. You cannot rely on a static (?*&$) variable to tell you
02661     // what is selected. Why not just find your parent?
02662     Spread * pSpread = FindParentSpread();
02663     Document * pDoc = NULL;
02664     if (pSpread != NULL)
02665         pDoc = pSpread->FindParentDocument();
02666     if (pDoc!=NULL)
02667     {
02668         DocRect Rect = pNodeMPath->GetBlobBoundingRect();
02669         pDoc->ForceRedraw(pSpread, Rect, TRUE, this);
02670     }
02671     else
02672         ERROR3("NodeMold::PostImport() - pDoc==NULL");
02673 
02674     // Mark this nodes bounds as invalid
02675     InvalidateBoundingRect();
02676 
02677     // All is well and lovely
02678     return TRUE;
02679 }

void NodeMould::PreExportAWEPS RenderRegion pRegion  ) 
 

Definition at line 2599 of file nodemold.cpp.

02600 {
02601 }

void NodeMould::PreExportCAMEPS RenderRegion pRegion  ) 
 

Definition at line 2527 of file nodemold.cpp.

02528 {
02529 #ifdef DO_EXPORT
02530     MouldSpace mSpace = DescribeGeometry();
02531     EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
02532 
02533     pDC->OutputValue(INT32(MOULD_EPS_VERSION)); // The current mould format flag
02534     switch (mSpace)
02535     {
02536         case MOULDSPACE_ENVELOPE:
02537             if (IsDetached())
02538                 InformWarning(_R(IDS_SAVE_WHILE_DETACHEDE), _R(IDS_OK));
02539             pDC->OutputToken(_T("csev"));           // Camelot "start envelope" token
02540 
02541             break;
02542 
02543         case MOULDSPACE_PERSPECTIVE:
02544             if (IsDetached())
02545                 InformWarning(_R(IDS_SAVE_WHILE_DETACHEDP), _R(IDS_OK));
02546             pDC->OutputToken(_T("cspr"));           // Camelot "start perspective" token
02547             break;
02548 
02549         default:
02550             break;
02551     }
02552     pDC->OutputNewLine();
02553 
02554     // output the threshold extension token. We don't need to output this
02555     // if the threshold is still 1024 ie the old value. The importer will
02556     // default to this if there's no threshold token in the file.
02557     INT32 Threshold = GetGeometry()->GetThreshold();
02558     if (Threshold != MOULD_V1THRESHOLD)
02559     {
02560         pDC->OutputValue((INT32)EOTAG_MOULDTHRESHOLD);
02561         pDC->OutputToken(_T("cso"));
02562         pDC->OutputNewLine();
02563         pDC->OutputValue(Threshold);
02564         pDC->OutputToken(_T("cmth"));
02565         pDC->OutputNewLine();
02566         pDC->OutputToken(_T("ceo"));
02567         pDC->OutputNewLine();
02568     }
02569 #endif
02570 }

void NodeMould::PreExportRender RenderRegion pRegion  )  [virtual]
 

Called before this node or any of its children have been rendered to the export region. This outputs the "start mould" command. Supports ArtWorks EPS and Camelot EPS.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/03/95
Parameters:
pRegion = ptr to the export render region to export to [INPUTS]
[OUTPUTS] 
Returns:

Errors:

Reimplemented from NodeGroup.

Definition at line 2480 of file nodemold.cpp.

02481 {
02482 #ifdef DO_EXPORT
02483     if (pRegion->IS_KIND_OF(NativeRenderRegion))
02484     {
02485         PreExportCAMEPS(pRegion);
02486         return;
02487     } 
02488 
02489     if (pRegion->IS_KIND_OF(ArtWorksEPSRenderRegion))
02490     {
02491         PreExportAWEPS(pRegion);
02492         return;
02493     }
02494 #endif
02495 }

ChangeCode NodeMould::RecordChangeCodes UndoableOperation pOp  )  [private]
 

Record the CRC codes held within the mould object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Parameters:
pOp = pointer to a running undoable operation [INPUTS]
- [OUTPUTS]

Definition at line 2223 of file nodemold.cpp.

02224 {
02225     if (pOp!=NULL)
02226     {
02227         RecordChangeCodesAction* CCodeAction;
02228         ActionCode Act;
02229 
02230         // call the actions static init function to get the action going.
02231         Act = RecordChangeCodesAction::Init(pOp, pOp->GetUndoActionList(), this, (Action**)(&CCodeAction));
02232 
02233         if (Act == AC_FAIL)
02234             return CC_FAIL;
02235         if (Act == AC_NORECORD)
02236             return CC_NORECORD;
02237     }
02238     return CC_OK;
02239 }

void NodeMould::RedrawMould  )  [private]
 

Forces a redraw over the mould object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Parameters:
- [INPUTS]

Definition at line 1187 of file nodemold.cpp.

01188 {
01189     Spread* pSpread = FindParentSpread();
01190 
01191     if (pSpread != NULL)
01192     {
01193         BaseDocument* pDoc = pSpread->FindOwnerDoc();
01194 
01195         if ((pDoc != NULL) && (IS_A(pDoc, Document)))
01196         {
01197             DocRect Invalid = GetBlobBoundingRect();
01198             ((Document *) pDoc)->ForceRedraw( pSpread, Invalid, FALSE, this);
01199         }
01200     }
01201 }

ChangeCode NodeMould::RemouldAll UndoableOperation pUndoOp  ) 
 

Creates a new set of moulded objects, now the mould shape has changed.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/01/95
Parameters:
pUndoOp = pointer to an active undoable operation [INPUTS] NULL if none
Returns:
CC_OK if we have successfully remoulded all objects CC_FAIL if we have failed to remould. We've possible run out of memory

Definition at line 2373 of file nodemold.cpp.

02374 {
02375 #if defined(EXCLUDE_FROM_RALPH)
02376     ERROR3("NodeMould::RemouldAll called");
02377 #else
02378     BOOL ok;
02379 
02380     // if we're in detached mode, exit now.
02381     if (DetachedGeometry)
02382         return CC_OK;
02383 
02384     NodeMouldGroup* pMouldGroup = FindMouldGroup();
02385     if (pMouldGroup==NULL)
02386         return CC_FAIL;
02387 
02388     NodeMoulder* pMoulder = FindFirstMoulder();
02389     while (pMoulder!=NULL)
02390     {
02391         // Find the next moulder object
02392         Node* pNext = FindNext(CC_RUNTIME_CLASS(NodeMoulder));
02393 
02394         // Now build the moulder object 
02395         NodeMoulder* pNewMoulder = AddNewMoulder(pMoulder,NEXT,pUndoOp);
02396         if (!pNewMoulder)
02397             return CC_FAIL;
02398 
02399         CALL_WITH_FAIL(pUndoOp->DoHideNode(pMoulder,TRUE,NULL,FALSE), pUndoOp, ok);
02400         if (!ok)
02401             return CC_FAIL;
02402 
02403         if (!pNewMoulder->CreateMouldedObjects(pMouldGroup, GetGeometry(), pUndoOp)) 
02404             return CC_FAIL;
02405 
02406         pMoulder=(NodeMoulder*)pNext;
02407     }
02408 
02409     // now, inform all parents of a child change
02410     // go to all parents, sending child change messages
02411     Node * pParent = NULL;
02412 
02413     // DMc
02414     // do the child change message
02415     ObjChangeFlags Flags;
02416     ObjChangeParam EditObjChange(OBJCHANGE_FINISHED, Flags, this, pUndoOp, OBJCHANGE_CALLEDBYOP);
02417 
02418     pParent = this->FindParent();
02419 
02420     while (pParent)
02421     {
02422         pParent->OnChildChange(&EditObjChange);
02423 
02424         pParent = pParent->FindParent();
02425     }   
02426 
02427     // Update the selection range
02428     Camelot.UpdateSelection();
02429 
02430 #endif
02431     return CC_OK;
02432 }

void NodeMould::RemovePerspectiveFills Node pParentNode,
UndoableOperation pUndoOp
[static]
 

This function scans the children of a given parent for perspectivised bitmap fills. It replaces these attributes with standard bitmap fill atts in order to avoid perspective bitmap fills from escaping during a make shapes.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/6/95
Parameters:
pParentNode - a pointer to a node to start removing from [INPUTS] pUndoOp - a pointer to the currently active undo operation. can be NULL
Returns:
-

Definition at line 1046 of file nodemold.cpp.

01047 {
01048 //  BOOL WarnedUser = FALSE;
01049 
01050     // Found the NodeMoulder, so scan it's children, looking for perspectivised Attributes
01051     Node* pMoulderChild = pParentNode->FindFirstChild();
01052     Node* pNext;
01053 
01054     while (pMoulderChild != NULL)
01055     {
01056         Node* pThisChild = pMoulderChild;
01057         pMoulderChild = pMoulderChild->FindNext();
01058 
01059         // Scan the nodes children for Perspective fills
01060         Node* pChild = pThisChild->FindFirstDepthFirst();
01061         while (pChild)
01062         {
01063             pNext = pChild->FindNextDepthFirst(pThisChild);
01064 
01065             if (pChild->IsAnAttribute() && ((NodeAttribute*)pChild)->IsAFillAttr())
01066             {
01067                 if (((AttrFillGeometry*)pChild)->IsPerspective())
01068                 {
01069                     // Remove any perspectiven
01070                     ((AttrFillGeometry*)pChild)->RemovePerspective(pUndoOp);
01071                 }
01072             }
01073             pChild=pNext;
01074         }
01075     }
01076 }

void NodeMould::RenderObjectBlobs RenderRegion pRegion  )  [virtual]
 

This renders all the blobs associated with this mould node This node doesn't do any rendering itself. All it does is ask the shape object to render itself.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/94
Parameters:
pRender - The region to draw the blobs in [INPUTS]

Reimplemented from NodeGroup.

Definition at line 1122 of file nodemold.cpp.

01123 {
01124 #if !defined(EXCLUDE_FROM_RALPH)
01125     // We need to ask the mould shape to render its edit blobs.
01126     if (!RenderBlobs)
01127         return;
01128 
01129     if (pMouldGeometry)
01130         pMouldGeometry->RenderControlBlobs(pRegion);
01131 
01132     // We also need to ask the mould manifold to render its blobs too.
01133     NodeMouldPath* pShape = GetPathShape();
01134     if (pShape)
01135         pShape->RenderObjectBlobs(pRegion);
01136 #endif
01137 }

void NodeMould::RenderTinyBlobs RenderRegion pRegion  )  [virtual]
 

Draws the paths Tiny blob into the render region supplied.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/6/95
Parameters:
pRender - The region to render the blobs into [INPUTS]

Reimplemented from NodeGroup.

Definition at line 1152 of file nodemold.cpp.

01153 {
01154 #if !defined(EXCLUDE_FROM_RALPH)
01155     NodeMoulder* pMoulder = FindFirstMoulder();
01156     if (pMoulder!=NULL)
01157     {
01158         Node* pNode = pMoulder->FindLastChild();
01159         while (pNode != NULL && !pNode->IsAnObject())
01160         {
01161             // pNode was not a ink object, so get the next one
01162             pNode = pNode->FindPrevious();
01163         }
01164 
01165         if (pNode)
01166         {
01167             // Render the tiny blob of that object
01168             ((NodeRenderableInk*)pNode)->RenderTinyBlobs(pRegion);
01169         }
01170     }
01171 #endif
01172 }

BOOL NodeMould::SetGeometry MouldGeometry pGeometry  ) 
 

Not to be used.

BOOL NodeMould::SetGeometry(MouldGeometry* pGeometry)

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

Definition at line 393 of file nodemold.cpp.

00394 {
00395     ERROR2IF(pGeometry==NULL, FALSE, "Null pointer passed to NodeMould::SetGeometry()");
00396     pMouldGeometry=pGeometry;
00397     return TRUE;        
00398 }

Node * NodeMould::SimpleCopy void   )  [virtual]
 

This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A copy of the node, or NULL if memory has run out

Errors: If memory runs out when trying to copy, then ERROR is called with an out of memory error and the function returns NULL.

Reimplemented from NodeGroup.

Definition at line 447 of file nodemold.cpp.

00448 {
00449     NodeMould* pCopyOfNode = new NodeMould();
00450     ERROR2IF(pCopyOfNode == NULL,NULL,_R(IDE_NOMORE_MEMORY)); 
00451     CopyNodeContents(pCopyOfNode);
00452     return (pCopyOfNode);
00453 }   

ChangeCode NodeMould::StartSaveContext UndoableOperation pUndoOp,
INT32  rectype
 

Tries to save the current state of the mould shape on the undo. If you want to edit the mould in any way you should use this function to record various parts of the mould before going ahead and changing any data. The corresponding EndSaveContext should be called after you have altered any data.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/01/95
Parameters:
pUndoOp = pointer to an active undoable operation [INPUTS]
Returns:
CC_OK if we have successfully saved the mould context CC_FAIL if we have failed to save the context. We've possible run out of memory

Definition at line 2123 of file nodemold.cpp.

02124 {
02125     ChangeCode Chge=CC_OK;
02126 
02127 #if !defined(EXCLUDE_FROM_RALPH)
02128     if (pUndoOp!=NULL)
02129     {
02130         // create an action to rebuild the mould
02131 //      if ((rectype & REC_REBUILD) && (Chge==CC_OK))
02132 //      {
02133 //          Chge = ConvertCode(StartRebuildMouldAction::DoRecord(pUndoOp, this));
02134 //      }
02135 
02136         // record the current path data, ie its flags,verbs & coords
02137         if ((rectype & REC_PATHARRAYS) && (Chge==CC_OK))
02138         {
02139             NodeMouldPath* pMouldPath=GetPathShape();
02140             if (pMouldPath)
02141             {
02142                 Path* pEditPath = &(pMouldPath->InkPath);
02143                 Chge = ConvertCode(SavePathArraysAction::DoRecord(pUndoOp, pUndoOp->GetUndoActionList(), pEditPath));
02144             }
02145         }
02146         
02147         // record the current blob positions
02148         if ((rectype & REC_BLOBS) && (Chge==CC_OK)) 
02149         {
02150             Spread* pSpread = FindParentSpread();
02151             if (pMouldGeometry!=NULL)
02152                 Chge=pMouldGeometry->RecordBlobs(pUndoOp, pSpread);
02153         }
02154 
02155         if ((rectype & REC_GEOMETRY) && (Chge==CC_OK))
02156         {
02157             // record the entire geometry object on the undo
02158             Chge = ConvertCode(RecordGeometryAction::DoRecord(pUndoOp,this));
02159         }
02160 
02161         // record the mould geometry context on the undo.
02162         if ((rectype & REC_GEOMCONTEXT) && (Chge==CC_OK))
02163         {
02164             if (pMouldGeometry!=NULL)
02165                 Chge=pMouldGeometry->RecordContext(pUndoOp);
02166         }
02167     }
02168 #endif
02169     return Chge;
02170 }

void NodeMould::ToggleDetachFlag  ) 
 

Switch the logical value of the detached mould flag inside this mould object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/3/95
Parameters:
- [INPUTS]
Returns:
-

Definition at line 1997 of file nodemold.cpp.

01998 {
01999     DetachedGeometry = !DetachedGeometry;
02000 }

void NodeMould::Transform TransformBase Trans  )  [virtual]
 

Transforms the mould object and all its children.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/12/94
Parameters:
Trans - A transformation object [INPUTS]

Reimplemented from NodeGroup.

Definition at line 1270 of file nodemold.cpp.

01271 {
01272     // Transform all the children
01273     // See GroupCanTransformCached
01274     NodeGroup::Transform(Trans);
01275 
01276     // once transformed get the shape controller to transform its stuff
01277     if (pMouldGeometry)
01278     {
01279         Path* pPath = GetPath();
01280         NodeMouldGroup* pMouldGroup = FindMouldGroup();
01281         if (pPath && pMouldGroup)
01282         {
01283             DocRect Rect = pMouldGroup->GetChildrensBounds(TRUE);
01284             pMouldGeometry->Transform(pPath, &Rect, Trans);
01285         }
01286     }
01287 }

DocRect NodeMould::ValidateExtend const ExtendParams ExtParams  )  [virtual]
 

NodeMould uses Node's base-class implementation, as we don't want to inherit NodeGroup's extend behaviour - see Node::ValidateExtend() for details. See also: Node::ValidateExtend().

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/26/00

Reimplemented from Node.

Definition at line 2761 of file nodemold.cpp.

02762 {
02763     return Node::ValidateExtend(ExtParams);
02764 }

BOOL NodeMould::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from NodeGroup.

Definition at line 2739 of file nodemold.cpp.

02740 {
02741 #ifdef DO_EXPORT
02742     return WritePreChildrenWeb(pFilter);
02743 #else
02744     return FALSE;
02745 #endif
02746 }

BOOL NodeMould::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes out a records associated with this node.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/7/96
Parameters:
pFilter = ptr to the filter to write to [INPUTS]
Returns:
TRUE is a record has been written, FALSE otherwise
It either writes out an envelope or perspective record, depending on the geometry.

The only piece of data that needs to be saved out with a node mould is the error threshold.

Reimplemented from NodeGroup.

Definition at line 2699 of file nodemold.cpp.

02700 {
02701 #ifdef DO_EXPORT
02702     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
02703     ERROR2IF(pMouldGeometry == NULL,FALSE,"No mould geometry");
02704 
02705     UINT32 Tag  = TAG_UNDEFINED;
02706     UINT32 Size = 0;
02707 
02708     switch (NodeMould::DescribeGeometry())
02709     {
02710         case MOULDSPACE_ENVELOPE:       Tag = TAG_MOULD_ENVELOPE;    Size = TAG_MOULD_ENVELOPE_SIZE;    break;
02711         case MOULDSPACE_PERSPECTIVE:    Tag = TAG_MOULD_PERSPECTIVE; Size = TAG_MOULD_PERSPECTIVE_SIZE; break;
02712 
02713         default:
02714             ERROR3("Unkown mould space type");
02715             pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
02716             return FALSE;
02717     }
02718 
02719     INT32 Threshold = pMouldGeometry->GetThreshold();
02720 
02721     CXaraFileRecord Rec(Tag,Size);
02722 
02723     BOOL ok = Rec.Init();
02724 
02725     if (ok) ok = Rec.WriteINT32(Threshold);
02726     if (ok) ok = pFilter->Write(&Rec);
02727 
02728     if (!ok)
02729         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
02730 
02731     return ok;
02732 #else
02733     return FALSE;
02734 #endif
02735 }


Friends And Related Function Documentation

friend class RecordChangeCodesAction [friend]
 

Definition at line 163 of file nodemold.h.


Member Data Documentation

BOOL NodeMould::DetachedGeometry [private]
 

Definition at line 302 of file nodemold.h.

String_32 NodeMould::MouldName [private]
 

Definition at line 299 of file nodemold.h.

INT32 NodeMould::OnCC_CRC [private]
 

Definition at line 306 of file nodemold.h.

INT32 NodeMould::OnCC_Height [private]
 

Definition at line 308 of file nodemold.h.

INT32 NodeMould::OnCC_Width [private]
 

Definition at line 307 of file nodemold.h.

MouldGeometry* NodeMould::pMouldGeometry [private]
 

Definition at line 301 of file nodemold.h.

BOOL NodeMould::RenderBlobs [private]
 

Definition at line 309 of file nodemold.h.


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