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 "vtkCommonExecutionModelModule.h" // For export macro 00038 #include "vtkScalarTree.h" 00039 00040 //BTX 00041 class vtkScalarNode; 00042 //ETX 00043 00044 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleScalarTree : public vtkScalarTree 00045 { 00046 public: 00049 static vtkSimpleScalarTree *New(); 00050 00052 00053 vtkTypeMacro(vtkSimpleScalarTree,vtkScalarTree); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00056 00058 00062 vtkSetClampMacro(BranchingFactor,int,2,VTK_INT_MAX); 00063 vtkGetMacro(BranchingFactor,int); 00065 00067 00069 vtkGetMacro(Level,int); 00071 00073 00074 vtkSetClampMacro(MaxLevel,int,1,VTK_INT_MAX); 00075 vtkGetMacro(MaxLevel,int); 00077 00081 virtual void BuildTree(); 00082 00084 virtual void Initialize(); 00085 00088 virtual void InitTraversal(double scalarValue); 00089 00091 00095 virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds, 00096 vtkDataArray *cellScalars); 00098 00099 protected: 00100 vtkSimpleScalarTree(); 00101 ~vtkSimpleScalarTree(); 00102 00103 vtkDataArray *Scalars; 00104 int MaxLevel; 00105 int Level; 00106 int BranchingFactor; //number of children per node 00107 vtkScalarNode *Tree; //pointerless scalar range tree 00108 int TreeSize; //allocated size of tree 00109 00110 private: 00111 vtkIdType TreeIndex; //traversal location within tree 00112 vtkIdType LeafOffset; //offset to leaf nodes of tree 00113 int ChildNumber; //current child in traversal 00114 vtkIdType CellId; //current cell id being examined 00115 int FindStartLeaf(vtkIdType index, int level); 00116 int FindNextLeaf(vtkIdType index,int level); 00117 00118 private: 00119 vtkSimpleScalarTree(const vtkSimpleScalarTree&); // Not implemented. 00120 void operator=(const vtkSimpleScalarTree&); // Not implemented. 00121 }; 00122 00123 #endif 00124 00125