Node Class Reference

This abstract class describes the fundamental type of object which can be linked into a camelot tree. All other objects which are linked into the tree are derived from this class. More...

#include <node.h>

Inheritance diagram for Node:

CCObject SimpleCCObject EndDocument InsertionNode NodeBarProperty NodeHidden NodeRenderable NodeSetProperty NodeSetSentinel StartDocument List of all members.

Public Types

typedef BOOL(Node::* TypeFunc )() const

Public Member Functions

 Node ()
 This constructor creates a node linked to no other with all status flags FALSE. Also updates the Node counter of the current Document.
 Node (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE, BOOL Renderable=FALSE)
 This constructor initialises a node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated. For example if a node is inserted as a FirstChild of ContextNode, and Context node already has children, then the current first child of context node will become the next sibling of the new first child node.
virtual ~Node ()
 Destroys a Node object. The base class updates the node counter of the current document, and ensures that the SelRange doesn't have a cached pointer to 'this' as its 'Last Selected Node'.
virtual void Render (RenderRegion *pRender)
 For rendering a node.
void RenderTreeAtomic (RenderRegion *pRender)
 Renders the tree rooted at this node into the given RenderRegion.
virtual BOOL NeedsToRender (RenderRegion *pRender)
 Decide whether this node needs to be rendered, given the information provided by the parameters. This is a virtual function which defaults to returning FALSE - i.e. the node never needs to be rendered. This function should be overridden for any renderable nodes, so that they use the info provided to determine whether or not they need to be rendered.
virtual void PreExportRender (RenderRegion *pRender)
 Perform any rendering required when exporting to a file, and this node is being 'passed by' during the tree searching. For example, a group node being exported to EPS would output a "start group" token, and then its ExportRender function would output a "end group" token. By default, it does nothing. Nodes wishing to do special export processing should override this function (and ExportRender).
virtual BOOL ExportRender (RenderRegion *pRender)
 Perform special export rendering of an object, if it is different to the way the object would be rendered normally (e.g. graduated fill attributes, and so on). By default, the base class function returns FALSE, so by default all objects will be exported by calling the Render() function unless they override this function.
virtual BOOL NeedsToExport (RenderRegion *pRender, BOOL VisibleLayersOnly=FALSE, BOOL CheckSelected=FALSE)
 To indicate whether a given node needs to be rendered when exporting the document tree to a foreign file format. The base class always returns FALSE; if derived nodes wish to be exported they must override it and return TRUE.
virtual String Describe (BOOL Plural, BOOL Verbose=TRUE)
 To return a description of the Node object in either the singular or the plural. This method is called by the DescribeRange method.
virtual ChangeCode OnChildChange (ObjChangeParam *pParam)
 This function should be overridden in derived object classes. Composite objects can use this function to respond to one of their children undergoing a change. They should return CC_FAIL whenever they are unable to cope with the change.
virtual OpPermissionState GetOpPermission ()
 Use this to access the node's permission flags to find out if the current op is doable to this node.
virtual void SetOpPermission (OpPermissionState NewState, BOOL AndParents=FALSE)
 Use this to set the node's permission flags.
virtual BOOL AllowOp (ObjChangeParam *pParam, BOOL SetOpPermissionState=TRUE, BOOL DoPreTriggerEdit=TRUE)
 This is the way to ask a node if you can do an op to it.
virtual BOOL AllowOp_AccountForCompound (ObjChangeParam *pParam, BOOL SetOpPermissionState=TRUE, BOOL DoPreTriggerEdit=TRUE)
 if this is a compound node, ensures all child nodes have their AllowOp() called.
void CascadeDelete (void)
 This method removes the node from the tree and deletes all its child nodes (including hidden nodes).
virtual SubtreeRenderState RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE)
 Enables Nodes to be able to Do Pre Print time alterations or even take over the control of the current Printing of their children.
virtual void RenderAfterSubtree (RenderRegion *pRender)
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes out a record that represents the node.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL WritePostChildrenWeb (BaseCamelotFilter *pFilter)
 Gives the node a change to write data to the filter after its children have been automatically written out.
virtual BOOL WritePostChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL CanWriteChildrenWeb (BaseCamelotFilter *pFilter)
 If the node does not mind the filter automatically writing out its child nodes, then return TRUE.
virtual BOOL CanWriteChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL WriteBeginChildRecordsWeb (BaseCamelotFilter *pFilter)
 Begin to write out you child records, in the web format.
virtual BOOL WriteBeginChildRecordsNative (BaseCamelotFilter *pFilter)
 Begin to write out you child records, in the native format.
virtual BOOL WriteEndChildRecordsWeb (BaseCamelotFilter *pFilter)
 Finished writing out you child records, in the web format.
virtual BOOL WriteEndChildRecordsNative (BaseCamelotFilter *pFilter)
 Finished writing out you child records, in the native format.
virtual BOOL ReadPostChildrenWeb (BaseCamelotFilter *pFilter)
 This function is called during the importing of the file.
virtual BOOL ReadPostChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL AreYouSafeToRender ()
 This function is used by the progressive rendering system & the new file format to determine whether the node is renderable or not.
BOOL CopyNode (Node *DestinationNode, AttachNodeDirection Direction)
 This method creates a 'deep' copy of the node and then attaches it to the destination node. The Direction input specifies how the node is to be attached to the Destination node. The following before and after diagram illustrates this method.
virtual BOOL NodeCopy (Node **ppNodeCopy)
 This method outputs a 'deep' copy of the node. It is the same as CopyNode except that the copy is not linked into the tree.
virtual BOOL CloneNode (Node **ppNoeCopy, BOOL bLightweight)
 This method outputs a 'deep' copy of the node. It is the same as CopyNode except that the copy is not linked into the tree. Override if yor class can interpret the lightweight flag.
BOOL CopyComplexRange (Range &RangeToCopy)
 Copy the series of nodes described by RangeToCopy and attach them to onto the last child position of this object.
BOOL CopyChildrenTo (Node *DestinationNode, CopyControlFlags CopyFlags=ccALL)
 This function copies the node's children to DestinationNode which should initially have no children.
void MoveNode (Node *DestinationNode, AttachNodeDirection Direction)
 This method moves a node from its existing position in the tree to a new node position specified by Destination. The Direction input specifies how the node is to be attached to the Destination node. The following before and after diagram illustrates this method.
void AttachNode (Node *ContextNode, AttachNodeDirection Direction, BOOL fCheckTransparent=TRUE, BOOL InvalidateChildren=TRUE)
 This method attaches the node to a context node in the direction specified by Direction. All necessary tree links are updated.
void InsertChainSimple (Node *ContextNode, AttachNodeDirection Direction)
 Inserts a chain of nodes at contextnode. A chain is an unconnected set of siblings. This function should be called from the first node (left most) in the chain. It doesn't do anything fancy - in fact, little more than changing a few pointers here and there.
virtual BOOL PostImport ()
 This function is called after a document is imported. Nodes should override this function to do any post-import processing.
virtual BOOL PostDuplicate (UndoableOperation *pOp)
 This function is called after this node has been created via a copy/duplicate type operation. Nodes should override this function to do any post-processing.
UINT32 GetTag () const
 For finding a nodes TAG, which is a unique identifier for each node stored within a document.
virtual UINT32 GetNodeSize () const
 For finding the size of a node, in concrete classes derived from Node.
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.
UINT32 GetSubtreeSize ()
 For finding the size of this subtree.
BOOL IsUnder (Node *pTestNode, BOOL bFirstCall=TRUE) const
 For finding out whether this node is under another node. Where "under" is defined as being before it in rendering order. To find the answer quickly without scanning the entire tree, we will find the common root node of both this and pNode and find out whether the child links from that node lead down to this node first or pTestNode first. (Because if my parent is under the test node then so am I) Do this recursively so that state is held on the stack, not in the tree Clever, huh? There is some strictly unneccessary work done in finding the common ancestor in this implementation but it's the best compromise that is both reasonably fast and completely stateless.
BOOL IsLocked () const
 For finding the status of the nodes locked flag.
BOOL IsMangled () const
 For finding the status of the nodes mangled flag.
BOOL IsMarked () const
 For finding the status of the nodes marked flag.
BOOL IsRenderable () const
 For finding the status of the nodes renderable flag.
BOOL IsParentOfSelected () const
 For finding the status of the nodes SelectedChildren flag Note: When this function returns TRUE it is not guaranteed that there will be selected children - there may be none!
BOOL IsSelected () const
 For finding the status of the nodes selected flag.
BOOL IsChildOfSelected ()
 For finding out whether this node has a selected parent. Note: If a group (node) of a number of objects is selected then only the group node itself has the selected flag set. Any children of this group, i.e. objects in the group would also be deemed selected but would not have the selected bit set. This routine is based on the routine View::IsPrintableNodeSelected and just searches up until it finds a layer. If by then it has found a selected flag then its parent must be selected and hence it is.
virtual BOOL ShouldBeRendered () const
 For determining quickly if the node is an object For finding the status of the node's Compound flag For finding the status of the node's Compound flag Allows you to see if this node is a NodeAttribute or is Hiding a NodeAttribute without having to use the expensive runtime checkingFor finding if a node is a paper node. For finding if a node is a layer node. For finding if a node is a spread node.For finding if a node is a chapter node.Determine if a node is *derived* from the NodeRenderable class. NB. This has nothing to do with the node's renderable flag! Work out if the node should be rendered - basically all nodes except NodeRenderable nodes should be rendered. However, some NodeRenderable derived classes should not actually be rendered - for example NodeMouldGroup hides the original un-moulded objects, which should definitely *not* be rendered. This is mainly used during printing where due to complications to do with banding and transparency, we cannot use NeedsToRender() to filter out such nodes, so we use this function instead. NB. This has nothing to do with the node's renderable flag!
virtual BOOL NeedsTransparency () const
 Can be overriden in derived classes to return TRUE, indicating that the user may be prompted concerning transparency mode when such a node is inserted in the tree.
virtual INT32 EstimateNodeComplexity (OpParam *details)
virtual BOOL IsAnObject () const
virtual BOOL IsAnAttribute () const
virtual BOOL IsKindOfTextAttribute () const
virtual BOOL IsPaper () const
virtual BOOL IsLayer () const
virtual BOOL IsSpread () const
virtual BOOL IsChapter () const
virtual BOOL IsNodeDocument () const
virtual BOOL IsNodeRenderableClass () const
virtual BOOL IsNodeHidden () const
virtual BOOL IsNodePath () const
virtual BOOL IsARegularShape () const
virtual BOOL IsOrHidesAnAttribute () const
virtual BOOL IsABitmap () const
virtual BOOL IsAFillAttr () const
virtual BOOL IsABitmapFill () const
virtual BOOL IsABitmapColourFill () const
virtual BOOL IsABitmapTranspFill () const
virtual BOOL IsAFeatherAttr () const
virtual BOOL IsAClipViewAttr () const
virtual BOOL IsBounded () const
virtual BOOL IsDragged () const
virtual BOOL IsController ()
virtual BOOL IsABlend ()
virtual BOOL IsCompound () const
virtual BOOL IsCompoundClass () const
virtual BOOL IsAVisibleTextNode () const
virtual BOOL IsAnAbstractTextChar () const
virtual BOOL IsATextChar () const
virtual BOOL IsABaseTextClass () const
virtual BOOL IsATypeface () const
virtual BOOL IsAnObjectName () const
virtual BOOL IsUserAttribute () const
virtual BOOL IsSetCandidate () const
virtual BOOL IsCacheCompound () const
virtual BOOL IsABevel () const
virtual BOOL IsABevelController () const
virtual BOOL IsAContour () const
virtual BOOL IsAContourController () const
virtual BOOL IsAShadow () const
virtual BOOL IsAShadowController () const
virtual BOOL IsABrush () const
virtual BOOL IsEffect () const
virtual BOOL IsBitmapEffect () const
virtual BOOL IsRenderedAsInk () const
BOOL IsBrushed () const
 Quicker way to test if this node is a bitmap. Virtual function for determining if the node is a Fill attribute Virtual function for determining if the node is a Fill attribute Virtual function for determining if the node is a Fill attribute Virtual function for determining if the node is a Fill attribute Quicker way to test if this node is an object-name attribute. Quicker way to test if this node is an AttrUser. Quicker way to test if this node is worth considering during Name gallery scans. Virtual function to determine whether this node is a NodeMould.Virtual function for determing whether this node is a brush attribute as above.
virtual NodePathIsAnEditablePath ()
 Determine if a node is *derived* from the NodeHidden class.Determine if a node is a NodeDocument object.Determine if a node is a NodePath object.Determine if a node is a QuickShape object.Determine if a node is a visible text node.Determine if a node is an AbstractTextChar node. Determine if a node is a (or is derived from) TextChar. Determine if a node is a (or is derived from) BaseTextClass. Determine if a node is a (or is derived from) AttrTxtFontTypeface. Finds the node to edit (if it exists). This node could actually be 'this' node one of its children which the node wants to be editable.
virtual BOOL IsANodeClipViewController () const
virtual BOOL IsANodeClipView () const
virtual BOOL IsAGroup () const
virtual BOOL IsAnInsertionNode () const
virtual BOOL IsANodeMould () const
virtual BOOL SupportsClipboardFormat (InternalClipboardFormat *Format) const
 Determine if a node supports a given internal data type. This is used by the clipboard when exporting to other applications in order to determine if certain data types can be supplied.
virtual BOOL DiscardsAttributeChildren () const
 This virtual was added because we need to know about nodes which can discard their child attributes, an example is the CaretNode. If an attribute gets applied to such a node then no undo info can be generated.
virtual NodeHasEditableChild (CCRuntimeClass *ChildClass, Node *pPrevNode)
 This function allows compound objects to provide editable children. It also allows tools to ask an object what other nodes form part of its editable surface if the node itself cannot be editable. This allows complex objects such as moulds and text objects, who have a single parent above many objects (some of which are editable), to provide a way for tools to get at them. A tool scanning the selection may be looking to edit certain objects. If a selected object it comes accross is not of the correct type, the tool can also ask it whether it contains any editable objects of type(ChildClass). If the node overrides this virtual function it can provide a strangly shapes editable surface. Note, do not confuse this with select inside, where objects have been explicitly selected by the user. In that case the parent would never be asked for editable children as it does not form part of the selection under a select inside action.
virtual KernelBitmapEnumerateBitmaps (UINT32 Count)
 Find out what bitmaps, if any, are used by this node.
virtual double GetEffectiveBitmapMinDPI (KernelBitmap *pBitmap)
virtual BOOL ReplaceBitmap (KernelBitmap *pOrigBitmap, KernelBitmap *pNewBitmap)
virtual TCHARGetDefaultOpToken ()
void SetLocked (BOOL Status)
 To set the node's locked status (TRUE/FALSE).
void SetMangled (BOOL Status)
 To set Nodes mangled status (TRUE/FALSE).
void SetMarker (BOOL Status)
 To set Nodes marked status (TRUE/FALSE).
virtual void SetSelected (BOOL Status)
 To set Nodes selected status (TRUE/FALSE) This routine also deals with "select-inside" by making sure all the SelectedChildren flags are set appropriately. Note: Selecting a node prevents it from being a parent of selected nodes This routine therefore clears the selection of any children! Note2: Calling this routine clears any selection from children of this node and marks it to no longer be the parent of selected children. This is done because selected nodes can't have sel children and because unselecting a node implies that you thought it was selected in which case it shouldn't have selected children.
void SetRender (BOOL Status, BOOL bAndChildren=FALSE)
 To set Nodes renderable status (TRUE/FALSE).
void SetParentOfSelected (BOOL Status)
 To set Nodes SelectedChildren status (TRUE/FALSE) This is used to implement select-inside.
BOOL HasSelectedChildren () const
 To find out whether a node has got selected children or children that themselves have selected children... Helper function for SetSelected Scope: Private.
void ClearSelection (BOOL AndChildren=FALSE)
 Clears all selection flags in this node. It now deselects all children if the AndChildren is TRUE (Defaults to FALSE).
BOOL ChildrenNeedTransparency ()
 Used when adding sub-trees to a document (e.g. file load, import). It scans the node's children to determine if any of them need transparency in order to be displayed correctly. NB. The node itself is not checked; only its children.
NodeFindNext (void) const
 For finding the next sibling of a node.
NodeFindPrevious (void) const
 For finding the previous sibling of a node.
NodeFindParent (void) const
 For finding the parent of a node.
NodeFindFirstChild (void) const
 For finding the first child of a node.
NodeFindLastChild (BOOL ExcludeInsertionNode=FALSE) const
 This function will return TRUE when called on NodeRenderableBounded nodes and those derived from it. This is the base class version that returns FALSE For finding a node's last child.
NodeFindParent (CCRuntimeClass *ParentClass) const
 This function follows the node's parent links until it finds a node of class ParentClass. If no such node is found then an ENSURE will occur.
NodeFindNext (CCRuntimeClass *Class) const
 This function follows the node's next links until it finds a node derived from Class. NULL is returned if no node is found.
NodeFindPrevious (CCRuntimeClass *Class) const
 This function follows the node's Previous links until it finds a node derived from Class. NULL is returned if no node is found.
NodeFindFirstChild (CCRuntimeClass *Class) const
 Find first child of specified type.
NodeFindLastChild (CCRuntimeClass *Class) const
 Find last child of specified type.
NodeRenderableInkFindNextInk () const
 Find the next ink node. Notes: Analogous to FindNext(CC_RUNTIME_CLASS(NodeRenderableInk)), just faster and neater.
NodeRenderableInkFindPreviousInk () const
 Find the previous ink node. Notes: Analogous to FindPrevious(CC_RUNTIME_CLASS(NodeRenderableInk)), just faster and neater.
NodeRenderableInkFindFirstChildInk () const
 Find the first child ink-node. Notes: Analogous to FindFirstChild(CC_RUNTIME_CLASS(NodeRenderableInk)), just faster and neater.
NodeRenderableInkFindLastChildInk () const
 Find the last child ink-node. Notes: Analogous to FindLastChild(CC_RUNTIME_CLASS(NodeRenderableInk)), just faster and neater.
BaseDocumentFindOwnerDoc () const
 Find out which document this node is in. This is used to maintain an accurate node count for each document.
BOOL IsFamily (CCRuntimeClass *ccrcType, Node *pAncestor) const
 Basically, we're looking for a child-parent-grandparent relationship. We're the child and our parent can also be the grandparent.
void SetParentDangerous (Node *NewParent)
 Sets the parent of the node to NewParent.
void SetNextDangerous (Node *NewNext)
void SetPreviousDangerous (Node *NewPrev)
void SetChildDangerous (Node *NewChild)
NodeFindNextNonHidden (void) const
 For finding the next sibling of a node (ignoring all NodeHidden nodes).
NodeFindPrevNonHidden (void) const
 For finding the previous sibling of a node (ignoring all NodeHidden nodes).
SpreadFindParentSpread ()
 Find the spread node to which this node is ultimately attached.
NodeDocFindNextDepthFirst (void)
 To find the next node in the depth first traversal of the current document tree.
NodeFindFirstDepthFirst ()
 To find the first node in a depth first traversal of this subtree.
NodeFindNextDepthFirst (Node *Subtree)
 To find the next node in the depth first traversal of the subtree.
NodeFindFirstPreorder ()
NodeFindNextPreorder (Node *pRoot=NULL, BOOL bSkipSubtree=FALSE)
ChapterFindNextChapter (void)
 To find the next chapter in the document tree.
NodeRenderablePaperFindNextForClippedPaperRender (void)
 To traverse the document tree to find the next paper renderable node which needs to be rendered, i.e. its pasteboard rectangle intersects with the current clipping rectangle.
