#include <npaper.h>
Inheritance diagram for NodeRenderablePaper:
Public Member Functions | |
NodeRenderablePaper () | |
This constructor creates a NodeRenderablePaper linked to no other with all status flags false and uninitialised bounding and pasteboard rectangles. | |
NodeRenderablePaper (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 SubtreeRenderState | RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE) |
Indicate that we don't want to render paper objects in the ink loop. | |
virtual BOOL | NeedsToExport (RenderRegion *pRender, BOOL VisibleLayersOnly=FALSE, BOOL CheckSelected=FALSE) |
Indicate that we don't want to export this class of nodes. | |
BOOL | IsPaper () const |
Indicate that we ARE paper! (Overrides virtual func in Node.). | |
virtual DocRect | GetPasteboardRect (BOOL Pixelise=TRUE, View *pView=NULL) const |
For obtaining the objects pasteboard rectangle. | |
virtual void | GetDebugDetails (StringBase *Str) |
For obtaining debug information about the Node. | |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
Protected Member Functions | |
virtual Node * | SimpleCopy () |
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. | |
void | CopyNodeContents (NodeRenderablePaper *NodeCopy) |
This method copies the node's contents to the node pointed to by NodeCopy. | |
virtual void | ChangePasteboardRect (const DocRect &PasteRect) |
To change the pasteboard rectangle of this node, and then if necessary recursively change the pasteboard rectangles of all its parents. | |
virtual void | SetInitialPasteboardRect (const DocRect &PasteRect) |
To set the initial pasteboard rectangle of this node, and then change the pasteboard rectangles of all its parents. | |
Protected Attributes | |
DocRect | PasteboardRect |
Definition at line 125 of file npaper.h.
|
This constructor creates a NodeRenderablePaper linked to no other with all status flags false and uninitialised bounding and pasteboard rectangles.
Definition at line 133 of file npaper.cpp. 00133 : NodeRenderableBounded() 00134 { 00135 }
|
|
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 183 of file npaper.cpp. 00189 :NodeRenderableBounded(ContextNode, Direction, Locked, Mangled, Marked, 00190 Selected) 00191 { 00192 }
|
|
To change the pasteboard rectangle of this node, and then if necessary recursively change the pasteboard rectangles of all its parents.
Definition at line 368 of file npaper.cpp. 00369 { 00370 // Check if the pasteboard rectangle should be changed 00371 if (PasteboardRect != PasteRect) 00372 { 00373 PasteboardRect = PasteRect; // Set the pasteboard rectangle 00374 00375 // If the node has a parent then we will need to change its 00376 // Pasteboard rectangle 00377 if (Parent != NULL) 00378 { 00379 // CombinedSiblingPasteboardRectangle will be the smallest rectangle which 00380 // surrounds all sibling pasteboard rectangles. 00381 DocRect CombinedSiblingPasteboardRectangle; 00382 00383 // Take the union of this nodes Pasteboard rectangle with all its siblings 00384 // pasteboard rectangles. 00385 Node* CurrentNode = this->FindParent()->FindFirstChild(); 00386 while (CurrentNode != NULL) 00387 { 00388 if (CurrentNode->IsKindOf(CC_RUNTIME_CLASS(NodeRenderablePaper))) 00389 { 00390 CombinedSiblingPasteboardRectangle = CombinedSiblingPasteboardRectangle.Union( 00391 ( ((NodeRenderablePaper*)CurrentNode)->GetPasteboardRect(FALSE)) ); 00392 } 00393 CurrentNode = CurrentNode->FindNext(); 00394 } 00395 00396 // The parent of a paper object should always be a paper object 00397 ENSURE(Parent->IsKindOf(CC_RUNTIME_CLASS(NodeRenderablePaper)), 00398 "The parent of a paper object was not a paper object"); 00399 00400 // Call the routine recursively to set the parents pasteboard rectangle 00401 ((NodeRenderablePaper*)Parent)->ChangePasteboardRect( 00402 CombinedSiblingPasteboardRectangle); 00403 } 00404 else 00405 { 00406 // The root of the tree should be a NodeDocument 00407 ENSURE(this->IsKindOf(CC_RUNTIME_CLASS(NodeDocument)), 00408 "When trying to set the document extents no\nNodeDocument node was found at the root of the tree"); 00409 // Set the document extents 00410 ((NodeDocument*)this)->SetExtents(); 00411 } 00412 } 00413 }
|
|
This method copies the node's contents to the node pointed to by NodeCopy.
Definition at line 311 of file npaper.cpp. 00312 { 00313 ENSURE(NodeCopy != NULL,"Trying to copy a node's contents into a NULL node"); 00314 NodeRenderableBounded::CopyNodeContents(NodeCopy); 00315 NodeCopy->PasteboardRect = PasteboardRect; 00316 }
|
|
For obtaining debug information about the Node.
Reimplemented from NodeRenderableBounded. Reimplemented in Chapter, NodeGrid, NodeGridRect, NodeGridIso, Layer, NodeDocument, Page, and Spread. Definition at line 541 of file npaper.cpp. 00542 { 00543 #ifdef _DEBUG 00544 NodeRenderableBounded::GetDebugDetails(Str); 00545 00546 String_256 TempStr; 00547 if (!PasteboardRect.IsValid()) 00548 { 00549 TempStr = TEXT("\r\nPasteboard Rectangle = *INVALID*\r\n"); 00550 } 00551 else 00552 TempStr._MakeMsg(TEXT("\r\nPasteboard Rectangle\r\n Low(#1%ld, #2%ld)\r\n High(#3%ld, #4%ld)\r\n"), 00553 PasteboardRect.LowCorner().x, 00554 PasteboardRect.LowCorner().y, 00555 PasteboardRect.HighCorner().x, 00556 PasteboardRect.HighCorner().y); 00557 00558 (*Str)+=TempStr; 00559 #endif 00560 }
|
|
For obtaining the objects pasteboard rectangle.
Reimplemented in Layer. Definition at line 497 of file npaper.cpp. 00498 { 00499 DocRect temp = PasteboardRect; 00500 00501 if (Pixelise) 00502 { 00503 // "Pixelise" the position of the spread. 00504 // Effectively, this ensures that the spread will be aligned to a whole pixel boundary 00505 // and allows both GDraw and GDI to consistently plot the same pixels when rendering 00506 // the same primitive 00507 if (pView != NULL) 00508 { 00509 temp.lo.Pixelise(pView); 00510 temp.hi.Pixelise(pView); 00511 } 00512 else 00513 { 00514 temp.lo.Pixelise(); 00515 temp.hi.Pixelise(); 00516 } 00517 } 00518 00519 return (temp); 00520 00521 // return (PasteboardRect); 00522 }
|
|
Indicate that we ARE paper! (Overrides virtual func in Node.).
Reimplemented from Node. Definition at line 231 of file npaper.cpp. 00232 { 00233 return TRUE; 00234 }
|
|
Indicate that we don't want to export this class of nodes.
Reimplemented from NodeRenderable. Reimplemented in Layer, and Spread. Definition at line 257 of file npaper.cpp. 00258 { 00259 return FALSE; 00260 }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderableBounded. Reimplemented in Chapter, NodeGrid, NodeGridRect, NodeGridIso, Layer, NodeDocument, Page, and Spread. Definition at line 331 of file npaper.cpp. 00332 { 00333 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 00334 ENSURE(IS_A(pNodeCopy, NodeRenderablePaper), "PolyCopyNodeContents given wrong dest node type"); 00335 00336 if (IS_A(pNodeCopy, NodeRenderablePaper)) 00337 CopyNodeContents((NodeRenderablePaper*)pNodeCopy); 00338 }
|
|
Indicate that we don't want to render paper objects in the ink loop.
Reimplemented from NodeRenderableBounded. Reimplemented in NodeGrid, Layer, and Spread. Definition at line 208 of file npaper.cpp. 00209 { 00210 if (pRender && pRender->RenderPaperAsInk()) 00211 return SUBTREE_ROOTANDCHILDREN; 00212 00213 return SUBTREE_NORENDER; 00214 }
|
|
To set the initial pasteboard rectangle of this node, and then change the pasteboard rectangles of all its parents.
Reimplemented in Spread. Definition at line 442 of file npaper.cpp. 00443 { 00444 // Check if the pasteboard rectangle should be changed 00445 if (PasteboardRect != PasteRect) 00446 { 00447 PasteboardRect = PasteRect; // Set the pasteboard rectangle 00448 00449 // If the node has a parent then we will need to change its 00450 // Pasteboard rectangle 00451 if (Parent != NULL) 00452 { 00453 // The parent of a paper object should always be a paper object 00454 ENSURE(Parent->IsKindOf(CC_RUNTIME_CLASS(NodeRenderablePaper)), 00455 "The parent of a paper object was not a paper object!"); 00456 00457 // Union the parents pasteboard rectangle with this nodes pasteboard 00458 // rectangle to obtain the parents new pasteboard rectangle. 00459 DocRect NewParentPasteboardRectangle = 00460 ((NodeRenderablePaper*)Parent)->GetPasteboardRect(FALSE); 00461 NewParentPasteboardRectangle = NewParentPasteboardRectangle.Union(PasteRect); 00462 00463 // Call the routine recursively to set the parent's pasteboard rectangle 00464 ((NodeRenderablePaper*)Parent)->SetInitialPasteboardRect 00465 (NewParentPasteboardRectangle); 00466 } 00467 else 00468 { 00469 // The root of the tree should be a NodeDocument 00470 ENSURE(this->IsKindOf(CC_RUNTIME_CLASS(NodeDocument)), 00471 "The root of the document tree was not a NodeDocument node"); 00472 // Set the document extents 00473 ((NodeDocument*)this)->SetExtents(); 00474 } 00475 } 00476 }
|
|
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.
Reimplemented from NodeRenderableBounded. Reimplemented in Chapter, NodeGrid, NodeGridRect, NodeGridIso, Layer, NodeDocument, Page, and Spread. Definition at line 282 of file npaper.cpp. 00283 { 00284 NodeRenderablePaper* NodeCopy; 00285 NodeCopy = new NodeRenderablePaper(); 00286 ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 00287 CopyNodeContents(NodeCopy); 00288 return (NodeCopy); 00289 }
|
|
|