Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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 Member Functions

 CTreeNode ()
 CTreeNode (const CTreeNode &cSource)
virtual ~CTreeNode ()
virtual CTreeNodeappend (CTreeNode *pcNode, Where w=End)
virtual CTreeNodeappend (CTreeNode *pcWhere, CTreeNode *pcAppend, Where w=End)
virtual CTreeNodeinsert (CTreeNode *pcWhere, CTreeNode *pcInsert)
virtual void remove (CTreeNode *pcRemove)
virtual void remove (CTreeTraverserBase *pcTraverser)
virtual void replace (CTreeNode *pcReplace, CTreeNode *pcWith)
virtual CTreeNodegetParent () const
virtual int numChildren () const
virtual const CList< CTreeNode > & getChildrenList () const
virtual CTreeNodeoperator= (const CTreeNode &cSource)
virtual CTreeNodeoperator[] (int i) const
virtual bool isEqual (const CTreeNode *pcNode) const
virtual void printTree (ostream &out=cout) const

Protected Member Functions

virtual void print (ostream &out) const

Protected Attributes

CTreeNodem_pcParent
CList< CTreeNodem_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.

void CTreeNode::replace CTreeNode pcReplace,
CTreeNode pcWith
[virtual]
 

Replaces the node given by 'pcReplace' with another given by 'pcWith'.


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 on Tue Oct 21 02:15:04 2003 for QGLViewer by doxygen 1.3.4