#include <ndmldpth.h>
Inheritance diagram for NodeMouldPath:
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 Node * | SimpleCopy () |
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. |
Definition at line 117 of file ndmldpth.h.
|
This constructor creates a NodeMouldPath linked to no other, with all status flags false and an uninitialised bounding rectangle.
Definition at line 140 of file ndmldpth.cpp. 00140 : NodePath() 00141 { 00142 }
|
|
Destructor for Node MouldPath. This does nothing at present.
Definition at line 209 of file ndmldpth.cpp.
|
|
This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.
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 ?
Definition at line 189 of file ndmldpth.cpp. 00195 :NodePath(ContextNode, Direction, Locked, Mangled, Marked, Selected) 00196 { 00197 }
|
|
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().
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 }
|
|
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.
Definition at line 249 of file ndmldpth.cpp. 00250 { 00251 NodePath::CopyNodeContents( NodeCopy ); 00252 //Copy contents specific to derived class here 00253 }
|
|
Overrides the standard call to Obj->Render so we can render the path as we would like. BOOL NodeMouldPath::ExportAWEPS(RenderRegion* pRegion)
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 }
|
|
Export delimiter tokens for this particular object. The format is defined as csmp path description cemp. BOOL NodeMouldPath::ExportCAMEPS(RenderRegion* pRegion)
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 }
|
|
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.
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 }
|
|
Returns a completely 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 }
|
|
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.
Reimplemented from Node. Definition at line 141 of file ndmldpth.h. 00141 { return COMPLEXCOPY; };
|
|
Determins whether the immediate parent of this node mould path object 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 }
|
|
Polymorphically copies the contents of this node to another.
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 }
|
|
Overrides inherited function to do nothing.
Reimplemented from NodePath. Definition at line 291 of file ndmldpth.cpp. 00292 { 00293 if (!InsideMould()) 00294 NodePath::Render(pRender); 00295 }
|
|
Overrides inherited function to do nothing.
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 }
|
|
Draws the paths object blobs into the render region supplied.
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 }
|
|
Makes a copy of all the data in the 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 }
|
|
Writes the path record to the filter. > virtual BOOL NodePath::WritePreChildrenNative(BaseCamelotFilter* pFilter)
Reimplemented from NodePath. Definition at line 612 of file ndmldpth.cpp. 00613 { 00614 return WritePreChildrenWeb(pFilter); 00615 }
|
|
Writes the mould path record to the filter. > virtual BOOL NodeMouldPath::WritePreChildrenWeb(BaseCamelotFilter* pFilter)
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 }
|