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 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkOctreeNode.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-06 20:53:15 $
00007   Version:   $Revision: 1.6 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkOctreeNode_h
00018 #define __itkOctreeNode_h
00019 #include "itkMacro.h"
00020 namespace itk {
00021 
00022 enum LeafIdentifier { ZERO=0,ONE=1,TWO=2,THREE=3,FOUR=4,FIVE=5,SIX=6,SEVEN=7 };
00023 
00024 
00025 //A forward-declaration
00026 class OctreeNodeBranch;
00027 class OctreeBase;
00028   
00039 class ITKCommon_EXPORT OctreeNode
00040 {
00041 public:
00042 
00049   OctreeNode(void);
00050 
00055   virtual ~OctreeNode(void);
00056 
00065   OctreeNode & GetChild(const enum LeafIdentifier ChildID) const;
00066   OctreeNode & GetChild(const enum LeafIdentifier ChildID);
00067 
00078   int GetColor(void) const;
00079 
00088   void SetColor( int NodeColor);
00089 
00098   void SetBranch(OctreeNodeBranch * NewBranch);
00099 
00106   bool IsNodeColored(void) const;
00107   inline void SetParentOctree(OctreeBase *parent)
00108     {
00109     m_Parent = parent;
00110     }
00111 protected:
00112 private:
00113 
00119   void RemoveChildren(void);
00120 
00124   OctreeNodeBranch * m_Branch; 
00125   OctreeBase       * m_Parent;
00126 };
00127 
00128 class OctreeNodeBranch
00129 {
00130 public:
00131   OctreeNodeBranch(OctreeBase *parent)
00132     {
00133     for(int i = 0; i < 8; i++)
00134       {
00135       m_Leaves[i].SetParentOctree(parent);
00136       }
00137     }
00138   inline OctreeNode *GetLeaf(enum LeafIdentifier LeafID)
00139     {
00140     return &m_Leaves[LeafID];
00141     }
00142 private:
00143   OctreeNode m_Leaves[8];
00144 };
00145 } //End of itk Namespace
00146 #endif                          /* __itkOctreeNode_h */
00147 

Generated at Sat Feb 28 13:10:13 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000