NodeFindFirstForClippedInkRender (DocRect *pClipRect, RenderRegion *pRender, BOOL ExcludeLockedLayers=FALSE, Node *pStopNode=NULL)
 To traverse the document tree depth first to find the first NodeRenderableInk or NodeAttribute node which needs to be rendered, i.e. in the case of a NodeRenderableInk node its bounding rectangle intersects with the current clipping rectangle (and it's not on a hidden layer).
NodeFindNextForClippedInkRender (DocRect *pClipRect, RenderRegion *pRender, BOOL ExcludeLockedLayers=FALSE, Node *pStopNode=NULL)
 To traverse the document tree depth first to find the next NodeRenderableInk or NodeAttribute node which needs to be rendered, i.e. in the case of a NodeRenderableInk its bounding rectangle intersects with the current clipping rectangle.
NodeFindFirstForUnclippedInkRender (RenderRegion *pRender)
 To traverse the document tree depth first to find the first NodeRenderableInk or NodeAttribute node which needs to be rendered, regardless of the clip rectangle of the render region (and it's not on a hidden layer).
NodeFindNextForUnclippedInkRender (RenderRegion *pRender)
 To traverse the document tree depth first to find the next NodeRenderableInk or NodeAttribute node which needs to be rendered, ignoring the clipping rectangle of the clip region. (i.e. all renderable nodes except those on hidden layers).
ChapterFindEnclosingChapter (DocCoord *ChapterPos, XLONG *ChapterDepth)
 For finding the enclosing chapter of a node, the position of the start of the enclosing chapter, and the chapters depth.
NodeAttributeFindFirstGeometryLinkedAttr ()
NodeAttributeFindNextGeometryLinkedAttr ()
virtual void UnlinkNodeFromTree (BaseDocument *pOwnerDoc=NULL)
 Unlinks the node from the tree.
NodeFindParentOfSelected ()
 To find the node at the normal selection surface from one of its selected-inside children. Note that this routine can be used to test whether a node is "selected-inside" or not by testing whether the Node* returned is NULL or not. (NULL means not selected-inside.).
virtual NodeCompoundGetParentController () const
virtual BOOL CanBecomeA (BecomeA *pBecomeA)
 Interrogation routine to see if a node can be changed into a different node type.
virtual BOOL DoBecomeA (BecomeA *pBecomeA)
 Actually tries to change the node into a different node type.
ChangeCode WarnParentOfChange (ObjChangeParam *pParam, BOOL AllParents=TRUE)
 When an object changes, this function should be used to inform its parent(s) of the change. If AllParents is TRUE it will call every parent, passing the object change parameter to their OnChildChange() virtual function.
virtual BOOL AllowSelectInside () const
void IncHiddenCnt (void)
 Increments the count of the number of NodeHidden nodes which reffer to the node. This routine should only be called from the NodeHidden methods.
void DecHiddenCnt (void)
 Decrements the count of the number of NodeHidden nodes which reffer to the node. This routine should only be called from the NodeHidden methods.
UINT32 GetHiddenCnt (void)
 For finding out how many hidden nodes reffer to the node.
BOOL OptimiseAttributes ()
 This function should be called on a subtree.
virtual BOOL HidingNode ()
 Useful for debugging - actually, it only exists in the debug build.This virtual function is called whenever the node is hidden. It allows the node do things like 'optimise' itself to use less memory or send a message to let others know it's is being hidden etc.
virtual BOOL ShowingNode ()
 This virtual function is called whenever the node is re-shown after being Hidden. It allows the node to reconstruct itself if it was optimised or send a message to let others know it is back etc.
virtual INT32 ComplexHide (UndoableOperation *pOp, Node *pNextInRange)
 This function can be overridden by complex objects who wish to gain more control in what happens when they are hidden. For instance some nodes may not want to be hidden at all. If this function is not overridden, the normal action will be used, which is to use DoHideNode() on the node. It may be that some complex parents may wish to retain various sets of nodes within themselves and allow others to be hidden. To inherit this facility in your node, you simply need to override this virtual function and handle your own hiding of the node.
void MarkNodeAndChildren ()
 Mark this node and all its children.
void MarkChildren ()
 Mark all children of this node.
void ClearMarks ()
 Clear marks from this node and all its children.
void ClearChildMarks ()
 Clear marks from all the children of this node.
virtual BOOL IsDifferent (Node *pOther)
 Determine if 2 nodes are considered different.
virtual void CountChildNodes (UINT32 *pChildCount, UINT32 *pChildAttrCount)
 This scans the child sibling list of this node, counting the number of nodes it finds and the number of attributes.
virtual BOOL AreChildAttrsIdentical (Node *pOtherNode)
 This scans the child sibling list of this node, to see of it contains the same attributes as pOtherNode.
virtual BOOL HasThisChildAttr (NodeAttribute *pAttr)
 This scans the child sibling list of this node, to see if it contains an attribute that's exactly the same as the given one.
virtual BOOL CopyChildAttrs (Node *pDestNode)
 This scans the child sibling list of this node, and copies all the child attributes, applying the copy as a child to the destination node.
virtual BOOL IsNodeInSubtree (Node *pNode)
 Checks the parents of the given node, to see whether it lies within this node's subtree.
virtual BOOL RegenerateNode (UndoableOperation *pOp=NULL, BOOL bCacheRender=FALSE, BOOL bInformParents=TRUE)
virtual BOOL PromoteHitTestOnChildrenToMe () const
virtual BOOL ShouldITransformWithChildren () const
virtual BOOL NeedsParent (Node *pClassNode) const
virtual BOOL MarqueeSelectNode () const
virtual NodePublicCopy ()
 This method copies the node's contents to the node pointed to by NodeCopy.
void RemoveAttrTypeFromSubtree (CCRuntimeClass *AttrType, Node *pExceptThis=NULL)
 Searches the subtree and every attribute which has type AttrType is deleted.
void DeleteChildren (Node *FirstChild)
 Deletes the children and all the children's children etc. starting from FirstChild.
virtual BOOL SetParentLayerAsEdited ()
 Mark parent layer as edited. If an ink object as something done to it which changes its appearance then we need to mark the parent layer as edited. In this baseclass version do nothing.
NodeAttributeFindFirstAttr (TypeFunc pfnTest) const
virtual BOOL IsTypeExtendible () const
virtual DocRect ValidateExtend (const ExtendParams &ExtParams)
 Tests the reversibility of an Extend operation applied to this node.
virtual void Extend (const ExtendParams &ExtParams)
 Perform an Extend operation on this Node, and its children if appropriate. Default implementation just calls Extend() on its children.

Static Public Member Functions

static NodeDocFindFirstDepthFirst (BaseDocument *pDocToSearch)
 To find the first node in a depth first traversal of the document tree.
static ChapterFindFirstChapter (BaseDocument *pDocToSearch)
 To find the first chapter in the document tree.
static void StartHourglass ()
static void StopHourglass ()
static BOOL ShowHourglass ()

Protected Member Functions

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 of Node.
virtual INT32 ComplexCopy (CopyStage Stage, Range &RangeToCopy, Node **pOutput)
 This virtual function is useful for nodes needing to control how they are to be copied. It is overridden currently by text characters and line objects. These objects cannot exist outside the context of a text story. Hence when copying a character object, the parent line object and text story object must be copied along with it. To do this we must give an object the ability to copy whatever it needs to along with itself. In order to do that, the object needs to override this virtual function and the associated GetCopyType() function. ( Normally nodes which are not associated with a particular grouping will not need to override either of these functions. The copy mechanism defaults to using SimpleCopy(), whereby every node is copied as is ).
void CopyNodeContents (Node *nodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.
NodeFindChildToRender (DocRect *const pClipRect, RenderRegion *const pRender, BOOL ExcludeLockedLayers, Node *pStopNode=NULL)
 Find the first child of this node that needs rendering. This follows the children (assuming they intersect with the clipping rectangle), and finds (via a depth first search) the first child that should be rendered according to our rules. The node should be either:.
NodeFindChildToRenderUnclipped (RenderRegion *const pRender)
 Find the first child of this node that needs rendering. This follows the children (assuming they intersect with the clipping rectangle), and finds (via a depth first search) the first child that should be rendered according to our rules. The node should be either:.
BOOL CopyChildren (Node *FirstChild, Node *NewParent, CopyControlFlags=ccALL)
 This private method makes a copy of all the subtree's children and attaches them to NewParent (the root of the new subtree). It is a helper method for CopyTree.
BOOL DeSelectSubtree ()
 To deselect all selected nodes below this node. This function also ensures that the SelectedChildren flags are cleared properly. It is self-recursive! Helper function for SetSelected Scope: Private.

Protected Attributes

UINT32 Tag
NodeFlags Flags
NodePrevious
NodeNext
NodeChild
NodeParent
UINT32 HiddenRefCnt

Static Protected Attributes

static MILLIPOINT PixelWidth
static MILLIPOINT PixelHeight

Private Member Functions

void AttachAsPreviousNode (Node *ContextNode)
 Links the node as a previous sibling of ContextNode.
void AttachAsNextNode (Node *ContextNode)
 Links the node as a next sibling of ContextNode.
void AttachAsFirstChildNode (Node *ContextNode)
 Links the node as a first child of ContextNode.
void AttachAsLastChildNode (Node *ContextNode)
 Links the node as a last child of ContextNode.
void SetTags (BaseDocument *pOwnerDoc)
 Sets the tag of this node and all its descendants to a legal value, according to which document it is in, if any.

Static Private Attributes

static BOOL HourglassOn = FALSE

Friends

class NodeHidden

Classes

struct  NodeFlags

Detailed Description

This abstract class describes the fundamental type of object which can be linked into a camelot tree. All other objects which are linked into the tree are derived from this class.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> Date: 19/4/93 Base Classes: CCObject
IMPORTANT: When producing derived classes of Node, the virtual functions SimpleCopy and ShowDebugTreeDetails() must be redefined.

See also:
CCObject

Definition at line 344 of file node.h.


Member Typedef Documentation

typedef BOOL(Node::* Node::TypeFunc)() const
 

Definition at line 845 of file node.h.


Constructor & Destructor Documentation

Node::Node  ) 
 

This constructor creates a node linked to no other with all status flags FALSE. Also updates the Node counter of the current Document.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
- (Constructor)

Errors: An assertion failure will occur if there is no current document Notes: This method relies on the current document having been set in the Document object.

Definition at line 161 of file node.cpp.

00162 {
00163     Previous=Next=Child=Parent=NULL; 
00164     // Set OpPermission stuff here too as SetOpPermission does a GetOpPermission which otherwise reads an undefined value
00165     Flags.Locked=Flags.Mangled=Flags.Marked=Flags.Selected=Flags.Renderable=Flags.OpPermission1=Flags.OpPermission2 = FALSE;   
00166     Flags.SelectedChildren = FALSE;
00167     SetOpPermission(PERMISSION_UNDEFINED);  
00168     HiddenRefCnt = 0; 
00169          
00170     // Has no TAG because it is not in a document yet.
00171     Tag = TAG_NOT_IN_DOC; 
00172 }

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

This constructor initialises a node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated. For example if a node is inserted as a FirstChild of ContextNode, and Context node already has children, then the current first child of context node will become the next sibling of the new first child node.

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

Specifies the direction in which the 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 ? Renderable: Is node renderable ? Compound: Can node contain non attribute children (eg. a group)

Parameters:
- [OUTPUTS]
Returns:
-
Also updates the Node counter of the current document.

Returns:
Errors: An assertion failure will occur if the ContextNode is NULL

Definition at line 232 of file node.cpp.

00240 {                             
00241     // Defensive programming
00242     ENSURE(ContextNode != NULL,"Trying to attach a node to a NULL node");              
00243 
00244     // Initialize the flags
00245     Flags.Locked = Locked; 
00246     Flags.Mangled = Mangled; 
00247     Flags.Marked = Marked; 
00248     Flags.Selected = Selected; 
00249     Flags.SelectedChildren = FALSE;
00250     Flags.Renderable = Renderable;
00251     Flags.OpPermission1 = Flags.OpPermission2 = FALSE; // because SetOpPermission does a GetOpPermission
00252 
00253     // Has no TAG because it is not in a document yet.
00254     Tag = TAG_NOT_IN_DOC; 
00255 
00256     SetOpPermission(PERMISSION_UNDEFINED);  
00257     Child=NULL;                         // New node has no children
00258     AttachNode(ContextNode,Direction);  
00259              
00260     // Sanity check of unique TAG for object
00261     BaseDocument* pDoc = ContextNode->FindOwnerDoc();
00262     if (pDoc != NULL)
00263     {
00264         ERROR3IF(Tag==TAG_NOT_IN_DOC, "Tag should have a valid value");
00265         // Get a tag for this node and update the count of nodes in the document.
00266         if (Tag==TAG_NOT_IN_DOC)
00267             SetTags(pDoc);
00268     }
00269     else 
00270     {
00271         ERROR3IF(Tag!=TAG_NOT_IN_DOC, "Tag should be TAG_NOT_IN_DOC");
00272         Tag = TAG_NOT_IN_DOC; // Has no TAG
00273     }
00274 
00275     HiddenRefCnt = 0;
00276 
00277     if (Selected) 
00278     {
00279         // Inform the Selection SelRange that the selection has changed
00280         // Pass in 'this' to let it know that I am the most recently selected node
00281         SelRange *Selection = GetApplication()->FindSelection();
00282         if (Selection != NULL)
00283             Selection->Update(FALSE, this);
00284     }
00285 } 

Node::~Node  )  [virtual]
 

Destroys a Node object. The base class updates the node counter of the current document, and ensures that the SelRange doesn't have a cached pointer to 'this' as its 'Last Selected Node'.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
Document::DecCurrentNodeCount

Definition at line 307 of file node.cpp.

00308 {
00309     ERROR3IF(Child != NULL,"Deleting a node that has a ptr to child nodes");
00310 
00311     // Ensure that the Selection SelRange doesn't still keep a cached pointer to me
00312     SelRange *Selection = GetApplication()->FindSelection();
00313     if (Selection != NULL)
00314         Selection->ClearLastSelectedNodeIfItIs(this);
00315 
00316 }


Member Function Documentation

BOOL Node::AllowOp ObjChangeParam pParam,
BOOL  SetOpPermissionState = TRUE,
BOOL  DoPreTriggerEdit = TRUE
[virtual]
 

This is the way to ask a node if you can do an op to it.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 19/01/2000
Date:
3/02/95
Parameters:
pParam = describes the way an op wants to change the node [INPUTS] SetOpPermissionState = if TRUE the Op permission state of this node will be set according to the outcome of the call DoPreTriggerEdit = if TRUE then calls NameGallery::PreTriggerEdit. Must* be TRUE if the calling Op may make any nodes change their bounds, eg move, line width, cut. Use TRUE if unsure.
- [OUTPUTS]
Returns:
TRUE means the node and all its parents are happy with this op, FALSE means don't do it
The ObjChangeParam class contains flags that describe how it will change the node

For example, the op could change the node's appearence (e.g. attr application, editing a path), replace the node with another node (e.g. because it uses hidden nodes to hide the original and put another node in its place, or "make shapes"), delete the node (e.g. the delete and cut ops), etc.

This function gives the node a chance to say NO. It also gives the parents a chance to say no too. E.g. a blend node will allow itself to be deleted, but it will NOT allow a child of itself to be deleted).

This call should only be made on selected, or parents of selected, nodes. It makes a decision as a straight node if it is selected. It makes a decision as a parent if it has selected children.

E.g. NodeBlend::AllowOp(...op delete...) if the node is selected, then it will return TRUE (parents permitting), i.e. I can be deleted if the node is a parent of selected it will return FALSE (i.e. can't delete children of blends).

So when the node is selected, you are asking the node if you can do the op to it. When the node is a parent of a selected node, you are asking if you can do the op to one of its children.

If the 'SetOpPermissionState' param is TRUE, the following indented lines applies: The node's op permission state is set according to the result of this function.

If TRUE is returned, then the node's op permission state will be left unchanged. AND the parent's op permission state will be set to PERMISSION_ALLOWED

if FALSE is returned, then the node's op permission state will be PERMISSION_DENIED, AND all it's parents (up to the layer) will be set to PERMISSION_DENIED

Also, all parents of this node are called via their AllowOp() func with the same state as this node. This means that after this call, you can guarantee that all of its parents will have either a PERMISSION_DENIED or PERMISSION_ALLOWED state.

Note: Even if this node tries to set all it's parents to have a PERMISSION_DENIED state, if any of its parents have previously been set to PERMISSION_ALLOWED they will remain in that state (see SetOpPermission()). Why? Well, it is possible for a parent node to have one child with a PERMISSION_DENIED and another child with a PERMISSION_ALLOWED. It this state the parent MUST be in state PERMISSION_ALLOWED, because at least one of its children will allow the op to happen to it.

So, after this call: The op permission state for this node will be either left unchanged (and therefore remain PERMISSION_UNDEFINED), or PERMISSION_DENIED.

The parent's op permission state will be either PERMISSION_ALLOWED, or PERMISSION_DENIED.

This is so UndoableOperation::UpdateChangedNodes() will only call OnChildChange() on parent nodes, because it only calls that func for nodes that have an op permission state of PERMISSION_ALLOWED.

See also:
GetOpPermission(),SetOpPermission();

Reimplemented in Layer, NodeContourController, NodeBlendPath, NodeClipViewController, NodeSetSentinel, NodeBevel, NodeBlend, NodeContour, NodeMoulder, NodePath, BaseTextClass, and TextStory.

Definition at line 5147 of file node.cpp.

05148 {
05149     ERROR2IF(pParam==NULL,FALSE,"Node::AllowOp() - pParam==NULL");
05150 
05151     // if not called by a child AllowOp(), ensure AllowOp() called for all nodes in compound nodes,
05152     if (pParam->GetDirection()!=OBJCHANGE_CALLEDBYCHILD)
05153     {
05154         BOOL AnyAllowed=AllowOp_AccountForCompound( pParam,
05155                                                     SetOpPermissionState,
05156                                                     DoPreTriggerEdit );
05157         // check for geometry linked attributes
05158         // NB this handles the passing of AllowOp messages to GeomLinkedAttrs on CALLEDBYPARENT
05159         // and CALLEDBYOP.
05160         // NB2 compounds which don't implement their own AllowOps will call
05161         // AccountForCompound from here so ensure that nodes don't inform
05162         // geom linked attrs of the change twice
05163         if(!IS_KIND_OF(NodeGroup))
05164         {
05165             UndoableOperation* pChangeOp = pParam->GetOpPointer();
05166             BOOL InformGeomLinkedAttrs = SetOpPermissionState && pChangeOp && pChangeOp->MayChangeNodeBounds();
05167             if(InformGeomLinkedAttrs)
05168             {
05169                 NodeAttribute* pNA = FindFirstGeometryLinkedAttr();
05170                 while(pNA)
05171                 {
05172                     pNA->LinkedNodeGeometryHasChanged(pChangeOp);
05173                     pNA = pNA->FindNextGeometryLinkedAttr();
05174                 }
05175             }
05176         }
05177 
05178         // if called by a parent, just pass this result back
05179         if (pParam->GetDirection()==OBJCHANGE_CALLEDBYPARENT)
05180             return AnyAllowed;
05181     }
05182     else
05183     {
05184         // clean out the calling-child ptr, so it doesn't get passed around unintentionally.
05185         pParam->SetCallingChild(NULL);
05186     }
05187 
05188 
05189     // at this point we must have been called directly by the op or via a child AllowOp()
05190 
05191     // decide if we allow it ... err we do!
05192     BOOL allowed = TRUE;
05193 
05194     // if we allowed it, see if our parents do ...
05195     if (Parent != NULL)
05196     {
05197         ObjChangeDirection OldDirection = pParam->GetDirection();
05198         pParam->SetCallingChild(this);
05199         pParam->SetDirection(OBJCHANGE_CALLEDBYCHILD);
05200         allowed = Parent->AllowOp(pParam,SetOpPermissionState,DoPreTriggerEdit);
05201         pParam->SetDirection(OldDirection);
05202     }
05203 
05204     // if setting permisions ...
05205     if (SetOpPermissionState)
05206     {
05207         // if allowed, mark parent accordingly, else mark child as denied and update parents
05208         if (!allowed)
05209             SetOpPermission(PERMISSION_DENIED,TRUE);
05210         else
05211             if (Parent != 0) Parent->SetOpPermission(PERMISSION_ALLOWED);
05212     }
05213 
05214     if (allowed)
05215     {
05216         UndoableOperation* pChangeOp = pParam->GetOpPointer();
05217         // check for geometry linked attributes (for CALLEDBYCHILD direction)
05218         if(IsCompound() && pParam->GetDirection()==OBJCHANGE_CALLEDBYCHILD)
05219         {
05220             BOOL InformGeomLinkedAttrs = SetOpPermissionState && pChangeOp && pChangeOp->MayChangeNodeBounds();
05221             if(InformGeomLinkedAttrs)
05222             {
05223                 NodeAttribute* pNA = FindFirstGeometryLinkedAttr();
05224                 while(pNA)
05225                 {
05226                     pNA->LinkedNodeGeometryHasChanged(pChangeOp);
05227                     pNA = pNA->FindNextGeometryLinkedAttr();
05228                 }
05229             }       
05230         }
05231 
05232         // if we're ok so far and were asked to do a PreTriggerEdit, then
05233         // determine whether the Op may change the bounds of some nodes.
05234         // If it may, then call NameGallery::PreTriggerEdit.
05235         if(DoPreTriggerEdit)
05236         {
05237             // if the Op is non-NULL then query its MayChangeNodeBounds() method.
05238             if (pChangeOp != NULL && pChangeOp->MayChangeNodeBounds() && NameGallery::Instance())
05239             {
05240                 allowed = NameGallery::Instance()->PreTriggerEdit(pChangeOp, pParam, this);
05241             }
05242         }
05243     }
05244 
05245     // return result (directly, or indirectly via a child AllowOp()) to op
05246     return allowed;
05247 }

BOOL Node::AllowOp_AccountForCompound ObjChangeParam pParam,
BOOL  SetOpPermissionState = TRUE,
BOOL  DoPreTriggerEdit = TRUE
[virtual]
 

if this is a compound node, ensures all child nodes have their AllowOp() called.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>; Karim 20/01/2000
Date:
5/5/95
Parameters:
pParam = describes the way an op wants to change the node [INPUTS] SetOpPermissionState = if TRUE the OpPermission of nodes should be set DoPreTriggerEdit = if TRUE then NameGallery::PreTriggerEdit is called. Must* be TRUE if the calling Op may make any nodes change their bounds, eg move, line width, cut. Use TRUE if unsure.
Returns:
TRUE if ANY of the objects in the coumpond node have allowed the op
This ensures that any pre-op code in AllowOp()s will be done eg inserting insert dormat format action for TextStories

This also ensures post-op code in OnChildChange()s is called (if the OpPermission is set on affected nodes AND PARENTS) eg. format redraw for TextStories

This fixes the bug where attributes applied to a group/Mould/Blend containing a TextStory cause the text story to be formatted correctly

Note: Optimisation - currently only done for attribute changes and transformations. Karim 18/05/2000 - Also now done when Flags.RegenerateNode is set.

Reimplemented in NodeCompound, and TextStory.

Definition at line 5280 of file node.cpp.

05282 {
05283     BOOL AnyAllowed=FALSE;
05284 
05285     // 'optimised' to only do the biz if an attr changes, it's a transform or a regeneration.
05286     ObjChangeFlags Flags=pParam->GetChangeFlags();
05287     if (IsCompound() && (Flags.Attribute || Flags.TransformNode || Flags.RegenerateNode) )
05288     {
05289         ObjChangeDirection OldDirection=pParam->GetDirection();
05290         pParam->SetDirection(OBJCHANGE_CALLEDBYPARENT);
05291         Node* pNode=FindFirstChild();
05292         UndoableOperation* pChangeOp = pParam->GetOpPointer();
05293         BOOL InformGeomLinkedAttrs = SetOpPermissionState && pChangeOp && pChangeOp->MayChangeNodeBounds();
05294 
05295         while (pNode!=NULL)
05296         {
05297             if (pNode->IsAnObject())
05298                 AnyAllowed |= pNode->AllowOp(pParam, SetOpPermissionState, DoPreTriggerEdit);
05299             else
05300             {
05301                 if(pNode->IsAnAttribute() && ((NodeAttribute*)pNode)->IsLinkedToNodeGeometry())
05302                     if(InformGeomLinkedAttrs)
05303                         ((NodeAttribute*)pNode)->LinkedNodeGeometryHasChanged(pChangeOp);
05304             }
05305 
05306             pNode=pNode->FindNext();
05307         }
05308         pParam->SetDirection(OldDirection);
05309     }
05310 
05311     // if setting flags and any child allowed it, set this permission allowed
05312     if (AnyAllowed && SetOpPermissionState)
05313         SetOpPermission(PERMISSION_ALLOWED);
05314 
05315     return AnyAllowed;
05316 }

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

Reimplemented in NodeLiveEffect, NodeLockedEffect, and NodeMould.

Definition at line 669 of file node.h.

00669 { return TRUE; }

BOOL Node::AreChildAttrsIdentical Node pOtherNode  )  [virtual]
 

This scans the child sibling list of this node, to see of it contains the same attributes as pOtherNode.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/8/96
Parameters:
pOtherNode = ptr to the node to compare against [INPUTS]
Returns:
TRUE if attrs are identical, FALSE otherwise
If does **not** do any extra tree traversal - only immediate child attrs of this node and the other node compared

See also:
-

Definition at line 6112 of file node.cpp.

06113 {
06114     ERROR2IF(pOtherNode == NULL,FALSE,"NULL node ptr");
06115 
06116     // Count the number of child attrs in this and the other nodes.
06117     UINT32 ChildAttrCount,OtherChildAttrCount;
06118     CountChildNodes(NULL,&ChildAttrCount);
06119     pOtherNode->CountChildNodes(NULL,&OtherChildAttrCount);
06120 
06121     // If they don't have the same number of child attrs, then they can't have an identical set
06122     if (ChildAttrCount != OtherChildAttrCount)
06123         return FALSE;
06124 
06125     Node* pNode = FindFirstChild();
06126     while (pNode != NULL)
06127     {
06128         if (pNode->IsAnAttribute())
06129         {
06130             if (!pOtherNode->HasThisChildAttr((NodeAttribute*)pNode))
06131                 return FALSE;
06132         }
06133 
06134         pNode = pNode->FindNext();
06135     }
06136 
06137     return TRUE;
06138 }

BOOL Node::AreYouSafeToRender  )  [virtual]
 

This function is used by the progressive rendering system & the new file format to determine whether the node is renderable or not.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/9/96
Parameters:
- [INPUTS]
Returns:
TRUE means yes, FALSE means no
The base class assumes that the node IS safe to render, as these are the most common

See also:
CanWriteChildrenWeb(), WritePreChildrenWeb()

Reimplemented in NodeGroup, and NodeRenderableInk.

Definition at line 5973 of file node.cpp.

05974 {
05975     return TRUE;
05976 }

void Node::AttachAsFirstChildNode Node ContextNode  )  [private]
 

Links the node as a first child of ContextNode.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/4/93
Parameters:
ContextNode,: Pointer to a node to which the new node is to be attached as a [INPUTS] first child
- [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if ContextNode is NULL Notes: This is a private method Scope: private

Definition at line 839 of file node.cpp.

00840 {                   
00841     ENSURE(ContextNode != NULL,"Trying to attach a node to a NULL node");              
00842 
00843     // Check if ContextNode already has a Child
00844     if (ContextNode->Child == NULL)    
00845         Next = NULL; // If not then new node has no next sibling
00846     else
00847     {   
00848         // Context node's first child becomes the new node's next sibling
00849         Next = ContextNode->Child; 
00850         // The next sibling's previous sibling becomes the new node
00851         Next->Previous = this; 
00852     }          
00853     ContextNode->Child = this; // Attach new node as first child of context node
00854     Previous = NULL;      // A first child cannot have a previous sibling
00855     Parent = ContextNode; // New node's parent is ContextNode       
00856 }                                 

void Node::AttachAsLastChildNode Node ContextNode  )  [private]
 

Links the node as a last child of ContextNode.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/4/93
Parameters:
ContextNode,: Pointer to a node to which the new node is to be attached as a [INPUTS] last child
- [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if ContextNode is NULL Scope: private

Definition at line 890 of file node.cpp.

00891 {               
00892     ENSURE(ContextNode != NULL,"Trying to attach a node to a NULL node");              
00893     if (!ContextNode)
00894         return; // Don't just blow up
00895 
00896     if (ContextNode->Child == NULL)      // The context node has no children   
00897         AttachAsFirstChildNode(ContextNode);      // Add node as first child of context node                            
00898     else
00899     {                                             
00900         // Search for the current last child of Context node
00901         Node* np; 
00902         for(np=ContextNode->Child; (np->Next != NULL); np = np->Next);   
00903         // Add node as the next node of the current last child of ContextNode
00904         AttachAsNextNode(np);    
00905     }
00906 }                              

void Node::AttachAsNextNode Node ContextNode  )  [private]
 

Links the node as a next sibling of ContextNode.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/4/93
Parameters:
ContextNode,: Pointer to a node to which the new node is to be attached as a [INPUTS] next sibling
- [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if ContextNode is NULL Scope: Private

Definition at line 790 of file node.cpp.

00791 {                     
00792     ENSURE(ContextNode != NULL,"Trying to attach a node to a NULL node");              
00793     
00794     // Check if ContextNode already has a Next sibling
00795     if (ContextNode->Next == NULL)  // Context node has no next sibling  
00796         Next = NULL; // New node has no next sibling
00797     else  
00798     {   
00799         // The new node's next sibling = the context node's next sibling
00800         Next = ContextNode->Next; 
00801         // The next sibling's previous sibling becomes the new node
00802         Next->Previous = this; 
00803     }          
00804     ContextNode->Next = this; // Attach new node as next sibling
00805     Previous = ContextNode;   // New node's previous sibling is ContextNode
00806     Parent = ContextNode->Parent; // New node's parent same as the ContextNode
00807 }

void Node::AttachAsPreviousNode Node ContextNode  )  [private]
 

