NodeMouldPath Class Reference

defines the structure of a node mould path object. This object exists only as a child of a mould object, controlling the editing of the mould manifold More...

#include <ndmldpth.h>

Inheritance diagram for NodeMouldPath:

NodePath NodeRenderableInk NodeRenderableBounded NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 NodeMouldPath ()
 This constructor creates a NodeMouldPath linked to no other, with all status flags false and an uninitialised bounding rectangle.
 ~NodeMouldPath ()
 Destructor for Node MouldPath. This does nothing at present.
 NodeMouldPath (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.
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 NodeSimpleCopy ()
 Makes a copy of all the data in the node.
virtual void Render (RenderRegion *pRender)
 Overrides inherited function to do nothing.
virtual void RenderEorDrag (RenderRegion *)
 Overrides inherited function to do nothing.
virtual void RenderObjectBlobs (RenderRegion *pRender)
 Draws the paths object blobs into the render region supplied.
virtual DocRect GetBoundingRect (BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE)
 Returns a completely null rectangle.
virtual CopyType GetCopyType ()
 This function returns a type describing how this object is to be copied. The fuction is called from the low level copy operation CopyObjects. There are two options at present, these being SIMPLECOPY and COMPLEXCOPY. SIMPLECOPY indicates that the node can be copied by a call to its virtual function SimpleCopy() followed by a deep copy of all its children. COMPLEXCOPY however indicates that the node needs to do its own thing when copying and must be called via the ComplexCopy() virtual function. This virtual will likely return a tree of copied objects rather than just a copy of itself.
virtual INT32 ComplexCopy (CopyStage Stage, Range &RangeToCopy, Node **pOutput)
 If the copystage is COPYOBJECT, The node has been called to copy itself and do what ever it needs to to make a sensible copy of other items such as attributes. The caller (CopyObjects) will not deep copy this node (as this is a complex copy and it expects the handler to know what its doing). In this case the NodeMouldPath object needs to turn itself into a node path. SeeAlso Node::ComplexCopy(), CopyObjects().
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the mould path record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
 Writes the path record to the filter.

Protected Member Functions

void CopyNodeContents (NodeMouldPath *NodeCopy)
 Copies the data in the node by first calling the base class to get it to copy its stuff, and then copying its own stuff Scope: protected.

Private Member Functions

BOOL InsideMould ()
 Determins whether the immediate parent of this node mould path object is a mould object.
BOOL ExportCAMEPS (RenderRegion *pRegion)
 Export delimiter tokens for this particular object. The format is defined as csmp path description cemp.
BOOL ExportAWEPS (RenderRegion *pRegion)
 Overrides the standard call to Obj->Render so we can render the path as we would like.

Detailed Description

defines the structure of a node mould path object. This object exists only as a child of a mould object, controlling the editing of the mould manifold

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
See also:
Mould (the parent object)

Definition at line 117 of file ndmldpth.h.


Constructor & Destructor Documentation

NodeMouldPath::NodeMouldPath  ) 
 

This constructor creates a NodeMouldPath linked to no other, with all status flags false and an uninitialised bounding rectangle.

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

Definition at line 140 of file ndmldpth.cpp.

00140                             : NodePath()
00141 {
00142 }

NodeMouldPath::~NodeMouldPath  ) 
 

Destructor for Node MouldPath. This does nothing at present.

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

Definition at line 209 of file ndmldpth.cpp.

00210 {
00211 }

NodeMouldPath::NodeMouldPath 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:
16/01/95
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 189 of file ndmldpth.cpp.

00195                 :NodePath(ContextNode, Direction, Locked, Mangled, Marked, Selected) 
00196 { 
00197 } 


Member Function Documentation

INT32 NodeMouldPath::ComplexCopy CopyStage  Stage,
Range RangeToCopy,
Node **  pOutput
[virtual]
 

If the copystage is COPYOBJECT, The node has been called to copy itself and do what ever it needs to to make a sensible copy of other items such as attributes. The caller (CopyObjects) will not deep copy this node (as this is a complex copy and it expects the handler to know what its doing). In this case the NodeMouldPath object needs to turn itself into a node path. SeeAlso Node::ComplexCopy(), CopyObjects().

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/5/95
Parameters:
Stage - COPYOBJECT if we should make a copy [INPUTS]
  • COPYFINISHED once the entire copy operation has completed RangeToCopy - Describes the range which is currently being copied. pOutput - a pointer to a pointer to a node. Set this pointer to point at the tree copy
Returns:
-1 = The routine failed to make a copy. 0 = No copy has been made. +1 = pOutput points to the copy.

Reimplemented from Node.

Definition at line 538 of file ndmldpth.cpp.

