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

itkOctreeNode.h

Go to the documentation of this file.
00001 #ifndef __ITKOCTREENODE_H__
00002 #define __ITKOCTREENODE_H__
00003 /*********************************** MH-CRC IPL *****************************************
00004  * Iowa MH-CRC IPL C Header File
00005  * Copyright (C) 1998 Nancy C. Andreasen and Vincent A. Magnotta
00006  * File Name:        itkOctree.h
00007  * \author Hans J. Johnson
00008  * \brief Includes the basic class definitions for using Octtrees.
00009  *****************************************************************************************/
00010 #include "itkMacro.h"
00011 namespace itk {
00012   enum LeafIdentifier { ZERO=0,ONE=1,TWO=2,THREE=3,FOUR=4,FIVE=5,SIX=6,SEVEN=7 };
00013 
00014 
00015   //A forward-declaration
00016   class OctreeNodeBranch;
00017   class OctreeBase;
00027   class ITKCommon_EXPORT OctreeNode
00028   {
00029   public:
00036     OctreeNode(void);
00041     virtual ~OctreeNode(void);
00042 
00051     OctreeNode & GetChild(const enum LeafIdentifier ChildID) const;
00052     OctreeNode & GetChild(const enum LeafIdentifier ChildID);
00062     int GetColor(void) const;
00071     void SetColor( int NodeColor);
00080     void SetBranch(OctreeNodeBranch * NewBranch);
00087     bool IsNodeColored(void) const;
00088     inline void SetParentOctree(OctreeBase *parent)
00089     {
00090       m_Parent = parent;
00091     }
00092   protected:
00093   private:
00099     void RemoveChildren(void);
00100 
00104     OctreeNodeBranch * m_Branch; 
00105     OctreeBase *m_Parent;
00106   };
00107 
00108   class OctreeNodeBranch
00109   {
00110   public:
00111     OctreeNodeBranch(OctreeBase *parent)
00112     {
00113       for(int i = 0; i < 8; i++)
00114         m_Leaves[i].SetParentOctree(parent);
00115     }
00116     inline OctreeNode *GetLeaf(enum LeafIdentifier LeafID)
00117     {
00118       return &m_Leaves[LeafID];
00119     }
00120   private:
00121     OctreeNode m_Leaves[8];
00122   };
00123 } //End of itk Namespace
00124 #endif                          /* __ITKOCTREENODE_H__ */

Generated at Wed May 24 23:47:55 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000