Links the node as a previous sibling of ContextNode.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/4/93
Parameters:
ContextNode,: Pointer to a node to which the new node is to be attached as a [INPUTS] previous sibling
- [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if ContextNode is NULL

Scope: private

Definition at line 732 of file node.cpp.

00733 {                                
00734     ENSURE(ContextNode != NULL,"Trying to attach a node to a NULL node");              
00735     
00736     // Check if ContextNode already has a Previous sibling 
00737     if (ContextNode->Previous == NULL)  // ContextNode has no previous sibling                                       
00738     {
00739         Previous = NULL; // The new node has no previous sibling
00740            
00741         // If ContextNode has a parent then ContextNode will currently be the 
00742         // first child of the parent because Previous == NULL   
00743         if (ContextNode->Parent != NULL) 
00744         {                                           
00745             // Make the new node the first child of ContextNode
00746             ContextNode->Parent->Child = this; 
00747         }
00748     }
00749     else // Context node has a previous sibling     
00750     {
00751         // The new node's Previous sibling becomes the context node's previous sibling
00752         Previous = ContextNode->Previous;    
00753         // The previous siblings next sibling becomes the new node
00754         Previous->Next = this; 
00755     }        
00756     ContextNode->Previous = this;  // Attach new node as previous sibling
00757     Next = ContextNode;                // New node's next sibling is ContextNode
00758     Parent = ContextNode->Parent;  // New nodes parent same as the ContextNode.  
00759 }    

void Node::AttachNode Node ContextNode,
AttachNodeDirection  Direction,
BOOL  fCheckTransparent = TRUE,
BOOL  InvalidateBounds = TRUE
 

This method attaches the node to a context node in the direction specified by Direction. All necessary tree links are updated.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
ContextNode,: Pointer to a node to which this node is to be attached [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

fCheckTransparent whether the insertion routine should test if the node to be inserted requires transparency mode to render, and if so, to prompt the user about this. InvalidateBounds When TRUE the parents bounds + all its childrens bounds will be invalidated if this is neccessary.

Parameters:
- [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if ContextNode is NULL

Scope: private

Definition at line 606 of file node.cpp.

00610 {  
00611     ERROR3IF(IsAnAttribute() && (!(((NodeAttribute*)this)->CanBeAppliedToObject())) &&
00612              ContextNode->IsAnObject(), 
00613         "Trying to attach invalid attribute to this object");
00614          
00615     ENSURE(ContextNode != NULL,"Trying to attach a node to a NULL node");              
00616     switch (Direction)
00617     {
00618         case PREV:        // Attach node as a previous sibling of the ContextNode  
00619             AttachAsPreviousNode(ContextNode); 
00620             break; 
00621         case NEXT:         // Attach node as a next sibling of the ContextNode
00622             AttachAsNextNode(ContextNode);                                 
00623             break; 
00624         case FIRSTCHILD:   // Attach node as the first child of the Context node
00625             AttachAsFirstChildNode(ContextNode);       
00626             break;
00627         case LASTCHILD:    // Attach node as the last child of the Context node
00628             AttachAsLastChildNode(ContextNode);            
00629             break;  
00630     }
00631 
00632     // If an attribute is being attached which affects the parents bounds then we need to
00633     // invalidate it's parent and all children of the parent!.
00634     
00635     if (InvalidateBounds)
00636     {
00637         Node* pParent = FindParent();
00638         if (pParent != NULL)
00639         { 
00640             if (pParent->IsBounded())
00641             { 
00642                 BOOL AffectsParentsChildren = (this->IsAnAttribute() && ((NodeAttribute*)this)->EffectsParentBounds());
00643                 if (AffectsParentsChildren)
00644                 {
00645                     ((NodeRenderableBounded*)pParent)->InvalidateBoundingRect(TRUE);
00646                 }
00647             }
00648         }
00649     }
00650 
00651     // Set the tags for this node and any children
00652     BaseDocument* pDoc = ContextNode->FindOwnerDoc();
00653     SetTags(pDoc);
00654 }     

BOOL Node::CanBecomeA BecomeA pBecomeA  )  [virtual]
 

Interrogation routine to see if a node can be changed into a different node type.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/10/94
Parameters:
pClass = runtime class to node you wish this node to become [INPUTS] pNumObjects = ptr to place number of objects of type pClass that will be created (Note: can be NULL). pNumObects in undefined on entry
- [OUTPUTS]
Returns:
TRUE if it can, FALSE if it can't Always returns FALSE
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.

Returns:
Errors: -
See also:
Node::DoBecomeA()

Reimplemented in AttrBevelType, NodeContourController, NodeClipViewController, NodeBevel, NodeBlender, NodeBitmap, NodeContour, NodeCompound, NodeBitmapEffect, NodeMoulder, NodeMould, NodePath, NodeRegularShape, NodeSimpleShape, and TextStory.

Definition at line 5531 of file node.cpp.

05532 {
05533     return FALSE;
05534 }

BOOL Node::CanWriteChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented in Layer, NodeBlend, NodeMoulder, TextChar, CaretNode, EOLNode, and TextStory.

Definition at line 5789 of file node.cpp.

05790 {
05791     return TRUE;
05792 }

BOOL Node::CanWriteChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

If the node does not mind the filter automatically writing out its child nodes, then return TRUE.

> virtual BOOL Node::CanWriteChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/5/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if ok to automatically write out the children, FALSE otherwise
If, however, you wish to prevent this (e.g. because you want to save out your child nodes yourself, in some selective fashion), then return FALSE

See also:
WritePostChildrenWeb(), WritePreChildrenWeb()

Reimplemented in Layer, NodeSetProperty, NodeBarProperty, NodeSetSentinel, NodeBlend, NodeMoulder, TextChar, CaretNode, EOLNode, and TextStory.

Definition at line 5783 of file node.cpp.

05784 {
05785     return TRUE;
05786 }

void Node::CascadeDelete void   ) 
 

This method removes the node from the tree and deletes all its child nodes (including hidden nodes).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/93
"IT DOES NOT DELETE THE NODE ITSELF (only its children)"

The following before and after diagram illustrates this form of deletion:

Notes: Before:-

MonoOn .-----. | N1 | | | .-----. | V .-----. .-----. .-----. |N2 |----->|N3 |----->| N4 | | | | | | | .-----. .-----. .-----. | V .-----. .-----. |N5 |----->|N6 | | | | | .-----. .-----. | V .-----. |N7 | | | .-----.

MonoOff

After deleting node N3

MonoOn .-----. |N1 | | | .-----. | V .-----. .-----. |N2 |----->|N4 | | | | | .-----. .-----.

MonoOff

Returns:
Errors: -

Definition at line 981 of file node.cpp.

00982 {
00983     ERROR3IF(GetHiddenCnt() != 0, "Trying to delete a node with a hidden ref cnt"); 
00984     // Delete all the node's children
00985     DeleteChildren(Child);
00986     // Unlink the node from the tree
00987     UnlinkNodeFromTree();
00988 }  

BOOL Node::ChildrenNeedTransparency  ) 
 

Used when adding sub-trees to a document (e.g. file load, import). It scans the node's children to determine if any of them need transparency in order to be displayed correctly. NB. The node itself is not checked; only its children.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/15/95
Returns:
TRUE if any of this node's descendants need transparency to be displayed; FALSE if not.
See also:
Node::NeedsTransparency

Definition at line 4887 of file node.cpp.

04888 {
04889 #ifdef RALPH
04890     // Can't scan children when progressively loading/rendering in ralph
04891     return TRUE;
04892 #else
04893     // Start with the first child of this node.
04894     Node *pChild = FindFirstChild();
04895 
04896     while (pChild != NULL)
04897     {
04898         // Does this child (or any of its children) need transparency?
04899         if (pChild->NeedsTransparency() || pChild->ChildrenNeedTransparency())
04900             // Yes - found some transparency
04901             return TRUE;
04902 
04903         // Try the next child.
04904         pChild = pChild->FindNext();
04905     }
04906 
04907     // No transparency found
04908     return FALSE;
04909 #endif
04910 }

void Node::ClearChildMarks  ) 
 

Clear marks from all the children of this node.

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

Definition at line 5493 of file node.cpp.

05494 {
05495     Node* pNode = FindFirstChild();
05496     while (pNode!=NULL)
05497     {
05498         pNode->SetMarker(FALSE);
05499         pNode->ClearChildMarks();
05500         pNode=pNode->FindNext();
05501     }   
05502 }

void Node::ClearMarks  ) 
 

Clear marks from this node and all its children.

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

Definition at line 5475 of file node.cpp.

05476 {
05477     SetMarker(FALSE);
05478     ClearChildMarks();
05479 }

void Node::ClearSelection BOOL  AndChildren = FALSE  )  [inline]
 

Clears all selection flags in this node. It now deselects all children if the AndChildren is TRUE (Defaults to FALSE).

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/2/95
Parameters:
AndChildren = a bool to check for selected children and clear their bits too [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 1185 of file node.h.

01186 {
01187     Flags.Selected          = FALSE;
01188     Flags.SelectedChildren  = FALSE;
01189     if (AndChildren)
01190         DeSelectSubtree();
01191 }  

BOOL Node::CloneNode Node **  ppNodeCopy,
BOOL  bLightweight
[virtual]
 

This method outputs a 'deep' copy of the node. It is the same as CopyNode except that the copy is not linked into the tree. Override if yor class can interpret the lightweight flag.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/2005
Parameters:
bLightweight - Only copy what you really need, [INPUTS] Make references to original large data items instead of copying them if possible
NodeCopy,: A deep copy of the node if Successful [OUTPUTS]
Returns:
-

Errors: -

See also:
Node::CopyNode

Definition at line 1298 of file node.cpp.

01299 {
01300     return NodeCopy(ppNodeCopy);
01301 }

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

This virtual function is useful for nodes needing to control how they are to be copied. It is overridden currently by text characters and line objects. These objects cannot exist outside the context of a text story. Hence when copying a character object, the parent line object and text story object must be copied along with it. To do this we must give an object the ability to copy whatever it needs to along with itself. In order to do that, the object needs to override this virtual function and the associated GetCopyType() function. ( Normally nodes which are not associated with a particular grouping will not need to override either of these functions. The copy mechanism defaults to using SimpleCopy(), whereby every node is copied as is ).

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 - Depends on the Stage parameter if Stage= COPYOBJECT Then the node pointer pOutput points at NULL. It should be set on exit to point at the copied object or tree of objects COPYFINISHED Then the node pointer pOutput points at the resulting copy from COPYOBJECT inserted into the destination tree.
pOutput [OUTPUTS]
Returns:
-1 = The routine failed to make a copy. 0 = No copy has been made for this node. +1 = pOutput points to the copy created.
Copy stages: If the copy stage 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). If the copy stage is COPYFINISHED, the node should tidy up any bits it has left over after a copy. Some nodes set bits to indicate that a complex copy is taking place. This allows them to ignore multiple calls to complex copy if the bit is set.

Note: Imagine you override this function for a particular node pN which exists as a selectable item inside a common parent cP. Now, for you to do so obviously means that pN cannot exist outside cP and pN can be selected without pN being selected. Not to override this function would ofcourse allow pN to be copied to the clipboard by itself which may be hazardous. So overriding the function will allow you to make a copy of cP and pN together, when the function is called. You do not need to override this function inside the class pN. When pN is selected a SimpleCopy() copies it and all its children automatically ensuring validity. Its soley for use by children that need their parents!

See also:
Node::GetCopyType(), InternalClipboard::CopyObjects()

Reimplemented in NodeBlendPath, NodeMouldPath, VisibleTextNode, and TextLine.

Definition at line 1857 of file node.cpp.

01858 {
01859     return -1;
01860 }

INT32 Node::ComplexHide UndoableOperation pOp,
Node pNextInRange
[virtual]
 

This function can be overridden by complex objects who wish to gain more control in what happens when they are hidden. For instance some nodes may not want to be hidden at all. If this function is not overridden, the normal action will be used, which is to use DoHideNode() on the node. It may be that some complex parents may wish to retain various sets of nodes within themselves and allow others to be hidden. To inherit this facility in your node, you simply need to override this virtual function and handle your own hiding of the node.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/5/95
Parameters:
pOp - a pointer to an undoable operation [INPUTS] pNextInRange - a pointer to the next node in the range
Returns:
-1 = The routine failed to hide this node. 0 = Ignored, this object does not support complex hide operations, so carry on and hide the node as normal. +1 = The node and possibly various others have been hidden correctly.
An example of the use of this function is inside the TextObject. TextCharacters can be hidden but EOLNodes and Carets cannot, although they regularly appear in the selection range. Hence the text objects members override this function and ask the textstory to perform the complex hide operation. It will be called on every selected child and should only hide itself when the last child is called. It can easily work this out by using the pNextInRange pointer which may be null or not a member of this text story. Only at this stage are nodes in the story hidden to avoid corrupting the external range scan. Hidding nodes which should appear next in range is never a good idea.

See also:
VisibleTextStory::ComplexHide()

Reimplemented in NodeContourController, VisibleTextNode, and TextLine.

Definition at line 4798 of file node.cpp.

04799 {
04800     // Always ignore this call in the base class
04801     return 0;
04802 }

BOOL Node::CopyChildAttrs Node pDestNode  )  [virtual]
 

This scans the child sibling list of this node, and copies all the child attributes, applying the copy as a child to the destination node.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/8/96
Parameters:
pDestNode = ptr to node to copy attrs to [INPUTS]
Returns:
TRUE if ok, FALSE otherwise
See also:
-

Definition at line 6155 of file node.cpp.

06156 {
06157     ERROR2IF(pDestNode == NULL,FALSE,"NULL dest node ptr");
06158 
06159     Node* pLastInsert = NULL;
06160     Node* pSrcNode = FindFirstChild();
06161     while (pSrcNode != NULL)
06162     {
06163         if (pSrcNode->IsAnAttribute())
06164         {
06165             Node* pCopy = pSrcNode->SimpleCopy();
06166             if (pCopy == NULL)
06167                 return(FALSE);
06168 
06169             if (pLastInsert == NULL)
06170             {
06171                 pCopy->AttachNode(pDestNode,FIRSTCHILD);
06172             }
06173             else
06174             {
06175                 pCopy->AttachNode(pLastInsert,NEXT);
06176             }
06177             pLastInsert = pCopy;
06178         }
06179 
06180         pSrcNode = pSrcNode->FindNext();
06181     }
06182 
06183     return TRUE;
06184 }

BOOL Node::CopyChildren Node FirstChild,
Node NewParent,
CopyControlFlags  CopyFlags = ccALL
[protected]
 

This private method makes a copy of all the subtree's children and attaches them to NewParent (the root of the new subtree). It is a helper method for CopyTree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> / Mike
Date:
28/4/93
Parameters:
FirstChild,: The first child of the subtree to be copied [INPUTS] NewParent: The parent to which all copied children will be attached CopyFlags: The copy control flags (defaults to ALLOBJECTS)
Attaches children of the subtree to NewParent. [OUTPUTS]
Returns:
FALSE if we run out of memory during a copy Otherwise TRUE

Errors: If a memory allocation error occurs then FALSE is returned.

Scope: private

Definition at line 1460 of file node.cpp.

01461 {   
01462     if (ShowHourglass())
01463     {
01464         ContinueSlowJob(); 
01465     }
01466     BOOL CopyObject=FALSE;
01467 
01468     // Find out the destination document, if any.
01469     BaseDocument* pDoc = NewParent->FindOwnerDoc();
01470 
01471     NewParent->Child = NULL;                    // Just in case no nodes are copied
01472 
01473     if (FirstChild != NULL)                     // New parent has children
01474     {                                                        
01475         Node* CurrentChild = FirstChild; 
01476         Node* LastNewChild = NULL; 
01477         while (CurrentChild != NULL)            // While there are children left to copy
01478         {   
01479             // We don't copy hidden nodes or the insertion node.
01480             if (!CurrentChild->IsNodeHidden() && !CurrentChild->IsAnInsertionNode())
01481             {
01482                 switch (CopyFlags)
01483                 {
01484                     case ccALL:
01485                         CopyObject=TRUE;
01486                         break;
01487                     case ccLOCKED:
01488                         CopyObject=((CurrentChild->IsLocked())!=0);
01489                         break;
01490                     case ccMANGLED:
01491                         CopyObject=((CurrentChild->IsMangled())!=0);
01492                         break;
01493                     case ccMARKED:
01494                         CopyObject=((CurrentChild->IsMarked())!=0);
01495                         break;
01496                     case ccSELECTED:
01497                         CopyObject=((CurrentChild->IsSelected())!=0);
01498                         break;
01499                     case ccRENDERABLE:
01500                         CopyObject=((CurrentChild->IsRenderable())!=0);
01501                         break;
01502                 }
01503 
01504                 if (CopyObject)
01505                 {
01506                     Node* NewChild = CurrentChild->SimpleCopy(); // Copy current node  (virtual method)
01507 
01508                     if (NewChild == NULL)              // Out of memory    
01509                         return FALSE;
01510             
01511                     // Attach the NewChild node to the previous or parent node
01512                     if (LastNewChild != NULL)          // Child is not a first child
01513                         LastNewChild->Next = NewChild; 
01514                     else                               // Child is a first child
01515                         NewParent->Child = NewChild;   // NewParent's first child is the NewChild        
01516         
01517                     NewChild->Parent = NewParent;      // The parent of the new child node is NewParent
01518                     NewChild->Previous = LastNewChild; // The previous sibling of the new child
01519 
01520                     // Karim 16/01/01 - GLA's must be re-linked up when they are copied.
01521                     if (NewChild->IsAnAttribute() && ((NodeAttribute*)NewChild)->IsLinkedToNodeGeometry())
01522                         ((NodeAttribute*)NewChild)->LinkToGeometry(NewParent);
01523 
01524                     // Ensure that this new node has the correct tag.
01525                     if (pDoc != NULL)
01526                     {
01527                         NewChild->Tag = pDoc->NewTag();
01528                         pDoc->IncNodeCount();
01529                     }
01530                     else 
01531                     {
01532                         // Ensure this is marked as not being in a document.
01533                         NewChild->Tag = TAG_NOT_IN_DOC;
01534                     }
01535 
01536                     if (CurrentChild->Child != NULL)   // There are children to copy   
01537                         if(!CopyChildren(CurrentChild->Child,NewChild,CopyFlags))// Recursively copy child's children 
01538                             return (FALSE);            // Out of memory     
01539                                  
01540                     LastNewChild = NewChild;           // Need to remember this for next/prev links
01541                 }
01542             }
01543             CurrentChild = CurrentChild->Next; // Process next sibling
01544             
01545             if (ShowHourglass())
01546             {
01547                 ContinueSlowJob(); 
01548             }
01549 
01550         }
01551     }
01552     return TRUE; // No errors occurred        
01553 }                

BOOL Node::CopyChildrenTo Node DestinationNode,
CopyControlFlags  CopyFlags = ccALL
 

This function copies the node's children to DestinationNode which should initially have no children.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/5/94
Parameters:
DestinationNode = a pointer to the node to copy this nodes children to [INPUTS] CopyFlags = copy control flags indicating what flagged nodes to copy defaults to ccALL meaning copy every node.
- [OUTPUTS]
Returns:
FALSE if we run out of memory during a copy Otherwise TRUE.
If we run out of memory during a copy all copied nodes are deleted
Returns:
Errors: -
See also:
-

Definition at line 1653 of file node.cpp.

01654 {
01655     Node* FirstChild = FindFirstChild(); 
01656     if (FirstChild != NULL)
01657     { 
01658         if (!CopyChildren(FirstChild, DestinationNode, CopyFlags))
01659         {
01660             DeleteChildren(DestinationNode->FindFirstChild());   
01661             return (FALSE); 
01662         } 
01663     }
01664     return TRUE;
01665 } 

BOOL Node::CopyComplexRange Range RangeToCopy  ) 
 

Copy the series of nodes described by RangeToCopy and attach them to onto the last child position of this object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/5/95
Parameters:
RangeToCopy - identifies the range of nodes to copy [INPUTS]
[OUTPUTS] 
Returns:
-

Errors: -

See also:
Node::CopyNode

Definition at line 1320 of file node.cpp.

01321 {
01322     BOOL Failed=FALSE;      
01323     Node* Current = RangeToCopy.FindFirst();
01324     Node* NewNode;
01325 
01326     std::list<Node *>   ListOfNodes(30);
01327     
01328     while (Current!=NULL)
01329     {
01330         CopyType ctype = Current->GetCopyType();
01331         switch (ctype)
01332         {
01333             case SIMPLECOPY:
01334             {
01335                 Failed = !(Current->CopyNode(this, LASTCHILD));
01336 
01337                 // kludge, should be part of post-copy system which does not exist!!
01338                 // unwrap any text story on the clipboard
01339                 if (IS_A(Current,TextStory))
01340                 {
01341                     Node* pLastChild = this->FindLastChild();
01342                     if (IS_A(pLastChild,TextStory))
01343                         Failed = !((TextStory*)pLastChild)->UnWrapStory(NULL);
01344                     else
01345                     {
01346                         ERROR2RAW("Node::CopyComplexRange() - did not find the story");
01347                         Failed = TRUE;
01348                     }
01349                 }
01350 
01351                 break;
01352             }
01353 
01354             case COMPLEXCOPY:
01355             {
01356                 INT32 success = Current->ComplexCopy(COPYOBJECT, RangeToCopy, &NewNode);
01357                 // success=-1 then error
01358                 // success= 0 then ignore
01359                 // success= 1 then attach NewNode
01360                 if (success>0)
01361                 {
01362                     NewNode->AttachNode(this, LASTCHILD); 
01363                     // we need to save a list of these nodes for a call back
01364                     ListOfNodes.push_back( Current );
01365                     ListOfNodes.push_back( NewNode );
01366                 }               
01367                 
01368                 Failed=(success<0);
01369                 break;
01370             }
01371                 
01372             default:
01373             {
01374                 ERROR2RAW("Illegal copy type returned to CopyComplexRange()");
01375                 Failed=TRUE;
01376                 break;
01377             }
01378         }
01379 
01380         // if we haven't copied properly, tidy up and exit the loop
01381         if (Failed)
01382             break;
01383 
01384         Current = RangeToCopy.FindNext(Current); 
01385     }
01386 
01387     // Now call the nodes complex copy functions again to say we've done something.
01388     // But only call those we have already!
01389 
01390     while( !ListOfNodes.empty() )
01391     {
01392         Node           *pCopy   = (Node *)ListOfNodes.back(); ListOfNodes.pop_back();
01393         Node           *pRecall = (Node *)ListOfNodes.back(); ListOfNodes.pop_back();
01394 
01395         if( pRecall && pCopy && pRecall->GetCopyType() == COMPLEXCOPY )
01396             pRecall->ComplexCopy( COPYFINISHED, RangeToCopy, &pCopy );
01397     }
01398 
01399 /*
01400     if (Current!=NULL)
01401         Current=RangeToCopy.FindNext(Current);
01402 
01403     Node* Recall = RangeToCopy.FindFirst();
01404     while ((Recall!=Current) && (Recall!=NULL))
01405     {
01406         if (Recall->GetCopyType()==COMPLEXCOPY)
01407             Recall->ComplexCopy(COPYFINISHED, RangeToCopy, &NewNode);
01408         Recall = RangeToCopy.FindNext(Recall);
01409     }
01410  */
01411 
01412     return (!Failed);
01413 }

BOOL Node::CopyNode Node DestinationNode,
AttachNodeDirection  Direction
 

This method creates a 'deep' copy of the node and then attaches it to the destination node. The Direction input specifies how the node is to be attached to the Destination node. The following before and after diagram illustrates this method.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
Destination,: The destination node the copied node is to be attached to. [INPUTS]
Direction:

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

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

Parameters:
[OUTPUTS] 
Returns:
FALSE if memory ran out during the copy. Otherwise TRUE.
Notes: Before:-

MonoOn .-----. .-----. .-----. |N1 |----->|N2 |----->| N3 | | | | | | | .-----. .-----. .-----. | V .-----. .-----. |N4 |----->|N5 | | | | | .-----. .-----.

MonoOff

After copying node N2 to destination N2 as a next sibling:-

MonoOn .-----. .-----. .-----. .-----. |N1 |----->|N2 |------------->| N2C |----->|N3 | | | | | | | | | .-----. .-----. .-----. .-----. | | V V .-----. .-----. .-----. .-----. |N4 |----->|N5 | |N4C |----->|N5C | | | | | | | | | .-----. .-----. .-----. .-----. MonoOff

Returns:
Errors: If memory is exhausted whilst copying, the routine returns FALSE after deleting any partially copied subtree.

Definition at line 1225 of file node.cpp.

01226 {     
01227     // Get a copy of the subtree  
01228     if (ShowHourglass())
01229     {
01230         ContinueSlowJob(); 
01231     }
01232 
01233     Node* NewNode;
01234     if (!NodeCopy(&NewNode))
01235         return FALSE;
01236 
01237     // Attach the copied node to the Destination node                                                       
01238     NewNode->AttachNode(DestinationNode, Direction);
01239     return (TRUE);
01240 }

void Node::CopyNodeContents Node NodeCopy  )  [protected]
 

This method copies the node's contents to the node pointed to by NodeCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
[INPUTS] 
A copy of this node [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Definition at line 1766 of file node.cpp.

01767 {                         
01768     ENSURE(NodeCopy != NULL,"Trying to copy node contents to\na node pointed to by a NULL pointer"); 
01769     NodeCopy->Flags = Flags;        
01770     // All tree pointers are NULL
01771 // Phil, 7/1/2004
01772 // DO NOT blat the tree pointers because the node may already be in the tree!!!
01773 //  NodeCopy->Previous=NodeCopy->Next=NodeCopy->Parent=NodeCopy->Child = NULL;              
01774 }       

void Node::CountChildNodes UINT32 pChildCount,
UINT32 pChildAttrCount
[virtual]
 

This scans the child sibling list of this node, counting the number of nodes it finds and the number of attributes.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/8/96
Parameters:
pChildCount = place to put the number of child nodes (can be NULL) [INPUTS] pChildAttrCount = place to put the number of child attribute nodes (can be NULL)
Returns:
-
If does **not** do any extra tree traversal - only immediate children of this node are counted

NOTE: Hidden nodes are not counted

See also:
-

Definition at line 5999 of file node.cpp.

06000 {
06001     UINT32 ChildCount = 0;
06002     UINT32 ChildAttrCount = 0;
06003 
06004     Node* pNode = FindFirstChild();
06005     while (pNode != NULL)
06006     {
06007         if (!pNode->IsNodeHidden())
06008         {
06009             ChildCount++;
06010             if (pNode->IsAnAttribute())
06011                 ChildAttrCount++;
06012         }
06013         pNode = pNode->FindNext();
06014     }
06015 
06016     if (pChildCount != NULL)
06017         *pChildCount = ChildCount;
06018 
06019     if (pChildAttrCount != NULL)
06020         *pChildAttrCount = ChildAttrCount;
06021 }

void Node::DecHiddenCnt void   ) 
 

Decrements the count of the number of NodeHidden nodes which reffer to the node. This routine should only be called from the NodeHidden methods.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 4668 of file node.cpp.

04669 {
04670     ENSURE((HiddenRefCnt != 0), "Trying to decrement a zero Hidden Node refference count"); 
04671     HiddenRefCnt--; 
04672 } 

void Node::DeleteChildren Node FirstChild  ) 
 

Deletes the children and all the children's children etc. starting from FirstChild.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/93
Parameters:
FirstChild,: Pointer to the first child to be deleted [INPUTS]
- [OUTPUTS]
Returns:
-
Certain nodes are not deleted but simply unlinked, these are the nodes which are pointed at by the OperationHistory.

NodeHidden nodes (ShowNodeActions point at them) Nodes with a HiddenCnt not equal to 0 - HiddenNodes point at them

Returns:
Errors: - Scope: private

Definition at line 1027 of file node.cpp.

01028 {          
01029     Node* CurrentNode = FirstChild;
01030 
01031     if (ShowHourglass())
01032     {
01033         ContinueSlowJob(); 
01034     }
01035 
01036     BaseDocument *pOwnerDoc = NULL;
01037 
01038     if (FirstChild != NULL)
01039         FirstChild->FindOwnerDoc();
01040 
01041     while (CurrentNode != NULL)   // While there are children left to process
01042     {                               
01043         Node* NextNode = CurrentNode->Next;  
01044         // It is not the job of DeleteChildren to delete HiddenNodes or nodes pointed to by hidden nodes
01045         // They should be considered to be in the OperationHistory
01046         if ( (!CurrentNode->IsNodeHidden()) && (CurrentNode->GetHiddenCnt() == 0) )
01047         {
01048             if (CurrentNode->Child != NULL)  // There are children to delete      
01049                 DeleteChildren(CurrentNode->Child);
01050 
01051             // Unlink from tree before deleting it
01052             CurrentNode->UnlinkNodeFromTree(pOwnerDoc); // Nice and safe !!!!
01053 
01054             delete CurrentNode;              // Current node has no children so can be deleted
01055         }
01056         else
01057             CurrentNode->UnlinkNodeFromTree(pOwnerDoc);
01058 
01059         CurrentNode = NextNode;          // Process next sibling
01060 
01061         if (ShowHourglass())
01062         {
01063             ContinueSlowJob(); 
01064         }
01065 
01066     } //end while
01067     Child = NULL; 
01068 }                      