00539 {
00540     ERROR2IF(pOutput==NULL,FALSE,"NodeMouldPath::ComplexCopy() called with NULL output pointer!");
00541 
00542     switch (Stage)
00543     {
00544         case COPYOBJECT:
00545         {   
00546             // we've been asked to make a copy of ourselves
00547             NodePath* NodeCopy = new NodePath;
00548             BOOL ok = (NodeCopy!=NULL);
00549             if (ok)
00550             {
00551                 NodePath::CopyNodeContents(NodeCopy);
00552                 // Copy contents specific to derived class here
00553                 NodeCopy->InkPath.IsFilled = TRUE;
00554             }
00555 
00556             if (ok)
00557             {
00558                 (*pOutput) = NodeCopy;
00559                 return 1;
00560             }
00561             else
00562                 return -1;
00563             }
00564             break;
00565 
00566         case COPYFINISHED:
00567             return 0;
00568             break;
00569 
00570         default:
00571             return -1;
00572             break;
00573     }
00574 }

void NodeMouldPath::CopyNodeContents NodeMouldPath NodeCopy  )  [protected]
 

Copies the data in the node 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:
17/5/95
Parameters:
NodeCopy - The node to copy [INPUTS]
See also:
NodeRenderableInk::CopyNodeContents

Definition at line 249 of file ndmldpth.cpp.

00250 {
00251     NodePath::CopyNodeContents( NodeCopy );
00252     //Copy contents specific to derived class here
00253 }

BOOL NodeMouldPath::ExportAWEPS RenderRegion pRegion  )  [private]
 

Overrides the standard call to Obj->Render so we can render the path as we would like.

BOOL NodeMouldPath::ExportAWEPS(RenderRegion* pRegion)

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/03/95
Parameters:
pRegion = a pointer to a Camelot EPS render region [INPUTS]
Returns:
TRUE if we've rendered the object FALSE if we want the caller to render the object

Definition at line 506 of file ndmldpth.cpp.

00507 {
00508     // just return false for the moment until we write our
00509     // proper random AWEPS path render function
00510     return FALSE;
00511 }

BOOL NodeMouldPath::ExportCAMEPS RenderRegion pRegion  )  [private]
 

Export delimiter tokens for this particular object. The format is defined as csmp path description cemp.

BOOL NodeMouldPath::ExportCAMEPS(RenderRegion* pRegion)

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/03/95
Parameters:
pRegion = a pointer to a Camelot EPS render region [INPUTS]
Returns:
TRUE if we've rendered the object FALSE if we want the caller to render the object

Definition at line 464 of file ndmldpth.cpp.

00465 {
00466 #ifdef DO_EXPORT
00467     EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
00468 
00469     // If we're hanging around in a mould then export the correct tokens
00470     if (!InsideMould())
00471     {
00472         NodePath::Render(pRegion);
00473     }
00474     else
00475     {
00476         pDC->OutputToken(_T("csmp"));           // Camelot "start mould path" token
00477         pDC->OutputNewLine();
00478 
00479         // Call the parent class
00480         NodePath::Render(pRegion);
00481 
00482         pDC->OutputToken(_T("cemp"));           // Camelot "start mould path" token
00483         pDC->OutputNewLine();
00484     }
00485 #endif
00486     return TRUE;
00487 }

BOOL NodeMouldPath::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 NodeRenderableInk.

Definition at line 434 of file ndmldpth.cpp.

00435 {
00436 #ifdef DO_EXPORT
00437     if (pRegion->IS_KIND_OF(NativeRenderRegion))
00438         return ExportCAMEPS(pRegion);
00439 
00440     if (pRegion->IS_KIND_OF(ArtWorksEPSRenderRegion))
00441         return ExportAWEPS(pRegion);
00442 #endif  
00443     return FALSE;
00444 }

DocRect NodeMouldPath::GetBoundingRect BOOL  DontUseAttrs = FALSE,
BOOL  HitTest = FALSE
[virtual]
 

Returns a completely null rectangle.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/01/95
Parameters:
DontUseAttrs - TRUE if you don't want to use the nodes attrs to calculate [INPUTS] the bounding rect (defaults will be used). Defaults to FALSE. HitTest - TRUE if being called during HitTest
Returns:
A null rectangle

Reimplemented from NodePath.

Definition at line 365 of file ndmldpth.cpp.

00366 {
00367     /* Tricky problems:
00368        (1) When importing, the importer translates the imported picture to centre around
00369            the drop point. Unfortunately it calls us to find our bbox. We don't have a
00370            bbox until the moulder nodes are built, which is not until PostImport time so
00371            the importer does a Translate = (Drop - Center) which is X = (0 - C), BAD.
00372            So we must return a bbox if their is no moulder in the mould! Nasty Showstopper fix  */
00373     
00374     if (InsideMould())
00375     {
00376         // if there is a moulder node to contribute a bbox
00377         if (FindNext(CC_RUNTIME_CLASS(NodeMoulder)))
00378         {
00379             // Then we dont contribute anything!
00380             DocRect Rect;
00381             return Rect;
00382         }
00383     }
00384     // Otherwise we do.
00385     return NodePath::GetBoundingRect(DontUseAttrs);
00386 }

virtual CopyType NodeMouldPath::GetCopyType  )  [inline, virtual]
 

