VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSimpleScalarTree.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 =========================================================================*/ 00034 #ifndef __vtkSimpleScalarTree_h 00035 #define __vtkSimpleScalarTree_h 00036 00037 #include "vtkScalarTree.h" 00038 00039 //BTX 00040 class vtkScalarNode; 00041 //ETX 00042 00043 class VTK_FILTERING_EXPORT vtkSimpleScalarTree : public vtkScalarTree 00044 { 00045 public: 00048 static vtkSimpleScalarTree *New(); 00049 00051 00052 vtkTypeMacro(vtkSimpleScalarTree,vtkScalarTree); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00055 00057 00061 vtkSetClampMacro(BranchingFactor,int,2,VTK_LARGE_INTEGER); 00062 vtkGetMacro(BranchingFactor,int); 00064 00066 00068 vtkGetMacro(Level,int); 00070 00072 00073 vtkSetClampMacro(MaxLevel,int,1,VTK_LARGE_INTEGER); 00074 vtkGetMacro(MaxLevel,int); 00076 00080 virtual void BuildTree(); 00081 00083 virtual void Initialize(); 00084 00087 virtual void InitTraversal(double scalarValue); 00088 00090 00094 virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds, 00095 vtkDataArray *cellScalars); 00097 00098 protected: 00099 vtkSimpleScalarTree(); 00100 ~vtkSimpleScalarTree(); 00101 00102 vtkDataArray *Scalars; 00103 int MaxLevel; 00104 int Level; 00105 int BranchingFactor; //number of children per node 00106 vtkScalarNode *Tree; //pointerless scalar range tree 00107 int TreeSize; //allocated size of tree 00108 00109 private: 00110 vtkIdType TreeIndex; //traversal location within tree 00111 vtkIdType LeafOffset; //offset to leaf nodes of tree 00112 int ChildNumber; //current child in traversal 00113 vtkIdType CellId; //current cell id being examined 00114 int FindStartLeaf(vtkIdType index, int level); 00115 int FindNextLeaf(vtkIdType index,int level); 00116 00117 private: 00118 vtkSimpleScalarTree(const vtkSimpleScalarTree&); // Not implemented. 00119 void operator=(const vtkSimpleScalarTree&); // Not implemented. 00120 }; 00121 00122 #endif 00123 00124