String Node::Describe BOOL  Plural,
BOOL  Verbose = TRUE
[virtual]
 

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

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/6/93
Parameters:
Plural,: Flag indicating if the string description should be plural or [INPUTS] singular. Verbose: Flag indicating if a shortended or full description is required. Most classes will ignore this, but some (eg. Bitmaps) will just give shortended desciptions more appropriate for menus.
- [OUTPUTS] Retuns: Description of the object
The description will always begin with a lower case letter.

Returns:
Errors: A resource exception will be thrown if a problem occurs when loading the string resource.
See also:
-

Reimplemented in Chapter, NodeGrid, NodeGridRect, NodeGridIso, NodeGroup, NodeGuideline, Layer, NodeContourController, NodeClipViewController, NodeMouldGroup, NodeMouldBitmap, NodeAnimatingBitmap, NodeBevel, NodeBlend, NodeBitmap, NodeBrush, NodeClipView, NodeContour, NodeEllipse, NodeLiveEffect, NodeLockedEffect, NodeFeatherEffect, NodeMoulder, NodeMould, NodePath, NodeRect, NodeRegularShape, AbstractTextChar, CaretNode, EOLNode, TextLine, TextStory, Page, and Spread.

Definition at line 560 of file node.cpp.

00561 {     
00562     ENSURE (FALSE,"The illegal function Node::Describe was called\n"); 
00563     
00564     return( _T("") ); // Just to keep the compiler happy
00565 }; 

BOOL Node::DeSelectSubtree  )  [protected]
 

To deselect all selected nodes below this node. This function also ensures that the SelectedChildren flags are cleared properly. It is self-recursive! Helper function for SetSelected Scope: Private.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if it succeeded FALSE otherwise

Errors: -

See also:
Node::SetSelected

Definition at line 2992 of file node.cpp.

02993 {
02994     ERROR2IF(this==NULL,FALSE,"DeSelectSubtree called on NULL node.");  // Precondition
02995 
02996     Node* pNode = Child;
02997     while (pNode)
02998     {
02999         pNode->Flags.Selected = FALSE;              // Deselect this node directly
03000 
03001         if (pNode->Flags.SelectedChildren)          // If this node has selected children
03002         {
03003             pNode->DeSelectSubtree();               // Then deselect anything in its subtree
03004         }
03005 
03006         pNode->Flags.SelectedChildren = FALSE;      // Flag that this node no longer has sel children
03007         pNode = pNode->Next;
03008     }
03009 
03010     return TRUE;
03011 }

BOOL Node::DiscardsAttributeChildren  )  const [virtual]
 

This virtual was added because we need to know about nodes which can discard their child attributes, an example is the CaretNode. If an attribute gets applied to such a node then no undo info can be generated.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/4/95
Returns:
TRUE if the node discards its attribute children FALSE if it does not (default)
scenario ~~~~~~~~

Apply attribute to caret generating undo Move caret, so deleting all initial attrs undo

The undo tries to find the applied attribute so that it can hide it, but it does not exist anymore (BANG!)

This base class function returns FALSE

Notes: Phil, 24/09/2005 The usage of this function has changed subtly today. It used to prevent both attribute optimisation and undo recording on Caret nodes. As of today it just prevents undo recording - attribute optimisation goes ahead like normal on Caret nodes so that they behave more consistently.

Reimplemented in CaretNode.

Definition at line 2774 of file node.cpp.

02775 {
02776     return (FALSE);
02777 }

BOOL Node::DoBecomeA BecomeA pBecomeA  )  [virtual]
 

Actually tries to change the node into a different node type.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/10/94
Parameters:
pBecomeA = ptr to info class containing everything a node needs to be able [INPUTS] to become something else
- [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise Always returns TRUE

Errors: -

See also:
Node::CanBecomeA()

Reimplemented in AttrBevelType, NodeContourController, NodeBlendPath, NodeClipViewController, NodeBevel, NodeBlender, NodeBlend, NodeBitmap, NodeContour, NodeCompound, NodeBitmapEffect, NodeMoulder, NodeMould, NodePath, NodeRegularShape, NodeSimpleShape, and TextStory.

Definition at line 5555 of file node.cpp.

05556 {
05557     // Always return TRUE so that this routine won't upset the caller.
05558     // Even though the CanBecomeA() function returns FALSE, this does NOT guarantee that DoBecomeA() 
05559     // won't get called. 
05560     
05561     // E.g. Group::CanBecomeA() will return TRUE if ANY of its children return TRUE from their 
05562     // CanBecomeA() virt func.  When Group::DoBecomeA() is called, all the children's
05563     // DoBecomeA() funcs are called, so if they returned FALSE by default, the op will be aborted (this is bad).
05564 
05565     return TRUE;
05566 }

Node * Node::DocFindFirstDepthFirst BaseDocument pDocToSearch  )  [static]
 

To find the first node in a depth first traversal of the document tree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/5/93
Parameters:
pDocToSearch - the document to look in. [INPUTS]
Returns:
The first node in a depth first traversal of the document tree or NULL if the tree is empty, except for the start node.
See also:
Node::DocFindNextDepthFirst
Returns:
Errors: If the document pointer is NULL => ERROR2

Definition at line 3514 of file node.cpp.

03515 {
03516     // Make sure we have a document to search.
03517     ERROR2IF(pDocToSearch == NULL, NULL, "No document to search in DocFindFirstDepthFirst()");
03518 
03519     // Get the first node!
03520     return pDocToSearch->GetFirstNode();
03521 }

Node * Node::DocFindNextDepthFirst void   ) 
 

To find the next node in the depth first traversal of the current document tree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/5/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The next node in the depth first traversal of the document tree or NULL if the traversal is complete.
See also:
Node::DocFindFirstDepthFirst
Returns:
Errors: -

Definition at line 3545 of file node.cpp.

03546 {                 
03547     Node* CurrentNode = this; 
03548                        
03549     if (CurrentNode->Next != NULL) 
03550     {             
03551         CurrentNode = CurrentNode->Next;           
03552         
03553         // Find leftmost child node
03554         while(CurrentNode->Child != NULL)
03555             CurrentNode = CurrentNode->Child; 
03556            
03557         return (CurrentNode);
03558         
03559     }
03560     else 
03561         return (CurrentNode->Parent);
03562 }

KernelBitmap * Node::EnumerateBitmaps UINT32  Count  )  [virtual]
 

Find out what bitmaps, if any, are used by this node.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/17/95
Parameters:
Count - the bitmap to get (see Purpose). [INPUTS]
Returns:
The KernelBitmap in use by the node, or NULL if no more are used.
The base class returns NULL always, so you over-ride this in any node classes that use bitmaps.

This function supports nodes that use more than one bitmap - you call this function repeatedly and keep incrementing the Count parameter that you pass in each time by 1. You should stop calling it when it returns NULL, as this indicates that no more bitmaps are used by this node. Count should start off as 0 for the first call. Note that this function can (and often will) return NULL for the first call, as many nodes don't use bitmaps, obviously.

See also:
KernelBitmap

Reimplemented in AttrBitmapFill, Layer, NodeAnimatingBitmap, NodeBitmap, and NodeLockedEffect.

Definition at line 2804 of file node.cpp.

02805 {
02806     return NULL;
02807 }

virtual INT32 Node::EstimateNodeComplexity OpParam details  )  [inline, virtual]
 

Reimplemented in NodeBevel, NodeBlender, NodeBlend, NodeContour, NodeCompound, NodePath, and NodeRegularShape.

Definition at line 455 of file node.h.

00455 { return (1); }

BOOL Node::ExportRender RenderRegion pRender  )  [virtual]
 

Perform special export rendering of an object, if it is different to the way the object would be rendered normally (e.g. graduated fill attributes, and so on). By default, the base class function returns FALSE, so by default all objects will be exported by calling the Render() function unless they override this function.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/03/94
Parameters:
pRender - the render region we are exporting to. [INPUTS]
Returns:
TRUE => Rendered (exported) ok; don't call Render(). FALSE => Exporting is the same as normal rendering; nothing has been rendered, so call the default Render() function.
See also:
Node::PreExportRender; Node::NeedsToExport

Reimplemented in NodeGroup, NodeGuideline, NodeRenderableInk, Layer, NodeContourController, NodeBlendPath, NodeClipViewController, NodeMouldGroup, NodeMouldPath, NodeBevel, NodeBevelBegin, NodeBlender, NodeBlend, NodeBitmap, NodeMoulder, NodeMould, NodeRegularShape, TextChar, KernCode, HorizontalTab, CaretNode, EOLNode, and TextStory.

Definition at line 495 of file node.cpp.

00496 {
00497     // By default, use normal rendering when exporting.
00498     return FALSE;
00499 }

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

Perform an Extend operation on this Node, and its children if appropriate. Default implementation just calls Extend() on its children.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/11/1999
Parameters:
ExtParams description parameters for the extension. [INPUTS]
This node and some of its children may have their dimensions altered. [OUTPUTS]
Returns:

Errors: See also:

Reimplemented in AttrFillGeometry, AttrBitmapFill, NodeContourController, NodeMouldGroup, NodeHidden, NodeBevel, NodeBlend, NodeContour, NodeMould, NodePath, NodeRegularShape, NodeSimpleShape, and TextStory.

Definition at line 6356 of file node.cpp.

06357 {
06358     for (   Node* pChildNode = FindFirstChild();
06359             pChildNode != NULL;
06360             pChildNode = pChildNode->FindNext() )
06361     {
06362         pChildNode->Extend(ExtParams);
06363     }
06364 }

Node * Node::FindChildToRender DocRect *const   pClipRect,
RenderRegion *const   pRender,
BOOL  ExcludeLockedLayers,
Node pStopNode = NULL
[protected]
 

Find the first child of this node that needs rendering. This follows the children (assuming they intersect with the clipping rectangle), and finds (via a depth first search) the first child that should be rendered according to our rules. The node should be either:.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/94
Parameters:
pClipRect - the clip rectangle to check against. [INPUTS] pRender - the render region in question.
Returns:
The child node to render, or NULL if none are suitable.
(a) a NodeAttrbute, OR (b) a NodeRenderable that intersects the clipping region.

All other nodes (e.g. NodeHidden) are not rendered.

Returns:
Errors: -
See also:
-

Definition at line 3945 of file node.cpp.

03947 {
03948     ENSURE(this != NULL, "FindChildToRender called on NULL pointer");
03949 
03950     Node *pNode = this;
03951 
03952     SubtreeRenderState state = pNode->RenderSubtree(pRender);
03953     if (state!=SUBTREE_ROOTANDCHILDREN && !pNode->IsAnAttribute())
03954     {
03955         pRender->SaveContext();
03956         return pNode;
03957     }
03958 
03959     // If this node has any children, save the context first.
03960     Node *pChild = pNode->Child;
03961 
03962     if (pChild != NULL)
03963         pRender->SaveContext();
03964 
03965     do
03966     {
03967         if (pChild != NULL)
03968         {
03969             // Should it be rendered?
03970             if (pChild->NeedsToRender(pRender)) //(Flags.Required)
03971             {
03972                 // See if this node has any suitable children to render.
03973                 Node *pChildToRender = pChild->FindChildToRender(pClipRect, pRender, ExcludeLockedLayers);
03974 
03975                 if (pChildToRender != NULL)
03976                     // This child has a child of its own to render so return it.
03977                     return pChildToRender;
03978                 else
03979                     // This child has no children to render, so just render this child.
03980                     return pChild; 
03981             }
03982 
03983         }
03984         else
03985             // This node has no children.
03986             return NULL;
03987 
03988         // No luck - try the next child.
03989         pChild = pChild->Next;
03990 
03991     } while (pChild != NULL);// && pChild != pStopNode );
03992 
03993     // No child nodes found to render
03994     ENSURE(pRender != NULL, "NULL Render region found !!");
03995     return NULL;
03996 }

Node * Node::FindChildToRenderUnclipped RenderRegion *const   pRender  )  [protected]
 

Find the first child of this node that needs rendering. This follows the children (assuming they intersect with the clipping rectangle), and finds (via a depth first search) the first child that should be rendered according to our rules. The node should be either:.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/6/95
Parameters:
pRender - the render region in question. [INPUTS]
Returns:
The child node to render, or NULL if none are suitable.
(a) a NodeAttribute, OR (b) a NodeRenderableBounded.

All other nodes (e.g. NodeHidden) are not rendered. Hidden layers are bypassed.

Definition at line 4157 of file node.cpp.

04158 {
04159     ENSURE(this != NULL, "FindChildToRenderUnclipped called on NULL pointer");
04160 
04161     Node *pNode = this;
04162 
04163 //  INT32 DoFindChildren = PRE_RENDER_CHILDREN;
04164 
04165     SubtreeRenderState state = pNode->RenderSubtree(pRender, NULL, FALSE);      // Don't clip!
04166     if (state!=SUBTREE_ROOTANDCHILDREN && !pNode->IsAnAttribute())
04167     {
04168         pRender->SaveContext();
04169         return pNode;
04170     }
04171 
04172     // If this node has any children, save the context first.
04173     Node *pChild = pNode->Child;
04174 
04175     if (pChild != NULL)
04176     {
04177         pRender->SaveContext();
04178     }
04179 
04180     do
04181     {
04182         if (pChild != NULL)
04183         {
04184             // Should it be rendered?
04185             BOOL NeedsToRender = pChild->ShouldBeRendered();
04186 
04187             // Special case for layers - don't do hidden layers!
04188             if (pChild->IsLayer())
04189             {
04190                 NeedsToRender = pChild->NeedsToRender(pRender);                             // Clipped!
04191             }
04192 
04193             if (NeedsToRender)
04194             {
04195                 // See if this node has any suitable children to render.
04196                 Node *pChildToRender = pChild->FindChildToRenderUnclipped(pRender);
04197 
04198                 if (pChildToRender != NULL)
04199                     // This child has a child of its own to render so return it.
04200                     return pChildToRender;
04201                 else
04202                     // This child has no children to render, so just render this child.
04203                     return pChild; 
04204             }
04205         }
04206         else
04207             // This node has no children.
04208             return NULL;
04209 
04210         // No luck - try the next child.
04211         pChild = pChild->Next;
04212 
04213     } while (pChild != NULL);
04214 
04215     // No child nodes found to render
04216     ENSURE(pRender != NULL, "NULL Render region found !!");
04217     return NULL;
04218 }

Chapter * Node::FindEnclosingChapter DocCoord ChapterPos,
XLONG ChapterDepth
 

For finding the enclosing chapter of a node, the position of the start of the enclosing chapter, and the chapters depth.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/4/93
Parameters:
- [INPUTS]
ChapterPos,: The top left hand corner of the chapters pasteboard rectangle [OUTPUTS] ChapterDepth: The Sum of the lengths of all preceding chapters
Returns:
If this node is a chapter or a node contained within a chapter then the chapter node is returned. else NULL is returned (In the non DEBUG version).

Errors: An assertion failure will occur if the node is not a chapter itself, or if the node is not enclosed within a chapter.

Definition at line 4341 of file node.cpp.

04342 {                                              
04343     Node* CurrentNode = this;    
04344     while (CurrentNode != NULL) 
04345     {                                   
04346         if (CurrentNode->IsChapter())
04347         {                                       
04348             // We have found the enclosing chapter
04349             Chapter* EnclosingChapter = (Chapter*)CurrentNode;                                     
04350                                 
04351             // Chapter position is the top left hand corner of the chapters pasteboard                 
04352             ChapterPos->x = (EnclosingChapter->GetPasteboardRect().LowCorner().x); 
04353             ChapterPos->y = (EnclosingChapter->GetPasteboardRect().HighCorner().y); 
04354             
04355             // Calculate the ChapterDepth
04356             *ChapterDepth = 0;     
04357             BaseDocument *pOwnerDoc = EnclosingChapter->FindOwnerDoc();
04358             Chapter* CurrentChapter = Node::FindFirstChapter(pOwnerDoc);
04359             
04360             while (CurrentChapter != EnclosingChapter)
04361             {      
04362                 ENSURE(CurrentChapter != NULL, ")CurrentChapter=NULL"); // This should always be true
04363                 (*ChapterDepth) += CurrentChapter->GetPasteboardRect().Height(); 
04364                 CurrentChapter = CurrentChapter->FindNextChapter();         
04365             }        
04366             return  (EnclosingChapter); 
04367         } 
04368         else
04369             CurrentNode = CurrentNode->FindParent(); 
04370     }    
04371     ENSURE(FALSE,"Trying to find the enclosing chapter\nof a node which has no enclosing chapter"); 
04372     return (NULL); 
04373 }

NodeAttribute * Node::FindFirstAttr TypeFunc  pfnTest  )  const
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/1/95
Parameters:
pfnTest --- pointer to a member-function of Node:- [INPUTS] typedef BOOL (Node::*TypeFunc)() const; that returns TRUE for the attribute being searched for and FALSE otherwise
Returns:
The first attribute of the given type that applies to pInk, or null if there isn't one. Call NodeAttribute::FindNextAttr on the returned attribute to find the next attribute in scope and so on.
See also:
NodeAttribute::FindNextAttrClass

Definition at line 6268 of file node.cpp.

06269 {
06270     // Begin searching from the last child of pInk, or if there isn't one, from pInk itself.
06271     const Node* pNode = FindLastChild();
06272     if (pNode == 0) pNode = this;
06273 
06274     // Search for the class in the previous sibling nodes, then the parent's siblings,
06275     // then the parent siblings of the parent of ... etc.
06276     while (!(pNode->*pfnTest)())
06277     {
06278         // Work out the next node in the search order.
06279         if (pNode->FindPrevious() != 0)
06280         {
06281             // The next node is the previous sibling.
06282             pNode = pNode->FindPrevious();
06283         }
06284         else
06285         {
06286             // The next node is the parent, if there is one.
06287             pNode = pNode->FindParent();
06288             if (pNode == 0) break;
06289         }
06290     }
06291 
06292     // Return the attribute, or null if none was found.
06293     return (NodeAttribute*) pNode;
06294 }

Chapter * Node::FindFirstChapter BaseDocument pDocToSearch  )  [static]
 

To find the first chapter in the document tree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/5/93
Parameters:
pDocToSearch - the document that should be searched for the first chapter. [INPUTS]
Returns:
If the document tree has any chapter nodes then a pointer to the first is returned, else NULL is returned.

Errors: An assertion failure will occur if:

The current document has not been set in the Document class The document tree's first node is not a StartDocument The first sibling of the StartDocument is not a NodeDocument

See also:
Node::FindNextChapter
Notes: This method requires that the current document has been set in the Document class.

Definition at line 3775 of file node.cpp.

03776 {
03777     // Sanity check
03778     ERROR2IF(pDocToSearch == NULL, NULL, "NULL document in FindFirstChapter()");
03779 
03780     // Make sure that the document is not toast
03781     ERROR3IF(!pDocToSearch->GetFirstNode()->FindNext()->IsKindOf(CC_RUNTIME_CLASS(NodeDocument)),
03782              "A NodeDocument node was not found at the root of the document tree"); 
03783 
03784     // Get the start node
03785     Node* StartChapterList = pDocToSearch->GetFirstNode()->FindNext()->FindFirstChild(); 
03786     if (StartChapterList == NULL)  
03787         return NULL; 
03788     else
03789     {
03790         if (StartChapterList->IsChapter())
03791             return ((Chapter*) StartChapterList);
03792         else
03793             return(StartChapterList->FindNextChapter());  
03794     }
03795 }

Node * Node::FindFirstChild CCRuntimeClass Class  )  const
 

Find first child of specified type.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/95
Parameters:
Class - class of first child to find [INPUTS]
Returns:
pointer to first child of specified type else NULL

Definition at line 3209 of file node.cpp.

03210 {
03211     Node* pNode = FindFirstChild(); 
03212     while (pNode)
03213     {
03214         if (pNode->IsKindOf(Class))
03215             return pNode; 
03216         pNode = pNode->FindNext(); 
03217     }
03218     return NULL; 
03219 }

Node * Node::FindFirstChild void   )  const [inline]
 

For finding the first child of a node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Returns:
Pointer to the node's first child

Definition at line 1141 of file node.h.

01142 {                  
01143     return(Child); 
01144 }                      

NodeRenderableInk * Node::FindFirstChildInk  )  const
 

Find the first child ink-node. Notes: Analogous to FindFirstChild(CC_RUNTIME_CLASS(NodeRenderableInk)), just faster and neater.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/08/2000
See also: FindFirstChild(), IsAnObject().

Definition at line 3299 of file node.cpp.

03300 {
03301     Node* pInk = FindFirstChild();
03302     while (pInk != NULL && !pInk->IsAnObject())
03303         pInk = pInk->FindNext();
03304 
03305     return (NodeRenderableInk*)pInk;
03306 }

Node * Node::FindFirstDepthFirst void   ) 
 

To find the first node in a depth first traversal of this subtree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/5/93
Parameters:
None [INPUTS]
- [OUTPUTS]
Returns:
The first node in a depth first traversal of this subtree.
See also:
Node::FindNextDepthFirst
Returns:
Errors: An assertion failure will occur if the current document is NULL

Definition at line 3587 of file node.cpp.

03588 {
03589     // Find the leftmost child node
03590     Node* Current = this; 
03591     while (Current->FindFirstChild() != NULL) 
03592     {
03593         Current = Current->FindFirstChild(); 
03594     }  
03595     return (Current);    
03596 }

Node * Node::FindFirstForClippedInkRender DocRect pClipRect,
RenderRegion pRender,
BOOL  ExcludeLockedLayers = FALSE,
Node pStopNode = NULL
 

To traverse the document tree depth first to find the first NodeRenderableInk or NodeAttribute node which needs to be rendered, i.e. in the case of a NodeRenderableInk node its bounding rectangle intersects with the current clipping rectangle (and it's not on a hidden layer).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>, Modified by Tim & Rik for coordinate changes
Date:
18/5/93
Parameters:
pClipRect,: The clipping rectangle [INPUTS] pRender: The render region ExcludeLockedLayers: When true objects on locked layers do not get rendered (used for hit detection)
[OUTPUTS] 
Returns:
If the document tree has any NoderRenderableInk or NodeAttribute nodes which require rendering then a pointer to the first is returned, else NULL is returned.
This routine can only be called for a spread node

See also:
Node::FindNextForClipperInkRender
Returns:
Errors: An assertion failure will occur if the render region is NULL or if this node is not a spread.

Definition at line 3909 of file node.cpp.

03913 {                                                   
03914     ENSURE(pRender != NULL, "Render region NULL in FindFirstForClippedInkRender"); 
03915     ENSURE( IsKindOf(CC_RUNTIME_CLASS(Spread)), "Oh No, that's not a spread in FindFirstForClippedInkRender" );
03916     // Let FindNextForClippedInkRender do all the work 
03917     return FindNextForClippedInkRender(pClipRect, pRender, ExcludeLockedLayers, pStopNode);
03918 }

Node * Node::FindFirstForUnclippedInkRender RenderRegion pRender  ) 
 

To traverse the document tree depth first to find the first NodeRenderableInk or NodeAttribute node which needs to be rendered, regardless of the clip rectangle of the render region (and it's not on a hidden layer).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/6/95
Parameters:
pRender,: The render region [INPUTS]
Returns:
If the document tree has any NoderRenderableInk or NodeAttribute nodes which require rendering then a pointer to the first is returned, else NULL is returned.
This routine can only be called for a spread node
See also:
Node::FindNextForUnclippedInkRender
Returns:
Errors: An assertion failure will occur if the render region is NULL or if this node is not a spread.

Definition at line 4127 of file node.cpp.

04128 {                                                   
04129     ENSURE(pRender != NULL, "Render region NULL in FindFirstForUnclippedInkRender"); 
04130     ENSURE( IsKindOf(CC_RUNTIME_CLASS(Spread)), "Oh No, that's not a spread in FindFirstForUnclippedInkRender" );
04131     // Let FindNextForUnclippedInkRender do all the work 
04132     return FindNextForUnclippedInkRender(pRender);
04133 }

NodeAttribute * Node::FindFirstGeometryLinkedAttr  ) 
 

Definition at line 4423 of file node.cpp.

04424 {
04425     Node* pCurr = FindFirstChild();
04426     while(pCurr)
04427     {
04428         if(pCurr->IsAnAttribute())
04429             if(((NodeAttribute*)pCurr)->IsLinkedToNodeGeometry())
04430                 return (NodeAttribute*) pCurr;
04431 
04432         pCurr = pCurr->FindNext();
04433     }
04434 
04435     return NULL;
04436 }

Node * Node::FindFirstPreorder  ) 
 

Definition at line 3664 of file node.cpp.

03665 {
03666     return this;
03667 }

Node * Node::FindLastChild CCRuntimeClass Class  )  const
 

Find last child of specified type.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/95
Parameters:
Class - class of first child to find [INPUTS]
Returns:
pointer to last child of specified type else NULL

Definition at line 3232 of file node.cpp.

03233 {
03234     Node* pNode = FindFirstChild(); 
03235     Node* pNodeOfGivenClass = NULL;
03236     while (pNode)
03237     {
03238         if (pNode->IsKindOf(Class))
03239             pNodeOfGivenClass = pNode;
03240         pNode = pNode->FindNext(); 
03241     }
03242     return pNodeOfGivenClass; 
03243 }

Node * Node::FindLastChild BOOL  ExcludeInsertionNode = FALSE  )  const
 

This function will return TRUE when called on NodeRenderableBounded nodes and those derived from it. This is the base class version that returns FALSE For finding a node's last child.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
ExcludeInsertionNode,: When TRUE we find the last child excluding the [INPUTS] InsertionNode
- [OUTPUTS]
Returns:
Pointer to the node's last child NULL if the node has no children
See also:
InsertionNode
Returns:
Errors:

Definition at line 3088 of file node.cpp.

03089 {    
03090     Node* n = Child; // First child   
03091     if (n != NULL)
03092     {
03093         while ((n->Next) != NULL)
03094             n = n->Next;              
03095 
03096         if ((ExcludeInsertionNode) && (IS_A(n, InsertionNode)))
03097         {
03098             n = n->Previous; 
03099         }
03100     }
03101     return(n); 
03102 }                      

NodeRenderableInk * Node::FindLastChildInk  )  const
 

Find the last child ink-node. Notes: Analogous to FindLastChild(CC_RUNTIME_CLASS(NodeRenderableInk)), just faster and neater.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/08/2000
See also: FindLastChild(), IsAnObject().

Definition at line 3320 of file node.cpp.

03321 {
03322     Node* pInk = FindLastChild();
03323     while (pInk != NULL && !pInk->IsAnObject())
03324         pInk = pInk->FindPrevious();
03325 
03326     return (NodeRenderableInk*)pInk;
03327 }

