DocTreeSource Class Reference

Concretisation of NodeScan::Source for all NodeRenderableInks in a document's object tree (generally), or in the 'selected' document's tree (specifically). More...

#include <ngiter.h>

Inheritance diagram for DocTreeSource:

NodeScan::Source SelectDocSource NotSelectSource List of all members.

Public Member Functions

 DocTreeSource (BaseDocument *pDoc=0)
 Constructs a DocTreeSource object.

Protected Member Functions

virtual NodeGetFirst ()
 Identical to Node::DocFindFirstDepthFirst but skips over hidden nodes. NB. the first node in the document tree is guaranteed to never be hidden.
virtual NodeGetNext (Node *)
 Identical to Node::DocFindNextDepthFirst but skips over hidden nodes. To be precise, it doesn't follow child links for NodeHiddens.

Protected Attributes

BaseDocumentm_pDoc

Detailed Description

Concretisation of NodeScan::Source for all NodeRenderableInks in a document's object tree (generally), or in the 'selected' document's tree (specifically).

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/99

Definition at line 194 of file ngiter.h.


Constructor & Destructor Documentation

DocTreeSource::DocTreeSource BaseDocument pDoc = 0  ) 
 

Constructs a DocTreeSource object.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/99
Parameters:
pDoc --- the document whose tree is to be scanned, if any [INPUTS]
See also:
NodeScan::Source; NodeScan

Definition at line 262 of file ngiter.cpp.

00263   : m_pDoc(pDoc)
00264 {
00265     // Empty.
00266 }


Member Function Documentation

Node * DocTreeSource::GetFirst  )  [protected, virtual]
 

Identical to Node::DocFindFirstDepthFirst but skips over hidden nodes. NB. the first node in the document tree is guaranteed to never be hidden.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/99
Returns:
The first non-hidden node in a depth-first traversal of the tree, or null.
See also:
NodeScan::Source; DocTreeSource::GetNext

Implements NodeScan::Source.

Reimplemented in SelectDocSource, and NotSelectSource.

Definition at line 282 of file ngiter.cpp.

00283 {
00284     ERROR3IF(m_pDoc == 0, "DocTreeSource::GetFirst: no document");
00285 
00286     Node* pNode = m_pDoc->GetFirstNode();
00287     if (pNode != 0 && !pNode->IsSetCandidate()) pNode = GetNext(pNode);
00288     return pNode;
00289 }

Node * DocTreeSource::GetNext Node pNode  )  [protected, virtual]
 

Identical to Node::DocFindNextDepthFirst but skips over hidden nodes. To be precise, it doesn't follow child links for NodeHiddens.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/99
Parameters:
pNode --- the previous node returned by _GetNext [INPUTS]
Returns:
The next non-hidden node in a depth-first traversal of the tree, or null.
See also:
NodeScan::Source; DocTreeSource::GetFirst
Notes: Karim 14/12/2000 Modified so that we also skip NodeMoulds in the tree, as the user must not be allowed to select moulded objects. This is achieved by effectively hiding them from the NameGallery's scans. ps, TODO: Rather than test specifically for NodeMould, use a similar mechanism to IsSetCandidate().

Implements NodeScan::Source.

Reimplemented in NotSelectSource.

Definition at line 312 of file ngiter.cpp.

00313 {
00314     do {
00315         if (pNode->FindNext() == 0)
00316             pNode = pNode->FindParent();
00317         else
00318         {
00319             pNode = pNode->FindNext();
00320             while ( !pNode->IsNodeHidden() &&
00321                     !pNode->IsANodeMould() && pNode->FindFirstChild() != 0 )
00322                 pNode = pNode->FindFirstChild();
00323         }
00324     } while (pNode != 0 && !pNode->IsSetCandidate());
00325 
00326     return pNode;
00327 }


Member Data Documentation

BaseDocument* DocTreeSource::m_pDoc [protected]
 

Definition at line 204 of file ngiter.h.


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