This function returns a type describing how this object is to be copied. The fuction is called from the low level copy operation CopyObjects. There are two options at present, these being SIMPLECOPY and COMPLEXCOPY. SIMPLECOPY indicates that the node can be copied by a call to its virtual function SimpleCopy() followed by a deep copy of all its children. COMPLEXCOPY however indicates that the node needs to do its own thing when copying and must be called via the ComplexCopy() virtual function. This virtual will likely return a tree of copied objects rather than just a copy of itself.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/5/95
Parameters:
- [INPUTS]
Returns:
A copy type describing how to copy this object

Reimplemented from Node.

Definition at line 141 of file ndmldpth.h.

00141 { return COMPLEXCOPY; };

BOOL NodeMouldPath::InsideMould  )  [private]
 

Determins whether the immediate parent of this node mould path object is a mould object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/02/95
Parameters:
- [INPUTS]
Returns:
TRUE if this mould path is inside a mould object ie its immediate parent is a mould object

Definition at line 403 of file ndmldpth.cpp.

00404 {
00405     Node* p = FindParent();
00406     if (p)
00407     {
00408         if (IS_A(p, NodeMould))
00409             return TRUE;
00410         if (IS_A(p, NodeHidden))
00411             return TRUE;
00412     }
00413     return FALSE;
00414 }

void NodeMouldPath::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 NodePath.

Definition at line 269 of file ndmldpth.cpp.

00270 {
00271     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00272     ENSURE(IS_A(pNodeCopy, NodeMouldPath), "PolyCopyNodeContents given wrong dest node type");
00273 
00274     if (IS_A(pNodeCopy, NodeMouldPath))
00275         CopyNodeContents((NodeMouldPath*)pNodeCopy);
00276 }

void NodeMouldPath::Render RenderRegion pRender  )  [virtual]
 

Overrides inherited function to do nothing.

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

Reimplemented from NodePath.

Definition at line 291 of file ndmldpth.cpp.

00292 {            
00293     if (!InsideMould())
00294         NodePath::Render(pRender);
00295 }  

void NodeMouldPath::RenderEorDrag RenderRegion pRender  )  [virtual]
 

Overrides inherited function to do nothing.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Parameters:
pRender - A Pointer to the current RenderRegion [INPUTS]

Reimplemented from NodePath.

Definition at line 309 of file ndmldpth.cpp.

00310 {
00311 #if !defined(EXCLUDE_FROM_RALPH)
00312     //if (!InsideMould())
00313     BlobManager* pBlobMan = GetApplication()->GetBlobManager();
00314     BlobStyle CurrBlobs = pBlobMan->GetCurrentInterest();
00315     if (CurrBlobs.Object)
00316         NodePath::RenderEorDrag(pRender);
00317 #endif
00318 }

void NodeMouldPath::RenderObjectBlobs RenderRegion pRender  )  [virtual]
 

Draws the paths object blobs into the render region supplied.

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

Reimplemented from NodePath.

Definition at line 332 of file ndmldpth.cpp.

00333 {
00334 #if !defined(EXCLUDE_FROM_RALPH)
00335     if (!InsideMould())
00336         NodePath::RenderObjectBlobs(pRender);
00337     else
00338     {
00339         // set our eor colour.
00340         pRender->SetLineColour(BLACK);
00341         // render the path
00342         pRender->DrawPath(&InkPath);
00343         // call the parent class render function
00344         NodePath::RenderObjectBlobs(pRender);
00345     }
00346 #endif
00347 }

Node * NodeMouldPath::SimpleCopy void   )  [virtual]
 

Makes a copy of all the data in the node.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Returns:
Pointer to a Node

Reimplemented from NodePath.

Definition at line 225 of file ndmldpth.cpp.

00226 {
00227     NodeMouldPath* NodeCopy = new NodeMouldPath();
00228     if (NodeCopy)
00229         CopyNodeContents(NodeCopy);
00230     
00231     return NodeCopy;
00232 }            

BOOL NodeMouldPath::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Writes the path record to the filter.

> virtual BOOL NodePath::WritePreChildrenNative(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/5/96
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
-

Reimplemented from NodePath.

Definition at line 612 of file ndmldpth.cpp.

00613 {
00614     return WritePreChildrenWeb(pFilter);
00615 }

BOOL NodeMouldPath::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the mould path record to the filter.

> virtual BOOL NodeMouldPath::WritePreChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/7/96
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
-

Reimplemented from NodePath.

Definition at line 589 of file ndmldpth.cpp.

00590 {
00591     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
00592 
00593     INT32 NumCoords = InkPath.GetNumCoords();
00594     INT32 RecordSize = sizeof(INT32)+(sizeof(PathVerb)*NumCoords)+(sizeof(DocCoord)*NumCoords);
00595 
00596     CamelotFileRecord Rec(pFilter,TAG_MOULD_PATH,RecordSize);
00597 
00598     BOOL ok = Rec.Init();
00599 
00600     if (ok) ok = Rec.WritePath(&InkPath);
00601     if (ok) ok = pFilter->Write(&Rec);
00602 
00603     if (!ok)
00604         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
00605 
00606     return ok;
00607 }


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