Node * Node::FindNext CCRuntimeClass Class  )  const
 

This function follows the node's next links until it finds a node derived from Class. NULL is returned if no node is found.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/3/94
Parameters:
Class,: The node class to look for [INPUTS]
- [OUTPUTS]
Returns:
The next of the node with class Class
See also:
-

Definition at line 3155 of file node.cpp.

03156 {
03157     Node* Current = this->FindNext(); 
03158     while (Current != NULL)
03159     {
03160         if (Current->IsKindOf(Class))
03161         {
03162             return Current; 
03163         }   
03164         Current = Current->FindNext(); 
03165     }
03166     return NULL; 
03167 }

Node * Node::FindNext void   )  const [inline]
 

For finding the next sibling of a node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Returns:
Pointer to the node's next sibling node

Definition at line 1089 of file node.h.

01090 {
01091     return(Next);
01092 }  

Chapter * Node::FindNextChapter void   ) 
 

To find the next chapter in the document tree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/5/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
If the document tree has any more chapter nodes then a pointer to the next chapter node is returned, else NULL is returned.

Definition at line 3813 of file node.cpp.

03814 {                              
03815     const Node* CurrentNode = this->FindNext();   
03816 
03817     while (CurrentNode != NULL)
03818     {                                        
03819         if (CurrentNode->IsChapter())
03820             return ((Chapter*)CurrentNode); 
03821         CurrentNode = CurrentNode->FindNext(); 
03822     }     
03823             
03824     return (NULL); // No chapter found
03825 }               

Node * Node::FindNextDepthFirst Node Subtree  ) 
 

To find the next node in the depth first traversal of the subtree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/5/93
Parameters:
Subtree,: The root of the subtree [INPUTS]
- [OUTPUTS]
Returns:
The next node in a depth-first traversal of the subtree, or NULL if there are no more nodes.
See also:
Node::FindFirstDepthFirst
Returns:
Errors: -

Definition at line 3621 of file node.cpp.

03622 {   
03623     if (this != Subtree)        // There are more nodes in the subtree
03624     {              
03625         Node* CurrentNode = this; 
03626                        
03627         if (CurrentNode->Next != NULL)     // Has this node got any siblings 
03628         {             
03629             CurrentNode = CurrentNode->Next;           
03630         
03631             // Find leftmost child node
03632             while(CurrentNode->Child != NULL)
03633             {
03634                 CurrentNode = CurrentNode->Child; 
03635             }
03636            
03637             return (CurrentNode);
03638         }
03639         else 
03640         {
03641             return (CurrentNode->Parent);
03642         }
03643     }
03644     return (NULL); 
03645 }

Node * Node::FindNextForClippedInkRender DocRect pClipRect,
RenderRegion pRender,
BOOL  ExcludeLockedLayers = FALSE,
Node pStopNode = NULL
 

To traverse the document tree depth first to find the next NodeRenderableInk or NodeAttribute node which needs to be rendered, i.e. in the case of a NodeRenderableInk its bounding rectangle intersects with the current clipping rectangle.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>, Modifioed by Tim & Rik for coordinate conversion
Date:
18/5/93
Parameters:
pClipRect,: The clipping rectangle [INPUTS] pRender: The render region ExcludeLockedLayers: When true objects on locked layers do not get rendered (used for hit detection)
- [OUTPUTS]
Returns:
If the document tree has any more NodeRenderableInk or NodeAttribute nodes which require rendering then a pointer to the next to render is returned, else NULL is returned.
See also:
: Node::FindFirstForClippedInkRender
Returns:
Errors: An assertion failure will occur if LastNode is NULL.

Definition at line 4032 of file node.cpp.

04036 {              
04037     ENSURE(pRender != NULL, "Render region NULL in FindNextForClippedInkRender"); 
04038     Node* pNode = this; 
04039     BOOL IsSpread = pNode->IsSpread();
04040 
04041     do
04042     {
04043         // If this node (which has been rendered) has any children, then those children have
04044         // also been rendered, but they have just gone out of scope, so restore the attribute
04045         // context.
04046         if (!IsSpread && (pNode->Child != NULL))
04047         {
04048             pRender->RestoreContext();
04049         }
04050 
04051 
04052         // If this Node is non-NULL
04053         while (IsSpread || (pNode->Next != NULL))
04054         {
04055             // If this node is not a spread, move to the next sibling.
04056             if (!IsSpread)
04057                 pNode = pNode->Next;
04058 
04059             if (IsSpread || pNode->NeedsToRender(pRender)) //Flags.Required)
04060             {
04061                 // Follow the child links (saving the context as we go) to the deepest child 
04062                 // of this node, and then return this node for rendering.
04063                 // NB. If no children, then this code just returns the current node to render.
04064                 Node *pChild = pNode->FindChildToRender(pClipRect, pRender, ExcludeLockedLayers, pStopNode);
04065 
04066                 if (pChild != NULL)
04067                     return pChild;
04068                 else if (!IsSpread)
04069                     return pNode;
04070                 else
04071                     // Spread has nothing at all to render
04072                     return NULL;
04073             }
04074 
04075             // Definitely not rendering a spread anymore
04076             IsSpread = FALSE;
04077             ENSURE(!pNode->IsKindOf(CC_RUNTIME_CLASS(Spread)),
04078                     "Node should not be a spread!");
04079         }
04080 
04081         // No siblings left to render (i.e. that intersect the clipping rectangle), so
04082         // return to the parent.
04083         pNode = pNode->Parent;
04084 
04085         ENSURE(pNode != NULL, "NULL parent found in FindNextForClippedInkRender");
04086 
04087         // If the parent is NodeRenderableInk or a NodeAttribute (ie renderable), then return it.
04088         if (pNode->IsAnObject() || pNode->IsAnAttribute())
04089             // We want to render this node.
04090             return pNode;
04091 
04092     } while (!pNode->IsSpread());
04093 
04094     // We found no more renderable nodes in this spread, so stop looking.
04095     // If the spread had any children, then FindChildToRender would have called
04096     // SaveContext(), so we call RestoreContext() to balance it.
04097     if (pNode->Child != NULL)
04098         pRender->RestoreContext();
04099 
04100     // All done.
04101     return NULL;
04102 }

NodeRenderablePaper * Node::FindNextForClippedPaperRender void   ) 
 

To traverse the document tree to find the next paper renderable node which needs to be rendered, i.e. its pasteboard rectangle intersects with the current clipping rectangle.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/5/93
Returns:
If the document tree has any more paper renderable nodes which require rendering then a pointer to the next to render is returned, else NULL is returned.
The document tree is searched depth first, visiting parent paper renderables before their children. It is a sort of depth first preorder traversal.

See also:
Node::FindFirstForClippedPaperRender

Definition at line 3851 of file node.cpp.

03852 {                              
03853     Node *pNode = this;
03854 
03855     // If the node is a spread, then search its children for a paper object
03856     if (pNode->IsSpread())
03857     {
03858         pNode = pNode->FindFirstChild();
03859         if (pNode->IsPaper())
03860             return (NodeRenderablePaper *) pNode; // Found a paper object
03861     }
03862 
03863     // Search this node's siblings for another paper object
03864     do 
03865     {
03866         pNode = pNode->FindNext();
03867     }
03868     while ((pNode != NULL) && !pNode->IsPaper());
03869 
03870     // Return pointer to next page, or NULL if no more paper objects left to render.
03871     return ((NodeRenderablePaper *) pNode);
03872 }                               

Node * Node::FindNextForUnclippedInkRender RenderRegion pRender  ) 
 

To traverse the document tree depth first to find the next NodeRenderableInk or NodeAttribute node which needs to be rendered, ignoring the clipping rectangle of the clip region. (i.e. all renderable nodes except those on hidden layers).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/6/95
Parameters:
pRender,: The render region [INPUTS]
Returns:
If the document tree has any more NodeRenderableInk or NodeAttribute nodes which require rendering then a pointer to the next to render is returned, else NULL is returned.
See also:
: Node::FindFirstForUnclippedInkRender
Returns:
Errors: An assertion failure will occur if LastNode is NULL.

Definition at line 4242 of file node.cpp.

04243 {              
04244     ENSURE(pRender != NULL, "Render region NULL in FindNextForUnclippedInkRender"); 
04245     Node* pNode = this; 
04246 
04247     BOOL IsSpread = pNode->IsSpread();
04248 
04249     do
04250     {
04251         // If this node (which has been rendered) has any children, then those children have
04252         // also been rendered, but they have just gone out of scope, so restore the attribute
04253         // context.
04254         if (!IsSpread && (pNode->Child != NULL))
04255             pRender->RestoreContext();
04256 
04257         // If this Node is non-NULL
04258         while (IsSpread || (pNode->Next != NULL))
04259         {
04260             // If this node is not a spread, move to the next sibling.
04261             if (!IsSpread)
04262                 pNode = pNode->Next;
04263 
04264             // Should it be rendered?
04265             BOOL NeedsToRender = IsSpread || pNode->ShouldBeRendered();
04266 
04267             // Special case for layers - don't do hidden layers!
04268             if (pNode->IsLayer())
04269                 NeedsToRender = pNode->NeedsToRender(pRender);          // Clipped!!!
04270 
04271             if (NeedsToRender)
04272             {
04273                 // Follow the child links (saving the context as we go) to the deepest child 
04274                 // of this node, and then return this node for rendering.
04275                 // NB. If no children, then this code just returns the current node to render.
04276                 Node *pChild = pNode->FindChildToRenderUnclipped(pRender);
04277 
04278                 if (pChild != NULL)
04279                     return pChild;
04280                 else if (!IsSpread)
04281                     return pNode;
04282                 else
04283                     // Spread has nothing at all to render
04284                     return NULL;
04285             }
04286 
04287             // Definitely not rendering a spread anymore
04288             IsSpread = FALSE;
04289             ENSURE(!pNode->IsKindOf(CC_RUNTIME_CLASS(Spread)),
04290                     "Node should not be a spread!");
04291         }
04292 
04293         // No siblings left to render (i.e. that intersect the clipping rectangle), so
04294         // return to the parent.
04295         pNode = pNode->Parent;
04296 
04297         ENSURE(pNode != NULL, "NULL parent found in FindNextForClippedInkRender");
04298 
04299         // If the parent is NodeRenderableInk or a NodeAttribute (ie renderable), then return it.
04300         if (pNode->IsAnObject() || pNode->IsAnAttribute())
04301             // We want to render this node.
04302             return pNode;
04303 
04304     } while (!pNode->IsSpread());
04305 
04306     // We found no more renderable nodes in this spread, so stop looking.
04307     // If the spread had any children, then FindChildToRender would have called
04308     // SaveContext(), so we call RestoreContext() to balance it.
04309     if (pNode->Child != NULL)
04310         pRender->RestoreContext();
04311 
04312     // All done.
04313     return NULL;
04314 }

NodeAttribute * Node::FindNextGeometryLinkedAttr  ) 
 

Definition at line 4449 of file node.cpp.

04450 {
04451     Node* pCurr = FindNext();
04452     while(pCurr)
04453     {
04454         if(pCurr->IsAnAttribute())
04455             if(((NodeAttribute*)pCurr)->IsLinkedToNodeGeometry())
04456                 return (NodeAttribute*) pCurr;
04457 
04458         pCurr = pCurr->FindNext();
04459     }
04460 
04461     return NULL;
04462 }

NodeRenderableInk * Node::FindNextInk  )  const
 

Find the next ink node. Notes: Analogous to FindNext(CC_RUNTIME_CLASS(NodeRenderableInk)), just faster and neater.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/08/2000
See also: FindNext(), IsAnObject().

Definition at line 3257 of file node.cpp.

03258 {
03259     Node* pInk = FindNext();
03260     while (pInk != NULL && !pInk->IsAnObject())
03261         pInk = pInk->FindNext();
03262 
03263     return (NodeRenderableInk*)pInk;
03264 }

Node * Node::FindNextNonHidden void   )  const
 

For finding the next sibling of a node (ignoring all NodeHidden nodes).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Pointer to the first next sibling node which is not a NodeHidden
This routine should only be used if it is vital that a NodeHidden is not returned. It is much slower than Node::FindNext.

See also:
Node::FindNext
Returns:
Errors:

Definition at line 3441 of file node.cpp.

03442 {
03443     Node* Current = Next;     
03444     if (Current != NULL)
03445     {
03446         while (Current->IsNodeHidden())
03447         {
03448             Current = Current->Next; 
03449             if (Current == NULL) break;         
03450         } 
03451     }    
03452     return (Current); 
03453 }

Node * Node::FindNextPreorder Node pRoot = NULL,
BOOL  bSkipSubtree = FALSE
 

Definition at line 3686 of file node.cpp.

03687 {
03688     Node* pNode = this;
03689 
03690     // We have visited this, so visit its children, then visit siblings and finally parents siblings
03691     if (pNode->FindFirstChild() && !bSkipSubtree)
03692         return pNode->FindFirstChild();
03693 
03694     if (pNode==pRoot)
03695         return NULL;
03696 
03697     if (pNode->FindNext())
03698         return pNode->FindNext();
03699 
03700     do
03701     {
03702         pNode = pNode->FindParent();
03703         if (pNode==NULL || pNode==pRoot)
03704             return NULL;
03705     }
03706     while (pNode->FindNext()==NULL);
03707 
03708     return pNode->FindNext();
03709 }

BaseDocument * Node::FindOwnerDoc  )  const
 

Find out which document this node is in. This is used to maintain an accurate node count for each document.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/15/95
Returns:
Pointer to the Document that owns this node, or NULL if the node is not in a document.

Definition at line 3343 of file node.cpp.

03344 {
03345     // Find the document this node is attached to - go up the tree until we reach the
03346     // NodeDocument object or we run out of parents (i.e. it's an orphan sub-tree waiting to
03347     // go into a document.
03348     const Node *pNode = this;
03349     while ((pNode != NULL) && (!pNode->IsNodeDocument()))
03350         pNode = pNode->FindParent();
03351 
03352     if (pNode != NULL)
03353         return ((NodeDocument *) pNode)->GetParentDoc();
03354     else
03355         return NULL;
03356 }

Node * Node::FindParent CCRuntimeClass ParentClass  )  const
 

This function follows the node's parent links until it finds a node of class ParentClass. If no such node is found then an ENSURE will occur.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/3/94
Parameters:
ParentClass,: The type of parent that you want to find [INPUTS]
- [OUTPUTS]
Returns:
The parent of the node with class ParentClass In the retail build NULL is returned if the parent could not be found

Errors: If the parent node could not be found then ENSURE is called.

See also:
-

Definition at line 3123 of file node.cpp.

03124 {
03125     Node* Current = this->FindParent(); 
03126     while (Current != NULL)
03127     {
03128         if (Current->GetRuntimeClass() == ParentClass)
03129         {
03130             return Current; 
03131         }   
03132         Current = Current->FindParent(); // Get the next parent
03133     }
03134     //ENSURE(FALSE, "Could not find parent of correct type"); 
03135     return NULL; 
03136 }

Node * Node::FindParent void   )  const [inline]
 

For finding the parent of a node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Returns:
Pointer to the node's parent node

Definition at line 1124 of file node.h.

01125 {         
01126     return(Parent);
01127 }

Node * Node::FindParentOfSelected  ) 
 

To find the node at the normal selection surface from one of its selected-inside children. Note that this routine can be used to test whether a node is "selected-inside" or not by testing whether the Node* returned is NULL or not. (NULL means not selected-inside.).

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The root node of the subtree containing this "selected-inside" node. If this node is not "selected-inside" then NULL is returned.

Definition at line 4394 of file node.cpp.

04395 {
04396     ERROR2IF(this==NULL,NULL,"FindParentOfSelected called on NULL node.");
04397 
04398     Node* pParentOf = NULL;
04399     Node* pParent = Parent;
04400     while ( pParent!=NULL && !pParent->IsLayer() )
04401     {
04402         pParentOf = pParent;                    // Record last parent before we reached the Layer
04403         pParent = pParent->Parent;              // Find it's parent.
04404     }
04405     ERROR3IF(pParent==NULL,"Node doesn't seem to be in a layer!");
04406 
04407     return pParentOf;
04408 }

Spread * Node::FindParentSpread  ) 
 

Find the spread node to which this node is ultimately attached.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/93
Returns:
Parent spread node, or NULL if no such parent can be found..

Errors: ENSUREs if no parent spread is found.

Definition at line 3726 of file node.cpp.

03727 {
03728     ERROR2IF(this==NULL, NULL, "NULL node in Node::FindParentSpread");
03729     ENSURE(!IsKindOf(CC_RUNTIME_CLASS(Spread)), "A spread cannot contain a spread");
03730 
03731     Node *pNode = this;
03732 
03733     // Search up the tree for the parent spread
03734     while ((pNode != NULL) && !pNode->IsSpread())
03735         pNode = pNode->Parent;
03736 
03737     ENSURE(pNode != NULL, "No parent spread found in Node::FindParentSpread");
03738 
03739     return (Spread *) pNode;
03740 }

Node * Node::FindPrevious CCRuntimeClass Class  )  const
 

This function follows the node's Previous links until it finds a node derived from Class. NULL is returned if no node is found.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/3/94
Parameters:
Class,: The node class to look for [INPUTS]
- [OUTPUTS]
Returns:
The Previous of the node with class Class
See also:
-

Definition at line 3185 of file node.cpp.

03186 {
03187     Node* Current = this->FindPrevious(); 
03188     while (Current != NULL)
03189     {
03190         if (Current->IsKindOf(Class))
03191         {
03192             return Current; 
03193         }   
03194         Current = Current->FindPrevious(); 
03195     }
03196     return NULL; 
03197 }

Node * Node::FindPrevious void   )  const [inline]
 

For finding the previous sibling of a node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Returns:
Pointer to the node's previous sibling node

Definition at line 1107 of file node.h.

01108 {                 
01109     return(Previous);
01110 }

NodeRenderableInk * Node::FindPreviousInk  )  const
 

Find the previous ink node. Notes: Analogous to FindPrevious(CC_RUNTIME_CLASS(NodeRenderableInk)), just faster and neater.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/08/2000
See also: FindPrevious(), IsAnObject().

Definition at line 3278 of file node.cpp.

03279 {
03280     Node* pInk = FindPrevious();
03281     while (pInk != NULL && !pInk->IsAnObject())
03282         pInk = pInk->FindPrevious();
03283 
03284     return (NodeRenderableInk*)pInk;
03285 }

Node * Node::FindPrevNonHidden void   )  const
 

For finding the previous sibling of a node (ignoring all NodeHidden nodes).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Pointer to the first previous sibling node which is not a NodeHidden
This routine should only be used if it is vital that a NodeHidden is not returned. It is much slower than Node::FindPrevious.

See also:
Node::FindPrevious
Returns:
Errors:

Definition at line 3474 of file node.cpp.

03475 {
03476     Node* Current = Previous;     
03477     if (Current != NULL)
03478     {
03479         while (Current->IsNodeHidden())
03480         {
03481             Current = Current->Previous; 
03482             if (Current == NULL) break;         
03483         } 
03484     }    
03485     return (Current);   
03486 }  

CopyType Node::GetCopyType  )  [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 in NodeBlendPath, NodeMouldPath, VisibleTextNode, and TextLine.

Definition at line 1689 of file node.cpp.

01690 {
01691     return SIMPLECOPY;
01692 }

virtual TCHAR* Node::GetDefaultOpToken  )  [inline, virtual]
 

Reimplemented in NodeBitmap.

Definition at line 544 of file node.h.

00544 {return NULL;}

virtual double Node::GetEffectiveBitmapMinDPI KernelBitmap pBitmap  )  [inline, virtual]
 

Reimplemented in AttrBitmapFill, and NodeBitmap.

Definition at line 538 of file node.h.

00538 { return(1e9); }

UINT32 Node::GetHiddenCnt void   ) 
 

For finding out how many hidden nodes reffer to the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The number of hidden nodes which refer to the node.

Errors: -

See also:
-

Definition at line 4689 of file node.cpp.

04690 {
04691     return (HiddenRefCnt); 
04692 } 

UINT32 Node::GetNodeSize  )  const [virtual]
 

For finding the size of a node, in concrete classes derived from Node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes

Errors: If this function has not been overloaded in a non-abstract class then an ENSURE failure will occur.

See also:
-

Reimplemented in AttrBevelIndent, AttrBevelLightAngle, AttrBevelContrast, AttrBevelType, AttrBevelLightTilt, AttrBrushType, Chapter, StartDocument, EndDocument, AttrFlatColourFill, AttrFlatTranspFill, AttrLinearColourFill, AttrLinearTranspFill, AttrRadialColourFill, AttrRadialTranspFill, AttrConicalColourFill, AttrConicalTranspFill, AttrSquareColourFill, AttrSquareTranspFill, AttrThreeColColourFill, AttrThreeColTranspFill, AttrFourColColourFill, AttrFourColTranspFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrFractalColourFill, AttrNoiseColourFill, AttrFractalTranspFill, AttrNoiseTranspFill, AttrFillMappingLinear, AttrFillMappingSin, AttrFillEffectFade, AttrFillEffectRainbow, AttrFillEffectAltRainbow, AttrTranspFillMappingLinear, AttrTranspFillMappingSin, AttrMould, NodeGrid, NodeGridRect, NodeGridIso, NodeGroup, InsertionNode, AttrOverprintLine, AttrOverprintFill, AttrPrintOnAllPlates, Layer, AttrLineWidth, AttrStrokeColour, AttrStrokeTransp, AttrStartArrow, AttrEndArrow, AttrStartCap, AttrJoinType, AttrMitreLimit, AttrWindingRule, AttrDashPattern, NodeBrushMaker, NodeClipViewController, NodeMouldGroup, NodeMouldBitmap, NodeSetProperty, NodeBarProperty, NodeSetSentinel, NodeHidden, NodeAnimatingBitmap, NodeBlender, NodeBlend, NodeBitmap, NodeClipView, NodeDocument, NodeEllipse, NodeLiveEffect, NodeLockedEffect, NodeFeatherEffect, NodeMoulder, NodeMould, NodePath, NodeRect, NodeRegularShape, NodeSimpleShape, VisibleTextNode, AbstractTextChar, TextChar, KernCode, HorizontalTab, CaretNode, EOLNode, TextLine, TextStory, Page, AttrQuality, Spread, AttrStrokeType, AttrVariableWidth, AttrTxtFontTypeface, AttrTxtBold, AttrTxtItalic, AttrTxtUnderline, AttrTxtAspectRatio, AttrTxtJustification, AttrTxtTracking, AttrTxtFontSize, AttrTxtScript, AttrTxtBaseLine, AttrTxtLeftMargin, AttrTxtRightMargin, AttrTxtFirstIndent, AttrTxtRuler, AttrTxtLineSpace, AttrUser, and AttrWebAddress.

Definition at line 1973 of file node.cpp.

01974 {     
01975     //ENSURE(FALSE, "Pseudo pure virtual GetSize() function called");  
01976     //return (0); 
01977     return sizeof(*this);
01978 }  

OpPermissionState Node::GetOpPermission  )  [virtual]
 

Use this to access the node's permission flags to find out if the current op is doable to this node.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/02/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Returns the op perission state for this node.
PERMISSION_UNDEFINED means no op has explicitly asked this node for permission so go ahead PERMISSION_DENIED means the current op should not touch this node. PERMISSION_ALLOWED means the nice op asked and the node said YES!

Range uses this value to decide whether a node is in the range. A node is not in the range is its permission value is PERMISSION_DENIED, otherwise it is in the range (RangeControlFlags permitting that is)

This state should be set via the AllowOp() function, using the most appropriate out of Node and Range's varients.

See also:
SetOpPermission();

Definition at line 5003 of file node.cpp.

05004 {
05005     if (!Flags.OpPermission1)
05006     {
05007         if (!Flags.OpPermission2)
05008             return PERMISSION_DENIED;
05009         else
05010             return PERMISSION_ALLOWED;
05011     }
05012     else
05013         return PERMISSION_UNDEFINED;
05014 }

virtual NodeCompound* Node::GetParentController  )  const [inline, virtual]
 

Reimplemented in NodeBevel, NodeBlend, NodeContour, and NodeCompound.

Definition at line 653 of file node.h.

00653 {return NULL;}  // Implement if your node was created by a PostProcessor of some sort

UINT32 Node::GetSubtreeSize  ) 
 

For finding the size of this subtree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the subtree in bytes
See also:
-

Definition at line 1995 of file node.cpp.

01996 {   
01997     UINT32 Total = 0; 
01998     Node* Current = this->FindFirstDepthFirst();         
01999     while (Current != NULL)
02000     {
02001         Total += Current->GetNodeSize(); 
02002         Current = Current->FindNextDepthFirst(this); 
02003     } 
02004     return Total; 
02005 }  

UINT32 Node::GetTag  )  const [inline]
 

For finding a nodes TAG, which is a unique identifier for each node stored within a document.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Tag field of the node

Errors: -

Definition at line 886 of file node.h.

00887 { 
00888     return Tag; 
00889 }       

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

This function allows compound objects to provide editable children. It also allows tools to ask an object what other nodes form part of its editable surface if the node itself cannot be editable. This allows complex objects such as moulds and text objects, who have a single parent above many objects (some of which are editable), to provide a way for tools to get at them. A tool scanning the selection may be looking to edit certain objects. If a selected object it comes accross is not of the correct type, the tool can also ask it whether it contains any editable objects of type(ChildClass). If the node overrides this virtual function it can provide a strangly shapes editable surface. Note, do not confuse this with select inside, where objects have been explicitly selected by the user. In that case the parent would never be asked for editable children as it does not form part of the selection under a select inside action.

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).

Errors: -

Reimplemented in NodeBlend, NodeBrush, and NodeMould.

Definition at line 2843 of file node.cpp.

02844 {
02845     return NULL;
02846 }

BOOL Node::HasSelectedChildren  )  const
 

To find out whether a node has got selected children or children that themselves have selected children... Helper function for SetSelected Scope: Private.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this node has selected or ParentOfSelected nodes in it's child list FALSE otherwise

Errors: -

See also:
Node::SetSelected

Definition at line 3033 of file node.cpp.

