VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkHyperOctreeCursor.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00024 #ifndef __vtkHyperOctreeCursor_h 00025 #define __vtkHyperOctreeCursor_h 00026 00027 #include "vtkCommonDataModelModule.h" // For export macro 00028 #include "vtkObject.h" 00029 00030 enum 00031 { 00032 VTK_OCTREE_CHILD_ZMIN_YMIN_XMIN=0, 00033 VTK_OCTREE_CHILD_ZMIN_YMIN_XMAX, 00034 VTK_OCTREE_CHILD_ZMIN_YMAX_XMIN, 00035 VTK_OCTREE_CHILD_ZMIN_YMAX_XMAX, 00036 VTK_OCTREE_CHILD_ZMAX_YMIN_XMIN, 00037 VTK_OCTREE_CHILD_ZMAX_YMIN_XMAX, 00038 VTK_OCTREE_CHILD_ZMAX_YMAX_XMIN, 00039 VTK_OCTREE_CHILD_ZMAX_YMAX_XMAX 00040 }; 00041 00042 const int VTK_QUADTREE_CHILD_SW=VTK_OCTREE_CHILD_ZMIN_YMIN_XMIN; 00043 const int VTK_QUADTREE_CHILD_SE=VTK_OCTREE_CHILD_ZMIN_YMIN_XMAX; 00044 const int VTK_QUADTREE_CHILD_NW=VTK_OCTREE_CHILD_ZMIN_YMAX_XMIN; 00045 const int VTK_QUADTREE_CHILD_NE=VTK_OCTREE_CHILD_ZMIN_YMAX_XMAX; 00046 00047 const int VTK_BINARY_TREE_CHILD_LEFT=VTK_QUADTREE_CHILD_SW; 00048 const int VTK_BINARY_TREE_CHILD_RIGHT=VTK_QUADTREE_CHILD_SE; 00049 00050 class VTKCOMMONDATAMODEL_EXPORT vtkHyperOctreeCursor : public vtkObject 00051 { 00052 public: 00053 vtkTypeMacro(vtkHyperOctreeCursor,vtkObject); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00058 virtual int GetLeafId()=0; 00059 00061 virtual int CurrentIsLeaf()=0; 00062 00064 virtual int CurrentIsRoot()=0; 00065 00068 virtual int GetCurrentLevel()=0; 00069 00073 virtual int GetChildIndex()=0; 00074 00075 // Are the children of the current node all leaves? 00076 // This query can be called also on a leaf node. 00077 // \post compatible: result implies !CurrentIsLeaf() 00078 virtual int CurrentIsTerminalNode()=0; 00079 00082 virtual void ToRoot()=0; 00083 00086 virtual void ToParent()=0; 00087 00091 virtual void ToChild(int child)=0; 00092 00096 virtual void ToSameNode(vtkHyperOctreeCursor *other)=0; 00097 00100 virtual int IsEqual(vtkHyperOctreeCursor *other)=0; 00101 00104 virtual vtkHyperOctreeCursor *Clone()=0; 00105 00108 virtual int SameTree(vtkHyperOctreeCursor *other)=0; 00109 00114 virtual int GetIndex(int d)=0; 00115 00118 virtual int GetNumberOfChildren()=0; 00119 00121 virtual int GetDimension()=0; 00122 00124 00130 virtual void MoveToNode(int *indices, 00131 int level)=0; 00133 00135 virtual int Found()=0; 00136 00137 protected: 00138 // Constructor. 00139 vtkHyperOctreeCursor(); 00140 virtual ~vtkHyperOctreeCursor(); 00141 private: 00142 vtkHyperOctreeCursor(const vtkHyperOctreeCursor&); // Not implemented. 00143 void operator=(const vtkHyperOctreeCursor&); // Not implemented. 00144 }; 00145 #endif