Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CTreeNode Class Reference

#include <CTree.h>

Inheritance diagram for CTreeNode::

QSceneTreeNode QSceneTreeDrawable QSceneTreeRenderer QCameraInterpolationTool QCameraKeyPathEditorImpl STDisplayList STLightList STQGLExampleInitNode STQGLExampleLightNode STQGLExampleSphere STQGLViewerBoundingBox CSceneTreeRenderer List of all members.

Public Types

enum  Where { Front, End }

Public Methods

 CTreeNode ()
 CTreeNode (const CTreeNode &cSource)
virtual ~CTreeNode ()
virtual CTreeNode * append (CTreeNode *pcNode, Where w=End)
virtual CTreeNode * append (CTreeNode *pcWhere, CTreeNode *pcAppend, Where w=End)
virtual CTreeNode * insert (CTreeNode *pcWhere, CTreeNode *pcInsert)
virtual void remove (CTreeNode *pcRemove)
virtual void remove (CTreeTraverserBase *pcTraverser)
virtual CTreeNode * getParent () const
virtual int numChildren () const
virtual const CList< CTreeNode > & getChildrenList () const
virtual CTreeNode & operator= (const CTreeNode &cSource)
virtual CTreeNode & operator[] (int i) const
virtual bool isEqual (const CTreeNode *pcNode) const
virtual void printTree (ostream &out=cout) const

Protected Methods

virtual void print (ostream &out) const

Protected Attributes

CTreeNode * m_pcParent
CList< CTreeNode > m_cChildrenList

Friends

ostream & operator<< (ostream &out, CTreeNode *pcTreeNode)

Detailed Description

This class implements a node that can be inserted into a tree.


Member Enumeration Documentation

enum CTreeNode::Where
 

Enumeration values:
Front  
End  


Constructor & Destructor Documentation

CTreeNode::CTreeNode   [inline]
 

Default constructor.

CTreeNode::CTreeNode const CTreeNode &   cSource
 

Copy constructor.

CTreeNode::~CTreeNode   [virtual]
 

Destructor.


Member Function Documentation

virtual CTreeNode* CTreeNode::append CTreeNode *   pcWhere,
CTreeNode *   pcAppend,
Where   w = End
[inline, virtual]
 

Appends the node 'pcAppend' to the children list of node 'pcWhere'. The tree makes a copy of the node, so you can delete the source after appending.

virtual CTreeNode* CTreeNode::append CTreeNode *   pcNode,
Where   w = End
[inline, virtual]
 

Appends the node 'cNode' to the children list of this node.

virtual const CList<CTreeNode>& CTreeNode::getChildrenList   const [inline, virtual]
 

Returns the list of children nodes of this node.

virtual CTreeNode* CTreeNode::getParent   const [inline, virtual]
 

Returns the parent node.

CTreeNode * CTreeNode::insert CTreeNode *   pcWhere,
CTreeNode *   pcInsert
[virtual]
 

Exchanges the node 'pcWhere' against 'pcInsert'. The node 'pcWhere' will be appended to the children list of 'pcInsert'. The parent node of the inserted one is returned.

bool CTreeNode::isEqual const CTreeNode *   pcNode const [virtual]
 

Compares two node.

virtual int CTreeNode::numChildren   const [inline, virtual]
 

Returns the number of children of this node.

CTreeNode & CTreeNode::operator= const CTreeNode &   cSource [virtual]
 

Assigns one node to another.

CTreeNode & CTreeNode::operator[] int   i const [virtual]
 

Returns the i-th child of this node.

NOTE: If i<0 the program will exit with a message
and if i>numCildren() the last child is returned.

void CTreeNode::print ostream &   out const [protected, virtual]
 

void CTreeNode::printTree ostream &   out = cout const [virtual]
 

Prints the tree that starts at this node in breath-first-order.

void CTreeNode::remove CTreeTraverserBase *   pcTraverser [virtual]
 

Remove the node which the iterater points to from the tree.

void CTreeNode::remove CTreeNode *   pcRemove [virtual]
 

Remove the specified node from the tree.


Friends And Related Function Documentation

ostream& operator<< ostream &   out,
CTreeNode *   pcTreeNode
[friend]
 


Member Data Documentation

CList<CTreeNode> CTreeNode::m_cChildrenList [protected]
 

CTreeNode* CTreeNode::m_pcParent [protected]
 


The documentation for this class was generated from the following files:
Generated at Thu Oct 4 17:17:29 2001 for QGLViewer by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001