03034 {
03035     ERROR2IF(this==NULL,FALSE,"HasSelectedChildren called on NULL node.");  // Precondition
03036 
03037 //  BOOL    has = FALSE;
03038     Node*   pNode = Child;
03039     while (pNode!=NULL)                                     // While there are children to process
03040     {
03041         if (pNode->Flags.Selected ||
03042             pNode->Flags.SelectedChildren)                  // See if this child is Sel or SelChildren
03043             return TRUE;                                    // If so, then return TRUE immediately!
03044         pNode = pNode->Next;                                // Else go look for next child
03045     }
03046 
03047     return FALSE;                                           // If no children Sel or SelChildren then
03048                                                             // Return FALSE.
03049 }

BOOL Node::HasThisChildAttr NodeAttribute pAttr  )  [virtual]
 

This scans the child sibling list of this node, to see if it contains an attribute that's exactly the same as the given one.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/8/96
Parameters:
pAttr = ptr to an attribute [INPUTS]
Returns:
TRUE if it does contain an exact replica, FALSE otherwise
If does **not** do any extra tree traversal - only immediate child attrs of this node compared

See also:
-

Definition at line 6070 of file node.cpp.

06071 {
06072     ERROR2IF(pAttr == NULL,FALSE,"NULL attr ptr");
06073 
06074     Node* pNode = FindFirstChild();
06075     while (pNode != NULL)
06076     {
06077         if (pNode->IsAnAttribute())
06078         {
06079             NodeAttribute* pOtherAttr = (NodeAttribute*)pNode;
06080 
06081             if (pAttr->GetAttributeType() == pOtherAttr->GetAttributeType())
06082             {
06083                 if (*pAttr == *pOtherAttr)
06084                     return TRUE;
06085             }
06086         }
06087 
06088         pNode = pNode->FindNext();
06089     }
06090 
06091     return FALSE;
06092 }

BOOL Node::HidingNode  )  [virtual]
 

Useful for debugging - actually, it only exists in the debug build.This virtual function is called whenever the node is hidden. It allows the node do things like 'optimise' itself to use less memory or send a message to let others know it's is being hidden etc.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/11/94
Returns:
TRUE if all was ok. FALSE if an error occured.
ALWAYS CALL THE BASE CLASS' FUNCTION FROM YOUR OVERRIDDEN FUNCTION.

Reimplemented in AttrBitmapFill, AttrFractalFill, Layer, NodeMouldGroup, NodeBlender, NodeBlend, NodeBitmap, and TextStory.

Definition at line 4734 of file node.cpp.

04735 {
04736     return TRUE;
04737 }

void Node::IncHiddenCnt void   ) 
 

Increments the count of the number of NodeHidden nodes which reffer to the node. This routine should only be called from the NodeHidden methods.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 4646 of file node.cpp.

04647 {                               
04648     HiddenRefCnt++; 
04649 }                   

void Node::InsertChainSimple Node ContextNode,
AttachNodeDirection  Direction
 

Inserts a chain of nodes at contextnode. A chain is an unconnected set of siblings. This function should be called from the first node (left most) in the chain. It doesn't do anything fancy - in fact, little more than changing a few pointers here and there.

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
29 03 95
Parameters:
ContextNode - the node to attach under or after [INPUTS] Direction - where to attach it
- [OUTPUTS]
Returns:
-
See also:
AttachNode();

Definition at line 5338 of file node.cpp.

05339 {
05340     ERROR3IF(Previous != 0, "Node is not first in the chain");
05341 
05342     if(Direction == FIRSTCHILD)
05343     {
05344         Node *N = this; // will be the last chain in node
05345         Node *Last = NULL;
05346 
05347         // shoot though the chain setting parent pointers and find the last one
05348         while(N != 0)
05349         {
05350             N->Parent = ContextNode;
05351             Last = N;
05352             N = N->FindNext();
05353         }
05354 
05355         Last->Next = ContextNode->Child;
05356         ContextNode->Child = this;
05357     } else if(Direction == LASTCHILD)
05358     {
05359         if(ContextNode->Child != 0)
05360         {
05361             Node *End = ContextNode->FindLastChild();
05362         
05363             ERROR3IF(End->Next != 0, "Last child has next pointer");        
05364 
05365             End->Next = this;
05366             Previous = End;
05367         } else {
05368             ContextNode->Child = this;
05369         }
05370 
05371         Node *N = this;
05372 
05373         // shoot though the chain setting parent pointers
05374         while(N != 0)
05375         {
05376             N->Parent = ContextNode;
05377             N = N->FindNext();
05378         }
05379     } else {
05380         ERROR3("Direction not implemented yet in Node::InsertChainSimple");
05381     }
05382 }

virtual BOOL Node::IsABaseTextClass  )  const [inline, virtual]
 

Reimplemented in BaseTextClass.

Definition at line 489 of file node.h.

00489 {return FALSE;}

virtual BOOL Node::IsABevel  )  const [inline, virtual]
 

Reimplemented in NodeBevel.

Definition at line 495 of file node.h.

00495 { return FALSE; } 

virtual BOOL Node::IsABevelController  )  const [inline, virtual]
 

Definition at line 496 of file node.h.

00496 { return FALSE; } 

virtual BOOL Node::IsABitmap  )  const [inline, virtual]
 

Reimplemented in NodeBitmap.

Definition at line 473 of file node.h.

00473 {return FALSE;}

virtual BOOL Node::IsABitmapColourFill  )  const [inline, virtual]
 

Reimplemented in AttrBitmapColourFill.

Definition at line 476 of file node.h.

00476 {return FALSE;}

virtual BOOL Node::IsABitmapFill  )  const [inline, virtual]
 

Reimplemented in AttrBitmapFill, AttrBitmapColourFill, and NodeAttribute.

Definition at line 475 of file node.h.

00475 {return FALSE;}

virtual BOOL Node::IsABitmapTranspFill  )  const [inline, virtual]
 

Reimplemented in AttrBitmapTranspFill.

Definition at line 477 of file node.h.

00477 {return FALSE;}

virtual BOOL Node::IsABlend  )  [inline, virtual]
 

Reimplemented in NodeBlend.

Definition at line 483 of file node.h.

00483 { return FALSE; }

virtual BOOL Node::IsABrush  )  const [inline, virtual]
 

Reimplemented in AttrBrushType.

Definition at line 501 of file node.h.

00501 {return FALSE;}

virtual BOOL Node::IsAClipViewAttr  )  const [inline, virtual]
 

Reimplemented in AttrClipView.

Definition at line 479 of file node.h.

00479 { return FALSE; }

virtual BOOL Node::IsAContour  )  const [inline, virtual]
 

Reimplemented in NodeContour.

Definition at line 497 of file node.h.

00497 { return FALSE; } 

virtual BOOL Node::IsAContourController  )  const [inline, virtual]
 

Reimplemented in NodeContourController.

Definition at line 498 of file node.h.

00498 { return FALSE; } 

virtual BOOL Node::IsAFeatherAttr  )  const [inline, virtual]
 

Reimplemented in AttrFeather.

Definition at line 478 of file node.h.

00478 { return FALSE; }

virtual BOOL Node::IsAFillAttr  )  const [inline, virtual]
 

Reimplemented in AttrFillGeometry.

Definition at line 474 of file node.h.

00474 {return FALSE;}

virtual BOOL Node::IsAGroup  )  const [inline, virtual]
 

Reimplemented in NodeGroup.

Definition at line 515 of file node.h.

00515 { return FALSE; }

virtual BOOL Node::IsAnAbstractTextChar  )  const [inline, virtual]
 

Reimplemented in AbstractTextChar.

Definition at line 487 of file node.h.

00487 {return FALSE;}

virtual BOOL Node::IsAnAttribute  )  const [inline, virtual]
 

Reimplemented in NodeAttribute.

Definition at line 461 of file node.h.

00461 {return FALSE;}

NodePath * Node::IsAnEditablePath  )  [virtual]
 

Determine if a node is *derived* from the NodeHidden class.Determine if a node is a NodeDocument object.Determine if a node is a NodePath object.Determine if a node is a QuickShape object.Determine if a node is a visible text node.Determine if a node is an AbstractTextChar node. Determine if a node is a (or is derived from) TextChar. Determine if a node is a (or is derived from) BaseTextClass. Determine if a node is a (or is derived from) AttrTxtFontTypeface. Finds the node to edit (if it exists). This node could actually be 'this' node one of its children which the node wants to be editable.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/3/95
Parameters:
pSelected = A pointer to the selected node to check [INPUTS]
- [OUTPUTS]
Returns:
A pointer to an editable node path (or derived) object NULL if there isn't one.

Definition at line 2500 of file node.cpp.

02501 {
02502     Node* pNode = this;
02503     if (pNode->IsNodePath())
02504         return ((NodePath*)pNode);
02505 
02506     return ((NodePath*) pNode->HasEditableChild(CC_RUNTIME_CLASS(NodePath), NULL));
02507 }

virtual BOOL Node::IsAnInsertionNode  )  const [inline, virtual]
 

Reimplemented in InsertionNode.

Definition at line 518 of file node.h.

00518 { return FALSE; }

virtual BOOL Node::IsAnObject  )  const [inline, virtual]
 

Reimplemented in NodeRenderableInk.

Definition at line 460 of file node.h.

00460 {return FALSE;}

virtual BOOL Node::IsAnObjectName  )  const [inline, virtual]
 

Reimplemented in TemplateAttribute.

Definition at line 491 of file node.h.

00491 {return FALSE;}

virtual BOOL Node::IsANodeClipView  )  const [inline, virtual]
 

Reimplemented in NodeClipView.

Definition at line 512 of file node.h.

00512 { return FALSE; }

virtual BOOL Node::IsANodeClipViewController  )  const [inline, virtual]
 

Reimplemented in NodeClipViewController.

Definition at line 511 of file node.h.

00511 { return FALSE; }

virtual BOOL Node::IsANodeMould  )  const [inline, virtual]
 

Reimplemented in NodeMould.

Definition at line 521 of file node.h.

00521 {return FALSE;}

virtual BOOL Node::IsARegularShape  )  const [inline, virtual]
 

Reimplemented in NodeRegularShape.

Definition at line 471 of file node.h.

00471 {return FALSE;}

virtual BOOL Node::IsAShadow  )  const [inline, virtual]
 

Definition at line 499 of file node.h.

00499 { return FALSE; } 

virtual BOOL Node::IsAShadowController  )  const [inline, virtual]
 

Definition at line 500 of file node.h.

00500 { return FALSE; } 

virtual BOOL Node::IsATextChar  )  const [inline, virtual]
 

Reimplemented in TextChar.

Definition at line 488 of file node.h.

00488 {return FALSE;}

virtual BOOL Node::IsATypeface  )  const [inline, virtual]
 

Reimplemented in AttrTxtFontTypeface.

Definition at line 490 of file node.h.

00490 {return FALSE;}

virtual BOOL Node::IsAVisibleTextNode  )  const [inline, virtual]
 

Reimplemented in VisibleTextNode.

Definition at line 486 of file node.h.

00486 {return FALSE;}

virtual BOOL Node::IsBitmapEffect  )  const [inline, virtual]
 

Reimplemented in NodeBitmapEffect.

Definition at line 503 of file node.h.

00503 {return FALSE;}

virtual BOOL Node::IsBounded  )  const [inline, virtual]
 

Reimplemented in NodeRenderableBounded.

Definition at line 480 of file node.h.

00480 {return FALSE;}

BOOL Node::IsBrushed  )  const
 

Quicker way to test if this node is a bitmap. Virtual function for determining if the node is a Fill attribute Virtual function for determining if the node is a Fill attribute Virtual function for determining if the node is a Fill attribute Virtual function for determining if the node is a Fill attribute Quicker way to test if this node is an object-name attribute. Quicker way to test if this node is an AttrUser. Quicker way to test if this node is worth considering during Name gallery scans. Virtual function to determine whether this node is a NodeMould.Virtual function for determing whether this node is a brush attribute as above.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/11/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this node has a brush attribute node as one of its children

Errors: See Also; brshattr.cpp

Definition at line 2696 of file node.cpp.

02697 {
02698     NodeAttribute* pAttr = FindFirstAttr( &Node::IsABrush );
02699     return (pAttr != NULL);
02700 }

virtual BOOL Node::IsCacheCompound  )  const [inline, virtual]
 

Definition at line 494 of file node.h.

00494 { return FALSE; } 

virtual BOOL Node::IsChapter  )  const [inline, virtual]
 

Reimplemented in Chapter.

Definition at line 466 of file node.h.

00466 {return FALSE;}

BOOL Node::IsChildOfSelected  ) 
 

For finding out whether this node has a selected parent. Note: If a group (node) of a number of objects is selected then only the group node itself has the selected flag set. Any children of this group, i.e. objects in the group would also be deemed selected but would not have the selected bit set. This routine is based on the routine View::IsPrintableNodeSelected and just searches up until it finds a layer. If by then it has found a selected flag then its parent must be selected and hence it is.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/9/95
Returns:
TRUE if the node has a selected parent. FALSE otherwise
See also:
View::IsPrintableNodeSelected;

Definition at line 2026 of file node.cpp.

02027 { 
02028     // We must check the selected status of this node.
02029     // Even if this node is not selected, its parent might be, so we
02030     // scan upwards until we find a layer, or a selected node.
02031     Node *pTestNode = this;
02032     while ((pTestNode != NULL) && 
02033            (!pTestNode->IsSelected()) && 
02034            (!pTestNode->IsLayer()))
02035     {
02036         pTestNode = pTestNode->FindParent();
02037     }
02038 
02039     // Ok, what did we find?
02040     return ((pTestNode != NULL) && pTestNode->IsSelected());
02041 }  

virtual BOOL Node::IsCompound  )  const [inline, virtual]
 

Reimplemented in NodeCompound, TextLine, and TextStory.

Definition at line 484 of file node.h.

00484 {return FALSE;} 

virtual BOOL Node::IsCompoundClass  )  const [inline, virtual]
 

Reimplemented in NodeCompound.

Definition at line 485 of file node.h.

00485 {return FALSE;} 

virtual BOOL Node::IsController  )  [inline, virtual]
 

Reimplemented in NodeContourController, NodeClipViewController, and NodeEffect.

Definition at line 482 of file node.h.

00482 { return FALSE;}

BOOL Node::IsDifferent Node pOther  )  [virtual]
 

Determine if 2 nodes are considered different.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/2/97
Parameters:
pOther - The node to compare this one to [INPUTS]
Returns:
TRUE if this is considered different from pOther, FALSE if they are the same
Notes: **** IMPORTANT - May not function well enough for your needs! ****

This was written to allow the StrokeComponent class to merge stroke definitions which share identical clipart subtrees. Stroke subtrees are special in that they have had Make Shapes applied to them, and so only contain paths. Hence, I have only defined functions in Node, NodeRenderableBounded, and NodePath - most objects in the tree thus use base class functionality (are they of the same class, and do they have identical bounding boxes). This suffices for my needs, but you may need to implement this function for a lot more node types before it's of use to you.

Reimplemented in NodeRenderableBounded, NodeAttribute, and NodePath.

Definition at line 6216 of file node.cpp.

06217 {
06218     // The base class merely checks that the 2 objects are of the same class
06219     if (GetRuntimeClass() != pOther->GetRuntimeClass())
06220         return(TRUE);
06221 
06222     // If they're the same type, then as far as we know, they're the same.
06223     // Derived classes will override this function to do a better check.
06224     return(FALSE);
06225 }

virtual BOOL Node::IsDragged  )  const [inline, virtual]
 

Reimplemented in NodeRenderable.

Definition at line 481 of file node.h.

00481 {return FALSE; }

virtual BOOL Node::IsEffect  )  const [inline, virtual]
 

Reimplemented in NodeEffect.

Definition at line 502 of file node.h.

00502 {return FALSE;}

BOOL Node::IsFamily CCRuntimeClass ccrcType,
Node pAncestor
const
 

Basically, we're looking for a child-parent-grandparent relationship. We're the child and our parent can also be the grandparent.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
19 April 2000
Parameters:
ccrcType the type to test for. [INPUTS] pAncestor the grandparent node we're looking for.
[OUTPUTS] 
Returns:
TRUE if one of our parent nodes is of the given type, and either _it_, or one of its parents, is the given ancestor node. FALSE otherwise.
Notes: If pAncestor points at us, then this fails the test, so you get FALSE.

Returns:
Errors: In debug, we complain if any input parameter is NULL, in release we just return FALSE.

Definition at line 3382 of file node.cpp.

03383 {
03384     // fairly naive algorithm - just get the next ccrcType node and check its parents against
03385     // pAncestor. could probably improve slightly by checking for ccrcType while we do the
03386     // grandparent check.
03387 
03388     // input validation.
03389     if (ccrcType == NULL || pAncestor == NULL)
03390     {
03391         ERROR3("Node::IsFamily; NULL input parameters!");
03392         return FALSE;
03393     }
03394 
03395     // local variables.
03396     Node* pParent       = NULL;
03397     Node* pGrandParent  = NULL;
03398 
03399     // loop on all our parents of type ccrcType.
03400     pParent = FindParent(ccrcType);
03401     while (pParent != NULL && pGrandParent != pAncestor)
03402     {
03403         // loop up the tree from pParent, looking for pAncestor.
03404         pGrandParent = pParent;
03405         while (pGrandParent != NULL && pGrandParent != pAncestor)
03406             pGrandParent = pGrandParent->FindParent();
03407 
03408         // if we haven't found a grandparent, then find the next parent of type ccrcTest.
03409         if (pGrandParent == NULL)
03410             pParent = pParent->FindParent(ccrcType);
03411     }
03412 
03413     // we were successful if we found a grandparent.
03414     return (pGrandParent != NULL);
03415 }

virtual BOOL Node::IsKindOfTextAttribute  )  const [inline, virtual]
 

Reimplemented in AttrTxtBase.

Definition at line 462 of file node.h.

00462 { return FALSE; }

virtual BOOL Node::IsLayer  )  const [inline, virtual]
 

Reimplemented in Layer.

Definition at line 464 of file node.h.

00464 {return FALSE;}

BOOL Node::IsLocked void   )  const [inline]
 

For finding the status of the nodes locked flag.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is locked, and FALSE if the node is not locked.

Errors:

Reimplemented in Layer.

Definition at line 906 of file node.h.

00907 { 
00908     return Flags.Locked; 
00909 } 

BOOL Node::IsMangled void   )  const [inline]
 

For finding the status of the nodes mangled flag.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is mangled, and FALSE if the node is not mangled.

Errors:

Definition at line 926 of file node.h.

00927 { 
00928     return Flags.Mangled; 
00929 } 

BOOL Node::IsMarked void   )  const [inline]
 

For finding the status of the nodes marked flag.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is marked, and FALSE if the node is not marked.

Errors:

Definition at line 946 of file node.h.

00947 { 
00948     return Flags.Marked; 
00949 } 

virtual BOOL Node::IsNodeDocument  )  const [inline, virtual]
 

Reimplemented in NodeDocument.

Definition at line 467 of file node.h.

00467 {return FALSE;}

virtual BOOL Node::IsNodeHidden  )  const [inline, virtual]
 

Reimplemented in NodeHidden.

Definition at line 469 of file node.h.

00469 {return FALSE;}

BOOL Node::IsNodeInSubtree Node pChildNode  )  [virtual]
 

Checks the parents of the given node, to see whether it lies within this node's subtree.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/07/2000
Parameters:
pChildNode the node to test. [INPUTS]
Returns:
TRUE if the given node lies in the subtree beneath this node. FALSE otherwise or if the given node is NULL or if it *is* this node.

Definition at line 6038 of file node.cpp.

06039 {
06040     // we return FALSE if pChildNode is this node, or is NULL.
06041     if (pChildNode == this || pChildNode == NULL)
06042         return FALSE;
06043 
06044     // check each of pNode's parents.
06045     while (pChildNode != NULL && pChildNode != this)
06046         pChildNode = pChildNode->FindParent();
06047 
06048     // we only return TRUE if we hit this Node, travelling up from pChildNode.
06049     return (pChildNode == this);
06050 }

virtual BOOL Node::IsNodePath  )  const [inline, virtual]
 

Reimplemented in NodeBevel, and NodePath.

Definition at line 470 of file node.h.

00470 {return FALSE;}

virtual BOOL Node::IsNodeRenderableClass  )  const [inline, virtual]
 

Reimplemented in NodeRenderable.

Definition at line 468 of file node.h.

00468 {return FALSE;}

virtual BOOL Node::IsOrHidesAnAttribute  )  const [inline, virtual]
 

Reimplemented in NodeHidden, and NodeAttribute.

Definition at line 472 of file node.h.

00472 {return FALSE;}

virtual BOOL Node::IsPaper  )  const [inline, virtual]
 

Reimplemented in StartDocument, EndDocument, and NodeRenderablePaper.

Definition at line 463 of file node.h.

00463 {return FALSE;}

BOOL Node::IsParentOfSelected  )  const [inline]
 

For finding the status of the nodes SelectedChildren flag Note: When this function returns TRUE it is not guaranteed that there will be selected children - there may be none!

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node *may* have selected children. FALSE otherwise

Errors:

Definition at line 1009 of file node.h.

01010 { 
01011     return Flags.SelectedChildren; 
01012 }  

BOOL Node::IsRenderable  )  const [inline]
 

For finding the status of the nodes renderable flag.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is renderable, and FALSE if the node is not renderable.

Errors:

Definition at line 966 of file node.h.

00967 { 
00968     return Flags.Renderable; 
00969 }

virtual BOOL Node::IsRenderedAsInk  )  const [inline, virtual]
 

Reimplemented in NodeGrid, NodeRenderableInk, and NodeAttribute.

Definition at line 504 of file node.h.

00504 {return FALSE;}

BOOL Node::IsSelected  )  const [inline]
 

For finding the status of the nodes selected flag.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is selected, and FALSE if the node is not selected.

Errors:

Definition at line 986 of file node.h.

00987 { 
00988     return Flags.Selected; 
00989 }  

virtual BOOL Node::IsSetCandidate  )  const [inline, virtual]
 

Reimplemented in NodeRenderableInk, NodeSetSentinel, TextChar, TextLine, BaseTextClass, and TextStory.

Definition at line 493 of file node.h.

00493 {return FALSE;}

virtual BOOL Node::IsSpread  )  const [inline, virtual]
 

Reimplemented in Spread.

Definition at line 465 of file node.h.

00465 {return FALSE;}

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

Reimplemented in AttrFillGeometry, AttrBitmapFill, NodeContourController, NodeMouldGroup, NodeHidden, NodeBevel, NodeBlend, NodeContour, NodeMould, NodePath, NodeRegularShape, NodeSimpleShape, and TextStory.

Definition at line 854 of file node.h.

00854 { return FALSE; }

BOOL Node::IsUnder Node pTestNode,
BOOL  bFirstCall = TRUE
const
 

For finding out whether this node is under another node. Where "under" is defined as being before it in rendering order. To find the answer quickly without scanning the entire tree, we will find the common root node of both this and pNode and find out whether the child links from that node lead down to this node first or pTestNode first. (Because if my parent is under the test node then so am I) Do this recursively so that state is held on the stack, not in the tree Clever, huh? There is some strictly unneccessary work done in finding the common ancestor in this implementation but it's the best compromise that is both reasonably fast and completely stateless.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/2004
Parameters:
pTestNode - pointer to node to test against [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this node is "under" the specified node. FALSE otherwise
See also:
-

Definition at line 2068 of file node.cpp.

02069 {
02070     ENSURE(this, "IsUnder called on NULL");
02071     if (this==NULL)
02072         return FALSE;
02073 
02074     if (bFirstCall && this==pTestNode)
02075         return FALSE;
02076 
02077     Node* pMyParent = FindParent();
02078     Node* pTestParent = pTestNode->FindParent();
02079     Node* pChild = pTestNode;
02080 
02081     ENSURE(pTestNode, "IsUnder called with NULL pointer to test");
02082     ENSURE(this!=pTestNode, "IsUnder called with pointer to this");
02083     ENSURE(pMyParent, "IsUnder can't find parent of this");
02084 
02085 //  ENSURE(HiddenRefCnt==0, "IsUnder called on hidden node(s)");
02086 
02087     if (pTestNode == pMyParent)                     // If the test node is one of my ancestors
02088         return TRUE;                                // Then I am under it (in render order)
02089 
02090     // Scan up from the test node, checking for the common ancestor
02091     while (pTestParent)
02092     {
02093 //      ENSURE(pTestParent->HiddenRefCnt==0, "IsUnder called on hidden node(s)");
02094 
02095         if (pTestParent == pMyParent)
02096         {
02097             // Found the common ancestor!
02098             // Now compare positions in the sibling list
02099 // This commented out code is the naive version
02100 //          Node* pNode = (Node*)this;
02101 //          while (pNode && pNode != pChild)
02102 //              pNode = pNode->FindNext();
02103 //
02104 //          return (pNode!=NULL);                   // If we found the test node then we are under it
02105 //                                                  // If we didn't, then we are above it
02106 
02107             // This is a more optimised version
02108             // We can quickly detect whether testnode is
02109             // first in sibling list
02110             if (pChild==pTestParent->FindFirstChild())  // If the test node is the first child
02111                 return (pChild==this);                  // Then we're under it if we're the test node
02112                                                         // And above it if we're not the test node
02113 
02114             // Work in both directions at the same time because, typically
02115             // the test node is very close to this node, so we're likely to hit
02116             // it quickly in one direction or the other...
02117             Node* pNodeF = (Node*)this;             // Forwards
02118             Node* pNodeB = (Node*)this;             // Backwards
02119             while ((pNodeF || pNodeB) && pNodeF != pChild && pNodeB!=pChild)
02120             {
02121                 pNodeF ? pNodeF = pNodeF->FindNext() : NULL;
02122                 pNodeB ? pNodeB = pNodeB->FindPrevious() : NULL;
02123             }
02124 
02125             return (pNodeF==pChild);                // If we found the test node in the forward direction
02126                                                     // Then we are underneath it, otherwise we are on top
02127         }
02128 
02129         pChild = pTestParent;
02130         pTestParent = pTestParent->FindParent();
02131     }
02132 
02133     // If the common ancestor wasn't our immediate parent
02134     // Then test higher ancestors recursively
02135     // (If our ancestor is under the test node then we are too!)
02136     return pMyParent->IsUnder(pTestNode, FALSE);
02137 }  

virtual BOOL Node::IsUserAttribute  )  const [inline, virtual]
 

Reimplemented in AttrUser.

Definition at line 492 of file node.h.

00492 {return FALSE;}

void Node::MarkChildren  ) 
 

Mark all children of this node.

void TextStory::MarkChildren(Node* pNode)

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/5/95
Parameters:
pNode = A pointer to a node [INPUTS]

Definition at line 5452 of file node.cpp.

05453 {
05454     Node* pNode = FindFirstChild();
05455     while (pNode!=NULL)
05456     {
05457         pNode->SetMarker(TRUE);
05458         pNode->MarkChildren();
05459         pNode=pNode->FindNext();
05460     }   
05461 }

void Node::MarkNodeAndChildren  ) 
 

Mark this node and all its children.

void TextStory::MarkNodeAndChildren()

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

Definition at line 5435 of file node.cpp.

05436 {
05437     SetMarker(TRUE);
05438     MarkChildren();
05439 }

virtual BOOL Node::MarqueeSelectNode  )  const [inline, virtual]
 

Definition at line 748 of file node.h.

00748 { return TRUE; }

void Node::MoveNode Node DestinationNode,
AttachNodeDirection  Direction
 

This method moves a node from its existing position in the tree to a new node position specified by Destination. The Direction input specifies how the node is to be attached to the Destination node. The following before and after diagram illustrates this method.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
Destination,: The destination node which the node is to be attached to. [INPUTS]
Direction:

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

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

Note: The destination node should not be the same as, or any child of node.

Parameters:
- [OUTPUTS]
Returns:
-
Notes: Before:-

MonoOn

.-----. .-----. .-----. |N1 |----->|N2 |----->| N3 | | | | | | | .-----. .-----. .-----. | V .-----. .-----. |N4 |----->|N5 | | | | | .-----. .-----.

MonoOff

After moving node N2 to destination N3 as a first child:-

MonoOn .-----. .-----. |N1 |----->| N3 | | | | | .-----. .-----. | V .-----. |N2 | | | .-----. | V .-----. .-----. |N4 |----->|N5 | | | | | .-----. .-----.

MonoOff

Returns:
Errors: An assertion error will occur if the DestinationNode is NULL

Definition at line 1946 of file node.cpp.

01948 {     
01949     ENSURE(DestinationNode != NULL,"Trying to copy a node to a node pointed to by a NULL pointer"); 
01950 
01951     UnlinkNodeFromTree(); // Remove the node from the tree    
01952     AttachNode(DestinationNode, Direction); 
01953 }                       

virtual BOOL Node::NeedsParent Node pClassNode  )  const [inline, virtual]
 

Reimplemented in NodeBevel, NodeBevelBegin, and NodeContour.

Definition at line 745 of file node.h.

00745 { return FALSE; }

BOOL Node::NeedsToExport RenderRegion pRender,
BOOL  VisibleLayersOnly = FALSE,
BOOL  CheckSelected = FALSE
[virtual]
 

To indicate whether a given node needs to be rendered when exporting the document tree to a foreign file format. The base class always returns FALSE; if derived nodes wish to be exported they must override it and return TRUE.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/03/94
Parameters:
pRender - the render region we are exporting to (NULL if none) [INPUTS] VisibleLayersOnly - TRUE => remove nodes which are on invisible layers
  • FALSE => export everything CheckSelected - TRUE => we check if object selected and only export selected bjects
  • FALSE => we don't bother checking for selection or not
    Returns:
    TRUE => Yes, export this node. FALSE => Do not export this node.
    See also:
    Node::NeedsToRender.

Reimplemented in NodeGuideline, Layer, NodeMouldGroup, NodeRenderable, NodeAttribute, NodeMoulder, NodePath, NodeRenderablePaper, and Spread.

Definition at line 523 of file node.cpp.

00524 {
00525     return FALSE;
00526 }

BOOL Node::NeedsToRender RenderRegion pRender  )  [virtual]
 

Decide whether this node needs to be rendered, given the information provided by the parameters. This is a virtual function which defaults to returning FALSE - i.e. the node never needs to be rendered. This function should be overridden for any renderable nodes, so that they use the info provided to determine whether or not they need to be rendered.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/02/94
Parameters:
pRender - the render region in question (NULL if none) [INPUTS]
Returns:
TRUE => This node should be rendered, FALSE => This node does not need to be rendered.
See also:
Node::Render

Definition at line 406 of file node.cpp.

00407 {
00408     // NeedsToRender has been deprecated and replaced by RenderSubtree
00409     // It is retained in this base class for those algorithms that still have to use
00410     // NeedsToRender and FindNextForClippedInkRender
00411     //
00412     // Now implemented by calling RenderSubtree
00413     //
00414     SubtreeRenderState state = RenderSubtree(pRender);
00415     ERROR2IF(state==SUBTREE_JUMPTO, FALSE, "Complex render state return to BOOL NeedsToRender\n");
00416 
00417     return (state==SUBTREE_ROOTONLY || state==SUBTREE_ROOTANDCHILDREN);
00418 }

BOOL Node::NeedsTransparency void   )  const [virtual]
 

Can be overriden in derived classes to return TRUE, indicating that the user may be prompted concerning transparency mode when such a node is inserted in the tree.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this Node requires transparency mode to render properly. By default this returns FALSE.

Errors: -

See also:
Node::AttachNode

Reimplemented in AttrBrushType, AttrClipView, AttrFillGeometry, AttrFlatTranspFill, AttrLinearTranspFill, AttrRadialTranspFill, AttrConicalTranspFill, AttrSquareTranspFill, AttrThreeColTranspFill, AttrFourColTranspFill, AttrBitmapTranspFill, AttrTextureTranspFill, AttrFeather, AttrStrokeTransp, NodeBevel, NodeBitmap, and AttrStrokeType.

Definition at line 4865 of file node.cpp.

04866 {
04867     return FALSE;       // by default we don't need to be in transparency mode
04868 }

BOOL Node::NodeCopy Node **  ppNodeCopy  )  [virtual]
 

This method outputs a 'deep' copy of the node. It is the same as CopyNode except that the copy is not linked into the tree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> / Mike
Date:
4/3/94
Parameters:
- [INPUTS]
NodeCopy,: A deep copy of the node if Successful [OUTPUTS]
Returns:
-

Errors: -

See also:
Node::CopyNode

Definition at line 1260 of file node.cpp.

01261 {     
01262     Node* NewNode = SimpleCopy();                 
01263     if (NewNode == FALSE)    
01264         return (FALSE);                           // Out of memory
01265     
01266     if (!CopyChildren(Child, NewNode, ccALL))     // Out of memory 
01267     {        
01268         DeleteChildren(NewNode->Child);   
01269         delete NewNode; 
01270         return (FALSE); 
01271     }   
01272 
01273     *ppNodeCopy = NewNode;
01274     return (TRUE); 
01275 }        

ChangeCode Node::OnChildChange ObjChangeParam pParam  )  [virtual]
 

This function should be overridden in derived object classes. Composite objects can use this function to respond to one of their children undergoing a change. They should return CC_FAIL whenever they are unable to cope with the change.

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
See also:
WarnParentOfChange();

Reimplemented in NodeGroup, Layer, NodeContourController, NodeClipViewController, NodeMouldGroup, NodeBlend, NodeBrush, NodeCompound, NodeMoulder, NodeMould, NodePath, and TextStory.

Definition at line 4972 of file node.cpp.

04973 {
04974     return CC_OK;
04975 }

BOOL Node::OptimiseAttributes  ) 
 

This function should be called on a subtree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/8/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1127 of file ndoptmz.cpp.

01128 {
01129     Node* Current= this->FindFirstDepthFirst(); 
01130 
01131     while (Current != NULL)
01132     {
01133         if (Current->IsCompound())
01134         {
01135             ENSURE(Current->IsKindOf(CC_RUNTIME_CLASS(NodeRenderableInk)), "Compound should be a NodeRenderableInk");
01136             // It's a compound node, so factor out common attributes
01137             // We don't want to attribute inside moulds (as yet)
01138             if ( !((IS_A(Current, NodeMouldGroup)) || (IS_A(Current, NodeMoulder))) )
01139             {
01140                 if (!((NodeRenderableInk*)Current)->FactorOutCommonChildAttributes())
01141                 {
01142                     return FALSE; 
01143                 }
01144             }
01145         }
01146         Current = Current->FindNextDepthFirst(this); 
01147     }
01148 
01149     return TRUE; 
01150 }

BOOL Node::PostDuplicate UndoableOperation pOp  )  [virtual]
 

This function is called after this node has been created via a copy/duplicate type operation. Nodes should override this function to do any post-processing.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/96
Parameters:
pOp - pointer to the operation that created the copy. [INPUTS]
- [OUTPUTS]
Returns:
TRUE/FALSE for success/failure
See also:
Node::PostImport

Reimplemented in NodeBevel, and TextStory.

Definition at line 5417 of file node.cpp.

05418 {
05419     return TRUE;
05420 }

BOOL Node::PostImport void   )  [virtual]
 

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

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

Reimplemented in NodeContourController, NodeClipViewController, NodeBlend, NodeClipView, NodeMould, TextStory, and Spread.

Definition at line 5398 of file node.cpp.

05399 {
05400     return TRUE;
05401 }

void Node::PreExportRender RenderRegion pRender  )  [virtual]
 

Perform any rendering required when exporting to a file, and this node is being 'passed by' during the tree searching. For example, a group node being exported to EPS would output a "start group" token, and then its ExportRender function would output a "end group" token. By default, it does nothing. Nodes wishing to do special export processing should override this function (and ExportRender).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/03/94
Parameters:
pRender - the render region we are exporting to. [INPUTS]
See also:
Node::ExportRender; Node::NeedsToExport

Reimplemented in NodeGroup, NodeGuideline, Layer, NodeContourController, NodeClipViewController, NodeMouldGroup, NodeBevel, NodeBlender, NodeBlend, NodeBitmap, NodeEllipse, NodeMoulder, NodeMould, NodeRect, NodeRegularShape, and TextStory.

Definition at line 471 of file node.cpp.

00472 {
00473 }

virtual BOOL Node::PromoteHitTestOnChildrenToMe  )  const [inline, virtual]
 

Reimplemented in NodeContourController, NodeLiveEffect, and NodeLockedEffect.

Definition at line 739 of file node.h.

00739 { return TRUE; }

Node * Node::PublicCopy  )  [virtual]
 

This method copies the node's contents to the node pointed to by NodeCopy.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/11/99
Parameters:
[INPUTS] 
A copy of this node [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Definition at line 1792 of file node.cpp.

01793 {
01794     return SimpleCopy();
01795 }

BOOL Node::ReadPostChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented in NodeRenderableInk, and Layer.

Definition at line 5942 of file node.cpp.

05943 {
05944 #ifdef RALPH
05945     // We don't want to be rendering at the same time as doing this, because we get
05946     // blobby text problems - fun, but bad !
05947     RalphCriticalSection RalphCS;
05948 #endif
05949     return PostImport();
05950 
05951     //return TRUE;
05952 }

BOOL Node::ReadPostChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

This function is called during the importing of the file.

> virtual BOOL Node::ReadPostChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/7/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if ok, FALSE otherwise
A node gets called via this function after all its children have been imported. This allows complex nodes (such as moulds) to do some post-import work, which can only be done after all its children have been read in and created.

See also:
CanWriteChildrenWeb(), WritePreChildrenWeb()

Reimplemented in NodeRenderableInk, and Layer.

Definition at line 5928 of file node.cpp.

05929 {
05930 #ifdef RALPH
05931     // We don't want to be rendering at the same time as doing this, because we get
05932     // blobby text problems - fun, but bad !
05933     RalphCriticalSection RalphCS;
05934 #endif
05935 
05936     return PostImport();
05937 
05938     //return TRUE;
05939 }

virtual BOOL Node::RegenerateNode UndoableOperation pOp = NULL,
BOOL  bCacheRender = FALSE,
BOOL  bInformParents = TRUE
[inline, virtual]
 

Reimplemented in NodeContourController.

Definition at line 733 of file node.h.

00735                                                             { return FALSE; }

void Node::RemoveAttrTypeFromSubtree CCRuntimeClass AttrType,
Node pExceptThis = NULL
 

Searches the subtree and every attribute which has type AttrType is deleted.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/04/2005
Parameters:
AttrType - pointer to a CCRuntimeClass [INPUTS] pExceptThis - pointer to a Node

Definition at line 5584 of file node.cpp.

05585 {
05586     // Traverse the subtree depth first
05587     Node* Current = FindFirstDepthFirst();
05588     Node* Next;
05589     while (Current != NULL)
05590     {
05591         Next =  Current->FindNextDepthFirst(this);
05592         // Determine if the Current node is to be hidden
05593         if (Current!=pExceptThis && Current->IsKindOf(CC_RUNTIME_CLASS(NodeAttribute)))
05594         {
05595             { 
05596                 if (((NodeAttribute*)Current)->GetAttributeType() == AttrType)
05597                 {
05598                     Current->CascadeDelete();
05599                     delete Current;
05600                 }
05601             }
05602         }
05603         Current = Next;
05604     }
05605 }

void Node::Render RenderRegion pRender  )  [virtual]
 

For rendering a node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/4/93
Parameters:
RendRegion,: Render region to render into [INPUTS]
- [OUTPUTS]
Returns:
-

Reimplemented in AttrBevelIndent, AttrBevelLightAngle, AttrBevelContrast, AttrBevelType, AttrBevelLightTilt, AttrBrushType, Chapter, AttrClipView, AttrFlatColourFill, AttrFlatTranspFill, AttrLinearColourFill, AttrLinearTranspFill, AttrRadialColourFill, AttrRadialTranspFill, AttrConicalColourFill, AttrConicalTranspFill, AttrSquareColourFill, AttrSquareTranspFill, AttrThreeColColourFill, AttrThreeColTranspFill, AttrFourColColourFill, AttrFourColTranspFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrTextureColourFill, AttrTextureTranspFill, AttrFillMappingLinear, AttrFillMappingSin, AttrFillEffectFade, AttrFillEffectRainbow, AttrFillEffectAltRainbow, AttrTranspFillMappingLinear, AttrTranspFillMappingSin, AttrMould, AttrFeather, NodeGrid, NodeGridRect, NodeGridIso, NodeGuideline, AttrImagesetting, AttrLineWidth, AttrStrokeColour, AttrStrokeTransp, AttrStartArrow, AttrEndArrow, AttrStartCap, AttrJoinType, AttrMitreLimit, AttrWindingRule, AttrDashPattern, NodeContourController, NodeBlendPath, NodeBrushMaker, NodeBrushPath, NodeMouldBitmap, NodeMouldPath, NodeAttribute, NodeBevel, NodeBevelBegin, NodeBlender, NodeBitmap, NodeBrush, NodeClipView, NodeContour, NodeBitmapEffect, NodeLockedEffect, NodeMoulder, NodePath, NodeRegularShape, NodeSimpleShape, TextChar, Page, AttrQuality, Spread, AttrStrokeType, AttrVariableWidth, AttrTxtFontTypeface, AttrTxtBold, AttrTxtItalic, AttrTxtUnderline, AttrTxtAspectRatio, AttrTxtJustification, AttrTxtTracking, AttrTxtFontSize, AttrTxtScript, AttrTxtBaseLine, AttrTxtLeftMargin, AttrTxtRightMargin, AttrTxtFirstIndent, AttrTxtRuler, AttrTxtLineSpace, AttrUser, and AttrWebAddress.

Definition at line 332 of file node.cpp.

00332 {};   

virtual void Node::RenderAfterSubtree RenderRegion pRender  )  [inline, virtual]
 

Reimplemented in NodeGroup, Layer, NodeBitmapEffect, and NodeEffect.

Definition at line 392 of file node.h.

00392 {;}

SubtreeRenderState Node::RenderSubtree RenderRegion pRender,
Node **  ppNextNode = NULL,
BOOL  bClip = TRUE
[virtual]
 

Enables Nodes to be able to Do Pre Print time alterations or even take over the control of the current Printing of their children.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/06/2004
Parameters:
A Render Region to Render into. [INPUTS]
Returns:
PRE_FAILED for something went wrong, PRE_RENDER_CHILDREN for continue to render children, PRE_NO_RENDER_CHILDREN for DO NOT Render any of my children!!!!

Reimplemented in AttrBrushType, AttrClipView, AttrFeather, NodeGrid, NodeGroup, NodeGuideline, Layer, NodeContourController, NodeClipViewController, NodeMouldGroup, NodeRenderable, NodeRenderableBounded, NodeAttribute, NodeBevelBegin, NodeBrush, NodeClipView, NodeLiveEffect, NodeLockedEffect, NodeEffect, NodeRenderablePaper, and Spread.

Definition at line 5690 of file node.cpp.

05691 {
05692     return SUBTREE_ROOTANDCHILDREN;
05693 }

void Node::RenderTreeAtomic RenderRegion pRender  ) 
 

Renders the tree rooted at this node into the given RenderRegion.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/09/2000
Parameters:
pRender the RenderRegion to render into. [INPUTS]
Notes: !!! THIS FUNCTION IS NOT RECURSIVE AS OF 23/06/2004 - Phil !!!

THIS FUNCTION IS CURRENTLY RECURSIVE ***

THIS FUNCTION IS CURRENTLY ATOMIC *** So don't call it willy-nilly, as you will ruin Camelot's interruptible background rendering functionality.

Rendering is depth-first, with PreRenderChildren() called on all nodes.

This function currently goes *down* the tree, so it will miss any attributes applied to this node via its parent. To get around this, do:

NodeRenderableInk* pParent = (NodeRenderableInk*)pNodeToRender->FindParent(); if (pParent != NULL) { CCAttrMap* pAttrMap = CCAttrMap::MakeAppliedAttrMap(pParent); if (pAttrMap != NULL) { pAttrMap->Render(pRenderRegion); delete pAttrMap; } } pNodeToRender->RenderTreeAtomic(pRenderRegion);

Misconceptions: Render() does not render a tree - only one node. RenderAppliedAttributes() cannot be used generally - it is only designed for and used in the hit-test code.

Returns:
Errors: pRender is checked for NULL in DEBUG builds.

Definition at line 378 of file node.cpp.

00379 {
00380     ERROR3IF(pRender == NULL, "Node::RenderTreeAtomic; NULL pRender parameter not allowed!");
00381 
00382     pRender->RenderTree(this, FALSE);
00383 }

virtual BOOL Node::ReplaceBitmap KernelBitmap pOrigBitmap,
KernelBitmap pNewBitmap
[inline, virtual]
 

Reimplemented in AttrBitmapFill, and NodeBitmap.

Definition at line 541 of file node.h.

00541 { return(FALSE); }

void Node::SetChildDangerous Node NewChild  ) 
 

Definition at line 4843 of file node.cpp.

04844 {
04845     Child = NewChild;   
04846 }

void Node::SetLocked BOOL  Status  )  [inline]
 

To set the node's locked status (TRUE/FALSE).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
Status,: Status of node's locked flag [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Reimplemented in Layer.

Definition at line 1029 of file node.h.

01030 { 
01031     Flags.Locked = Status; 
01032 }    

void Node::SetMangled BOOL  Status  )  [inline]
 

To set Nodes mangled status (TRUE/FALSE).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
Status,: Status of node's mangled flag [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 1050 of file node.h.

01051 { 
01052     Flags.Mangled = Status; 
01053 }  

void Node::SetMarker BOOL  Status  )  [inline]
 

To set Nodes marked status (TRUE/FALSE).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
Status,: Status of node's marked flag [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 1071 of file node.h.

01072 {
01073     Flags.Marked = Status; 
01074 }  

void Node::SetNextDangerous Node NewNext  ) 
 

Definition at line 4833 of file node.cpp.

04834 {
04835     Next = NewNext;     
04836 }

void Node::SetOpPermission OpPermissionState  NewState,
BOOL  AndParents = FALSE
[virtual]
 

Use this to set the node's permission flags.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/02/95
Parameters:
NewState = the state to set the permission to [INPUTS] AndParents = if TRUE, set the same permission for your parent, parent's parent, etc
- [OUTPUTS]
Returns:
-
Note: Once you set a node's permission to PERMISION_ALLOWED, you can only subsequently set it to PERMISSION_UNDEFINED. i.e. if you set it to PERMISSION_ALLOWED, then try and set it to PERMISSION_DENIED, the node's permission state will stay as PERMISSION_ALLOWED.

See also:
GetOpPermission();

Reimplemented in Layer.

Definition at line 5036 of file node.cpp.

05037 {
05038     OpPermissionState CurrentState = GetOpPermission();
05039 
05040     switch (NewState)
05041     {
05042         case PERMISSION_DENIED:
05043             if (CurrentState != PERMISSION_ALLOWED)
05044             {
05045                 Flags.OpPermission1 = FALSE;
05046                 Flags.OpPermission2 = FALSE;
05047             }
05048             break;
05049 
05050         case PERMISSION_ALLOWED:
05051             Flags.OpPermission1 = FALSE;
05052             Flags.OpPermission2 = TRUE;
05053             break;
05054 
05055         case PERMISSION_UNDEFINED:
05056             Flags.OpPermission1 = TRUE;
05057             Flags.OpPermission2 = FALSE;
05058             break;
05059 
05060         default:
05061             ERROR3_PF(("Unknown OpPermissionState (%d)",NewState));
05062             break;
05063     }
05064 
05065     if (AndParents)
05066     {
05067         if (Parent != NULL)
05068             Parent->SetOpPermission(NewState,AndParents);
05069     }           
05070 }

void Node::SetParentDangerous Node NewParent  ) 
 

Sets the parent of the node to NewParent.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
NewParent,: The node's new parent [INPUTS]
- [OUTPUTS]
Returns:
-
This function has a very special purpose and is very Dangerous to use. So don't use it unless you are very sure what you are doing.

Returns:
Errors: -
See also:
-

Definition at line 4828 of file node.cpp.

04829 {
04830     Parent = NewParent;     
04831 }

BOOL Node::SetParentLayerAsEdited  )  [virtual]
 

Mark parent layer as edited. If an ink object as something done to it which changes its appearance then we need to mark the parent layer as edited. In this baseclass version do nothing.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/7/97
Returns:
True if worked ok, False otherwise

Reimplemented in NodeRenderableInk.

Definition at line 6241 of file node.cpp.

06242 {
06243     return TRUE;
06244 }

void Node::SetParentOfSelected BOOL  Status  )  [inline]
 

To set Nodes SelectedChildren status (TRUE/FALSE) This is used to implement select-inside.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/94
Parameters:
Status,: Required setting of nodes SelectedChildren flag [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 1162 of file node.h.

01163 {
01164     Flags.SelectedChildren = Status;  
01165 //  Camelot.UpdateSelection();          // This line not required because the function
01166                                             // does not itself modify the selection!
01167 }     

void Node::SetPreviousDangerous Node NewPrev  ) 
 

Definition at line 4838 of file node.cpp.

04839 {
04840     Previous = NewPrev;     
04841 }

void Node::SetRender BOOL  Status,
BOOL  bAndChildren = FALSE
 

To set Nodes renderable status (TRUE/FALSE).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
val,: Status of node's renderable flag [INPUTS] Recursion flag
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 437 of file node.cpp.

00438 {
00439     Flags.Renderable = Status;
00440 
00441     if (bAndChildren)
00442     {
00443         Node* pNode = FindFirstChild();
00444         while (pNode)
00445         {
00446             pNode->SetRender(Status, bAndChildren);
00447             pNode = pNode->FindNext();
00448         }
00449     }
00450 }     

void Node::SetSelected BOOL  fStatus  )  [virtual]
 

To set Nodes selected status (TRUE/FALSE) This routine also deals with "select-inside" by making sure all the SelectedChildren flags are set appropriately. Note: Selecting a node prevents it from being a parent of selected nodes This routine therefore clears the selection of any children! Note2: Calling this routine clears any selection from children of this node and marks it to no longer be the parent of selected children. This is done because selected nodes can't have sel children and because unselecting a node implies that you thought it was selected in which case it shouldn't have selected children.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/93
Parameters:
Status,: Status of node's selected flag [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Reimplemented in NodeGuideline, NodeBevelBegin, NodeCompound, and CaretNode.

Definition at line 2873 of file node.cpp.

02874 {
02875     // If selecting or deselecting a node which is currently the parent of selected nodes
02876     // then it can no longer have any selected children. The rules of select inside say
02877     // that selected nodes cannot have selected children.
02878     if (Flags.SelectedChildren)         // If node was previously a parent of selected nodes
02879         DeSelectSubtree();              // Then clear any selected children
02880 
02881     Flags.SelectedChildren = FALSE;     // Flag that this node doesn't have selected children
02882 
02883     if (Flags.Selected != fStatus) 
02884     {
02885         Flags.Selected = fStatus;       // Flag that this node is now selected
02886 
02887         // Inform the Selection SelRange that the selection has changed
02888         // If selected, pass in 'this' to let it know that I am the most recently selected node,
02889         // else pass in NULL to leave things as they were
02890         SelRange* Selection = GetApplication()->FindSelection();
02891         if (Selection != 0) Selection->Update(FALSE, fStatus ? this : 0);
02892 
02893     /*
02894         Removed by Simon.M for Mark.N - the assumption made is invalid
02895 
02896         #ifdef _DEBUG
02897         // This piece of code checks that if you are selecting a node, none of its ascendents are selected.
02898         // Debug builds will inform you of this, retail builds will ignore it as it is viewed as such
02899         // a highly illegal state that all bugs causing this to happen should have be ironed out (shyeh,right!)
02900         // (MarkN 27/10/94)
02901         if (Status)
02902         {
02903             Node* pNode = Parent;
02904             while (pNode)
02905             {
02906                 ERROR3IF(pNode->Flags.Selected,"Selecting a node when an ascendent is selected");
02907                 pNode = pNode->Parent;
02908             }
02909         }
02910         #endif
02911     */
02912         // Now that we've altered the Selected and SelectedChildren flags:
02913         // If this node is not in the normal selection surface (direct children of a layer)
02914         // then we must go and set the SelectedChildren flags properly...
02915         if (FindParent() == 0 || FindParent()->IsLayer())
02916             return;     // Is in the normal selection surface so exit quickly!
02917 
02918         // Is NOT in the normal selection surface so go fix up the SelectedChildren flags...
02919         if (fStatus)
02920         {
02921             // This node has been selected while "inside" another one.
02922             // If this node is not in the top layer of normal selection then it must be inside
02923             // a compound node. So, we must go up the parent links setting their SelectedChildren
02924             // flags until we reach the normal selection layer (the child list of a Layer node).
02925             for (Node* pParent = FindParent();
02926                  pParent != 0 && !pParent->IsLayer();
02927                  pParent = pParent->FindParent())
02928             {
02929                 pParent->Flags.SelectedChildren = TRUE;     // Flag that parent has selected children
02930             }
02931                 
02932             // This error check may be a bit over-zealous. I suspect that nodes can be deselected
02933             // while they are in subtrees which are temporarilly unlinked from the tree (hidden nodes???)
02934 //          ERROR3IF(pParent==NULL,"Node doesn't seem to be in a layer!");
02935         }
02936         else
02937         {
02938             // This node has been deselected while "inside" another one.
02939             // If there are any other selected of parentsofselected nodes in the sibling list
02940             // with this one then leave the parent marked as ParentOfSelected
02941             // Otherwise clear it.
02942             // And do the same test for it's parent, etc., etc...
02943             for (Node* pParent = FindParent();
02944                  pParent != 0 && !pParent->IsLayer();
02945                  pParent = pParent->FindParent())
02946             {
02947                 Node   *p;
02948                 for ( p = pParent->FindFirstChild(); p != 0; p = p->FindNext())
02949                     if (p->IsSelected() || p->HasSelectedChildren())
02950                         break;
02951 
02952                 pParent->Flags.SelectedChildren = (p != 0);
02953 
02954 //              if ( pParent->HasSelectedChildren() )    // If our parent still has selected children
02955 //                  break;                               // Then stop the loop NOW because we don't need
02956                                                          // to alter this parent's flag, or any of it's parents.
02957                                                          //     Else
02958 //              pParent->Flags.SelectedChildren = FALSE; // Flag that parent no longer has selected children.
02959             
02960             }
02961 
02962             // This error check may be a bit over-zealous. I suspect that nodes can be deselected
02963             // while they are in subtrees which are temporarilly unlinked from the tree (hidden nodes???)
02964 //          ERROR3IF(pParent==NULL,"Node doesn't seem to be in a layer!");
02965         }
02966     }
02967 }     

void Node::SetTags BaseDocument pOwnerDoc  )  [private]
 

Sets the tag of this node and all its descendants to a legal value, according to which document it is in, if any.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/11/95
Parameters:
pOwnerDoc - the document that this node is in; NULL if not in a document. [INPUTS]

Definition at line 669 of file node.cpp.

00670 {
00671     // Set the tag for this node according to the document.
00672     if (pOwnerDoc != NULL)
00673     {
00674         // Only set the tag if it is not already a legal tag.
00675         if (Tag == TAG_NOT_IN_DOC)
00676         {
00677             Tag = pOwnerDoc->NewTag();
00678             pOwnerDoc->IncNodeCount();
00679         }
00680     }
00681     else 
00682     {
00683         // Ensure this is marked as not being in a document.
00684         Tag = TAG_NOT_IN_DOC;
00685     }
00686 
00687     // Now set the tags of any children of this node - start with the first child of this node.
00688     Node *pChild = FindFirstChild();
00689 
00690     while (pChild != NULL)
00691     {
00692         // Set the tags of this child and its children.
00693         pChild->SetTags(pOwnerDoc);
00694 
00695         // Do the next child.
00696         pChild = pChild->FindNext();
00697     }
00698 }

BOOL Node::ShouldBeRendered  )  const [virtual]
 

For determining quickly if the node is an object For finding the status of the node's Compound flag For finding the status of the node's Compound flag Allows you to see if this node is a NodeAttribute or is Hiding a NodeAttribute without having to use the expensive runtime checkingFor finding if a node is a paper node. For finding if a node is a layer node. For finding if a node is a spread node.For finding if a node is a chapter node.Determine if a node is *derived* from the NodeRenderable class. NB. This has nothing to do with the node's renderable flag! Work out if the node should be rendered - basically all nodes except NodeRenderable nodes should be rendered. However, some NodeRenderable derived classes should not actually be rendered - for example NodeMouldGroup hides the original un-moulded objects, which should definitely *not* be rendered. This is mainly used during printing where due to complications to do with banding and transparency, we cannot use NeedsToRender() to filter out such nodes, so we use this function instead. NB. This has nothing to do with the node's renderable flag!

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/07/95
Returns:
TRUE => This node should be rendered FALSE => this node should not be rendered.
See also:
Node::IsNodeRenderable

Reimplemented in NodeMouldGroup, and NodeRenderable.

Definition at line 2332 of file node.cpp.

02333 {
02334     return FALSE;
02335 }

virtual BOOL Node::ShouldITransformWithChildren  )  const [inline, virtual]
 

Reimplemented in NodeContourController, and NodeLiveEffect.

Definition at line 742 of file node.h.

00742 { return FALSE; }

static BOOL Node::ShowHourglass  )  [inline, static]
 

Definition at line 818 of file node.h.

00818 { return HourglassOn;} 

BOOL Node::ShowingNode  )  [virtual]
 

This virtual function is called whenever the node is re-shown after being Hidden. It allows the node to reconstruct itself if it was optimised or send a message to let others know it is back etc.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/11/94
Returns:
TRUE if all was ok. FALSE if an error occured (eg Out of memory).
ALWAYS CALL THE BASE CLASS' FUNCTION FROM YOUR OVERRIDDEN FUNCTION.

Reimplemented in AttrBitmapFill, AttrFractalFill, NodeMouldGroup, NodeBlender, NodeBlend, and NodeBitmap.

Definition at line 4755 of file node.cpp.

04756 {
04757     return TRUE;
04758 }

Node * Node::SimpleCopy void   )  [protected, 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 of Node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
A copy of the node, or NULL if we are out of memory

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

Scope: Protected

Reimplemented in AttrBevelIndent, AttrBevelLightAngle, AttrBevelContrast, AttrBevelType, AttrBevelLightTilt, AttrBrushType, Chapter, AttrClipView, StartDocument, EndDocument, AttrFlatColourFill, AttrFlatTranspFill, AttrLinearColourFill, AttrLinearTranspFill, AttrRadialColourFill, AttrRadialTranspFill, AttrConicalColourFill, AttrConicalTranspFill, AttrSquareColourFill, AttrSquareTranspFill, AttrThreeColColourFill, AttrThreeColTranspFill, AttrFourColColourFill, AttrFourColTranspFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrTextureColourFill, AttrFractalColourFill, AttrNoiseColourFill, AttrTextureTranspFill, AttrFractalTranspFill, AttrNoiseTranspFill, AttrFillMappingLinear, AttrFillMappingSin, AttrFillEffectFade, AttrFillEffectRainbow, AttrFillEffectAltRainbow, AttrTranspFillMappingLinear, AttrTranspFillMappingSin, AttrMould, AttrFeather, NodeGrid, NodeGridRect, NodeGridIso, NodeGroup, NodeGuideline, NodeRenderableInk, InsertionNode, AttrOverprintLine, AttrOverprintFill, AttrPrintOnAllPlates, Layer, AttrLineWidth, AttrStrokeColour, AttrStrokeTransp, AttrStartArrow, AttrEndArrow, AttrStartCap, AttrJoinType, AttrMitreLimit, AttrWindingRule, AttrDashPattern, NodeContourController, NodeBlendPath, NodeBrushMaker, NodeBrushPath, NodeClipViewController, NodeMouldGroup, NodeMouldBitmap, NodeMouldPath, NodeSetProperty, NodeBarProperty, NodeSetSentinel, NodeRenderable, NodeRenderableBounded, NodeHidden, NodeAnimatingBitmap, NodeAttribute, NodeBevel, NodeBevelBegin, NodeBlender, NodeBlend, NodeBitmap, NodeBrush, NodeClipView, NodeContour, NodeDocument, NodeEllipse, NodeLiveEffect, NodeLockedEffect, NodeFeatherEffect, NodeMoulder, NodeMould, NodePath, NodeEffect, NodeRect, NodeRegularShape, NodeSimpleShape, VisibleTextNode, AbstractTextChar, TextChar, KernCode, HorizontalTab, CaretNode, EOLNode, TextLine, BaseTextClass, TextStory, NodeRenderablePaper, Page, AttrQuality, Spread, AttrStrokeType, AttrVariableWidth, TemplateAttribute, StyleReferenceAttribute, AttrTxtFontTypeface, AttrTxtBold, AttrTxtItalic, AttrTxtUnderline, AttrTxtAspectRatio, AttrTxtJustification, AttrTxtTracking, AttrTxtFontSize, AttrTxtScript, AttrTxtBaseLine, AttrTxtLeftMargin, AttrTxtRightMargin, AttrTxtFirstIndent, AttrTxtRuler, AttrTxtLineSpace, AttrUser, and AttrWebAddress.

Definition at line 1741 of file node.cpp.

01742 {     
01743     Node* NodeCopy;   
01744     // Will need to handle this 
01745     NodeCopy = new Node();  // Allocate a new node  
01746     ERRORIF( NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL ); 
01747     CopyNodeContents(NodeCopy);    
01748     return (NodeCopy); 
01749 }        

static void Node::StartHourglass  )  [inline, static]
 

Definition at line 816 of file node.h.

00816 { HourglassOn = TRUE; };

static void Node::StopHourglass  )  [inline, static]
 

Definition at line 817 of file node.h.

00817 { HourglassOn = FALSE; };

BOOL Node::SupportsClipboardFormat InternalClipboardFormat Format  )  const [virtual]
 

Determine if a node supports a given internal data type. This is used by the clipboard when exporting to other applications in order to determine if certain data types can be supplied.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/95
Returns:
TRUE = This node supports the given format FALSE = This node does not support the format (or the format is unknown)
e.g. The basic formats include: Vector - this is ALWAYS assumed to be available (Vector format includes every Node, e.g. export in Camelot .art format)

Text - As well as paths, some objects can provide text chars

Bitmap - Bitmap fills can render a filled object or supply the bitmap used for filling with.

See InternalClipboardFormat (kernel.h) for more details

Notes: The base class does not bother checking the format and just returns FALSE, as the only format supported by default is "Vector", which is

See also:
InternalClipboardFormat

Reimplemented in NodeBitmap, and TextChar.

Definition at line 2734 of file node.cpp.

02735 {
02736     // By default, nodes can supply Vector format export only
02737     return(FALSE);
02738 }

void Node::UnlinkNodeFromTree BaseDocument pOwnerDoc = NULL  )  [virtual]
 

Unlinks the node from the tree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/93
Parameters:
pOwnerDoc - pointer to the document that this node is in. This is used to [INPUTS] update the node count. If it is NULL, then the tree is scanned upwards to find the owner document instead. This is merely a performance enhancement, so that if a lot of nodes are being deleted, then we don't have to scan the tree all the time.
This parameter is passed in automatically by Node functions which delete many nodes in one go, such as:

Node::CascadeDelete Node::DeleteChildren ... etc.

See also:
Node::FindOwnerDoc

Reimplemented in NodeLockedEffect.

Definition at line 1111 of file node.cpp.

01112 {
01113     // Find the owner document if we don't have one
01114     if (pOwnerDoc == NULL)
01115         pOwnerDoc = FindOwnerDoc();
01116 
01117     // Update the node count if this node is actually in a document
01118     if (pOwnerDoc != NULL)
01119         pOwnerDoc->DecNodeCount();
01120 
01121     // Inform classes that may be holding pointers to this node
01122     RenderRegionList* pRList = GetApplication()->GetRegionList();
01123     if (pRList)
01124         pRList->HandleNodeDeletion(this);
01125 
01126     if (pOwnerDoc && pOwnerDoc->IsKindOf(CC_RUNTIME_CLASS(Document)))
01127         ((Document*)pOwnerDoc)->HandleNodeDeletion(this);
01128 
01129     // Now do the actual unlinking
01130     if (Previous == NULL) // Node must be a first child or root
01131     {
01132         if (Parent != NULL) // Node is a first child
01133             // The parent's new first child is the next sibling of the node being deleted
01134             Parent->Child = Next; 
01135     }
01136     else     
01137         //The previous node's next sibling becomes the node's Next sibling   
01138         Previous->Next = Next;                                                
01139     
01140     if (Next != NULL)   
01141         //The next node's previous sibling becomes the node's Previous sibling                          
01142         Next->Previous = Previous;    
01143 
01144     // Remove nodes links into the tree            
01145     Next = NULL; 
01146     Previous = NULL; 
01147     Parent = NULL; 
01148 }

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

Tests the reversibility of an Extend operation applied to this node.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/11/1999
Parameters:
ExtParams description parameters for the extension. [INPUTS]
[OUTPUTS] 
Returns:
TRUE if extending this Node would be a valid operation, ie by passing appropriate inverse extend parameters, the Node could be un-extended back to its original state. FALSE if the operation would be irreversible.
Note that where appropriate, this function asks the Node's children if they may validly extend, only returning TRUE if the extension is completely ok with everyone.

Also note that if a node is of a non-extending type, it should normally consider itself a 'valid extender', as doing nothing is completely reversible (it should of course still check its children).

Returns:
Errors: See also: Node::IsTypeExtendible(), Node::Extend().

Reimplemented in AttrFillGeometry, AttrBitmapFill, NodeContourController, NodeMouldGroup, NodeHidden, NodeBevel, NodeBlend, NodeContour, NodeMould, NodePath, NodeRegularShape, NodeSimpleShape, and TextStory.

Definition at line 6323 of file node.cpp.

06324 {
06325     DocRect drMinExtend(INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX), drThisMinExtend;
06326     for (   Node* pChildNode = FindFirstChild();
06327             pChildNode != NULL;
06328             pChildNode = pChildNode->FindNext() )
06329     {
06330         drThisMinExtend = pChildNode->ValidateExtend(ExtParams);
06331         if (drMinExtend.lo.x > drThisMinExtend.lo.x) drMinExtend.lo.x = drThisMinExtend.lo.x;
06332         if (drMinExtend.lo.y > drThisMinExtend.lo.y) drMinExtend.lo.y = drThisMinExtend.lo.y;
06333         if (drMinExtend.hi.x > drThisMinExtend.hi.x) drMinExtend.hi.x = drThisMinExtend.hi.x;
06334         if (drMinExtend.hi.y > drThisMinExtend.hi.y) drMinExtend.hi.y = drThisMinExtend.hi.y;
06335     }
06336     return drMinExtend;
06337 }

ChangeCode Node::WarnParentOfChange ObjChangeParam pParam,
BOOL  AllParents = TRUE
 

When an object changes, this function should be used to inform its parent(s) of the change. If AllParents is TRUE it will call every parent, passing the object change parameter to their OnChildChange() virtual function.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/01/95
Parameters:
pParam = pointer to a object change parameter class [INPUTS] AllParents = if true then tell all parents of the change, else just tell the immediate parent. Defaults to TRUE
Returns:
CC_OK if all warned parents have verified the change CC_FAIL if unable to go on at all

Definition at line 4931 of file node.cpp.

04932 {
04933     ERROR1IF(pParam==NULL,CC_FAIL,"Node::WarnParentOfChange() called with a null change reason");
04934     ERROR1IF(pParam->GetChangeType()==OBJCHANGE_UNDEFINED,CC_FAIL,"Node::WarnParentOfChange() passed an illegal Change block");
04935 
04936     // find the immediate parent
04937     Node* pParent = FindParent();
04938     ChangeCode Code = CC_OK;
04939     while (pParent)
04940     {
04941         // call the parents 'child change' function 
04942         Code = pParent->OnChildChange(pParam);
04943         if (Code == CC_FAIL)
04944             return Code;
04945         // now itterate up the tree if necessary
04946         if (AllParents)
04947             pParent=pParent->FindParent();
04948         else
04949             pParent=NULL;
04950     }
04951     return Code;
04952 }

BOOL Node::WriteBeginChildRecordsNative BaseCamelotFilter pFilter  )  [virtual]
 

Begin to write out you child records, in the native format.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/8/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if ok, FALSE otherwise
The base class will write out a TAG_DOWN record, but only if it has a child ptr

See also:
WritePostChildrenWeb(), WritePreChildrenWeb()

Reimplemented in Chapter, NodeRenderableInk, Layer, NodeBlender, NodePath, TextLine, TextStory, and Spread.

Definition at line 5839 of file node.cpp.

05840 {
05841     Node* pChild = FindFirstChild();
05842     if (pChild != NULL)
05843     {
05844         // The node is considered to have children ONLY if at least one child is not a hidden node.
05845         if (!pChild->IsNodeHidden() || (pChild->FindNextNonHidden() != NULL))
05846             return pFilter->WriteZeroSizedRecord(TAG_DOWN);
05847     }
05848 
05849     return TRUE;
05850 }

BOOL Node::WriteBeginChildRecordsWeb BaseCamelotFilter pFilter  )  [virtual]
 

Begin to write out you child records, in the web format.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/8/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if ok, FALSE otherwise
The base class will write out a TAG_DOWN record, but only if it has a child ptr

See also:
WritePostChildrenWeb(), WritePreChildrenWeb()

Reimplemented in Chapter, NodeRenderableInk, Layer, NodeSetProperty, NodeBarProperty, NodeSetSentinel, NodeBlender, TextLine, TextStory, and Spread.

Definition at line 5810 of file node.cpp.

05811 {
05812     Node* pChild = FindFirstChild();
05813     if (pChild != NULL)
05814     {
05815         // The node is considered to have children ONLY if at least one child is not a hidden node.
05816         if (!pChild->IsNodeHidden() || (pChild->FindNextNonHidden() != NULL))
05817             return pFilter->WriteZeroSizedRecord(TAG_DOWN);
05818     }
05819 
05820     return TRUE;
05821 }

BOOL Node::WriteEndChildRecordsNative BaseCamelotFilter pFilter  )  [virtual]
 

Finished writing out you child records, in the native format.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/8/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if ok, FALSE otherwise
The base class will write out a TAG_UP record, but only if it has a child ptr

See also:
WritePostChildrenWeb(), WritePreChildrenWeb()

Reimplemented in Chapter, NodeRenderableInk, Layer, NodeBlender, NodePath, TextLine, TextStory, and Spread.

Definition at line 5897 of file node.cpp.

05898 {
05899     Node* pChild = FindFirstChild();
05900     if (pChild != NULL)
05901     {
05902         // The node is considered to have children ONLY if at least one child is not a hidden node.
05903         if (!pChild->IsNodeHidden() || (pChild->FindNextNonHidden() != NULL))
05904             return pFilter->WriteZeroSizedRecord(TAG_UP);
05905     }
05906 
05907     return TRUE;
05908 }

BOOL Node::WriteEndChildRecordsWeb BaseCamelotFilter pFilter  )  [virtual]
 

Finished writing out you child records, in the web format.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/8/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if ok, FALSE otherwise
The base class will write out a TAG_UP record, but only if it has a child ptr

See also:
WritePostChildrenWeb(), WritePreChildrenWeb()

Reimplemented in Chapter, NodeRenderableInk, Layer, NodeSetProperty, NodeBarProperty, NodeSetSentinel, NodeBlender, TextLine, TextStory, and Spread.

Definition at line 5868 of file node.cpp.

05869 {
05870     Node* pChild = FindFirstChild();
05871     if (pChild != NULL)
05872     {
05873         // The node is considered to have children ONLY if at least one child is not a hidden node.
05874         if (!pChild->IsNodeHidden() || (pChild->FindNextNonHidden() != NULL))
05875             return pFilter->WriteZeroSizedRecord(TAG_UP);
05876     }
05877 
05878     return TRUE;
05879 }

BOOL Node::WritePostChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented in Layer, and TextChar.

Definition at line 5760 of file node.cpp.

05761 {
05762     return TRUE;
05763 }

BOOL Node::WritePostChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Gives the node a change to write data to the filter after its children have been automatically written out.

> virtual BOOL Node::WritePostChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/5/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if ok, FALSE otherwise
This function will get called even if CanWriteChildrenWeb() has returned FALSE

See also:
CanWriteChildrenWeb(), WritePreChildrenWeb()

Reimplemented in Layer, and TextChar.

Definition at line 5754 of file node.cpp.

05755 {
05756     return TRUE;
05757 }

BOOL Node::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented in AttrBevelIndent, AttrBevelLightAngle, AttrBevelContrast, AttrBevelType, AttrBevelLightTilt, AttrBrushType, Chapter, AttrClipView, AttrFlatColourFill, AttrFlatTranspFill, AttrLinearColourFill, AttrLinearTranspFill, AttrRadialColourFill, AttrRadialTranspFill, AttrConicalColourFill, AttrConicalTranspFill, AttrSquareColourFill, AttrSquareTranspFill, AttrThreeColColourFill, AttrThreeColTranspFill, AttrFourColColourFill, AttrFourColTranspFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrFractalColourFill, AttrNoiseColourFill, AttrFractalTranspFill, AttrNoiseTranspFill, AttrFillMappingLinear, AttrFillMappingSin, AttrFillEffectFade, AttrFillEffectRainbow, AttrFillEffectAltRainbow, AttrTranspFillMappingLinear, AttrTranspFillMappingSin, AttrFeather, NodeGrid, NodeGroup, NodeGuideline, AttrOverprintLine, AttrOverprintFill, AttrPrintOnAllPlates, Layer, AttrLineWidth, AttrStrokeColour, AttrStrokeTransp, AttrStartArrow, AttrEndArrow, AttrStartCap, AttrJoinType, AttrMitreLimit, AttrWindingRule, AttrDashPattern, NodeContourController, NodeBlendPath, NodeBrushPath, NodeClipViewController, NodeMouldGroup, NodeMouldPath, NodeSetProperty, NodeBarProperty, NodeSetSentinel, NodeBevel, NodeBlender, NodeBlend, NodeBitmap, NodeBrush, NodeClipView, NodeContour, NodeLiveEffect, NodeLockedEffect, NodeFeatherEffect, NodeMoulder, NodeMould, NodePath, NodeRegularShape, TextChar, KernCode, HorizontalTab, CaretNode, EOLNode, TextLine, TextStory, Page, AttrQuality, Spread, AttrStrokeType, AttrVariableWidth, AttrTxtFontTypeface, AttrTxtBold, AttrTxtItalic, AttrTxtUnderline, AttrTxtAspectRatio, AttrTxtJustification, AttrTxtTracking, AttrTxtFontSize, AttrTxtScript, AttrTxtBaseLine, AttrTxtLeftMargin, AttrTxtRightMargin, AttrTxtFirstIndent, AttrTxtRuler, AttrTxtLineSpace, AttrUser, and AttrWebAddress.

Definition at line 5731 of file node.cpp.

05732 {
05733     return FALSE;
05734 }

BOOL Node::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes out a record that represents the node.

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/5/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if the node has written out a record to the filter FALSE otherwise
This function is called before any of the node's children are written to the filter.

If the node writes out a record successfully to the file, it should return TRUE.

If the node chooses not to write itself to the filter (e.g. because it is not appropriate for this filter), then this function should return FALSE.

If an error occurs, the function should call pFilter->GotError(), and return FALSE.

If the node does not want its child nodes to be written automatically, you should make sure you override CanWriteChildrenWeb() so it returns FALSE.

(e.g. this node may choose to save its sub tree itself, so it can choose which of its child nodes should be saved out)

See also:
CanWriteChildrenWeb(), WritePostChildrenWeb()

Reimplemented in AttrBevelIndent, AttrBevelLightAngle, AttrBevelContrast, AttrBevelType, AttrBevelLightTilt, AttrBrushType, Chapter, AttrClipView, AttrFlatColourFill, AttrFlatTranspFill, AttrLinearColourFill, AttrLinearTranspFill, AttrRadialColourFill, AttrRadialTranspFill, AttrConicalColourFill, AttrConicalTranspFill, AttrSquareColourFill, AttrSquareTranspFill, AttrThreeColColourFill, AttrThreeColTranspFill, AttrFourColColourFill, AttrFourColTranspFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrFractalColourFill, AttrNoiseColourFill, AttrFractalTranspFill, AttrNoiseTranspFill, AttrFillMappingLinear, AttrFillMappingSin, AttrFillEffectFade, AttrFillEffectRainbow, AttrFillEffectAltRainbow, AttrTranspFillMappingLinear, AttrTranspFillMappingSin, AttrFeather, NodeGrid, NodeGroup, NodeGuideline, AttrOverprintLine, AttrOverprintFill, AttrPrintOnAllPlates, Layer, AttrLineWidth, AttrStrokeColour, AttrStrokeTransp, AttrStartArrow, AttrEndArrow, AttrStartCap, AttrJoinType, AttrMitreLimit, AttrWindingRule, AttrDashPattern, NodeContourController, NodeBlendPath, NodeBrushPath, NodeClipViewController, NodeMouldGroup, NodeMouldPath, NodeSetProperty, NodeBarProperty, NodeSetSentinel, NodeBevel, NodeBlender, NodeBlend, NodeBitmap, NodeBrush, NodeClipView, NodeContour, NodeLiveEffect, NodeLockedEffect, NodeFeatherEffect, NodeMoulder, NodeMould, NodePath, NodeRegularShape, TextChar, KernCode, HorizontalTab, CaretNode, EOLNode, TextLine, TextStory, Page, AttrQuality, Spread, AttrStrokeType, AttrVariableWidth, TemplateAttribute, StyleReferenceAttribute, AttrTxtFontTypeface, AttrTxtBold, AttrTxtItalic, AttrTxtUnderline, AttrTxtAspectRatio, AttrTxtJustification, AttrTxtTracking, AttrTxtFontSize, AttrTxtScript, AttrTxtBaseLine, AttrTxtLeftMargin, AttrTxtRightMargin, AttrTxtFirstIndent, AttrTxtRuler, AttrTxtLineSpace, AttrUser, and AttrWebAddress.

Definition at line 5725 of file node.cpp.

05726 {
05727     return FALSE;
05728 }


Friends And Related Function Documentation

friend class NodeHidden [friend]
 

Definition at line 838 of file node.h.


Member Data Documentation

Node* Node::Child [protected]
 

Definition at line 779 of file node.h.

NodeFlags Node::Flags [protected]
 

Definition at line 774 of file node.h.

UINT32 Node::HiddenRefCnt [protected]
 

Definition at line 784 of file node.h.

BOOL Node::HourglassOn = FALSE [static, private]
 

Definition at line 813 of file node.h.

Node* Node::Next [protected]
 

Definition at line 778 of file node.h.

Node* Node::Parent [protected]
 

Definition at line 780 of file node.h.

MILLIPOINT Node::PixelHeight [static, protected]
 

Definition at line 792 of file node.h.

MILLIPOINT Node::PixelWidth [static, protected]
 

Definition at line 791 of file node.h.

Node* Node::Previous [protected]
 

Definition at line 777 of file node.h.

UINT32 Node::Tag [protected]
 

Definition at line 773 of file node.h.


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