VTK
vtkSimpleScalarTree.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSimpleScalarTree.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
49 #ifndef vtkSimpleScalarTree_h
50 #define vtkSimpleScalarTree_h
51 
52 #include "vtkCommonExecutionModelModule.h" // For export macro
53 #include "vtkScalarTree.h"
54 
55 //BTX
56 class vtkScalarNode;
57 //ETX
58 
60 {
61 public:
64  static vtkSimpleScalarTree *New();
65 
67 
69  void PrintSelf(ostream& os, vtkIndent indent);
71 
73 
77  vtkSetClampMacro(BranchingFactor,int,2,VTK_INT_MAX);
78  vtkGetMacro(BranchingFactor,int);
80 
82 
84  vtkGetMacro(Level,int);
86 
88 
89  vtkSetClampMacro(MaxLevel,int,1,VTK_INT_MAX);
90  vtkGetMacro(MaxLevel,int);
92 
96  virtual void BuildTree();
97 
99  virtual void Initialize();
100 
103  virtual void InitTraversal(double scalarValue);
104 
106 
110  virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
111  vtkDataArray *cellScalars);
113 
114  // The following methods supports parallel (threaded)
115  // applications. Basically batches of cells (which represent a
116  // portion of the whole dataset) are available for processing in a
117  // parallel For() operation.
118 
126 
128 
131  virtual const vtkIdType* GetCellBatch(vtkIdType batchNum,
132  vtkIdType& numCells);
134 
135 protected:
138 
139  int MaxLevel;
140  int Level;
141  int BranchingFactor; //number of children per node
142  vtkScalarNode *Tree; //pointerless scalar range tree
143  int TreeSize; //allocated size of tree
144  vtkIdType LeafOffset; //offset to leaf nodes of tree
145 
146 private:
147  vtkIdType NumCells; //the number of cells in this dataset
148  vtkIdType TreeIndex; //traversal location within tree
149  int ChildNumber; //current child in traversal
150  vtkIdType CellId; //current cell id being examined
151  int FindStartLeaf(vtkIdType index, int level);
152  int FindNextLeaf(vtkIdType index,int level);
153 
154  vtkIdType *CandidateCells; //to support parallel computing
155  vtkIdType NumCandidates;
156 
157 private:
158  vtkSimpleScalarTree(const vtkSimpleScalarTree&); // Not implemented.
159  void operator=(const vtkSimpleScalarTree&); // Not implemented.
160 };
161 
162 #endif
#define VTKCOMMONEXECUTIONMODEL_EXPORT
#define VTK_INT_MAX
Definition: vtkType.h:130
int vtkIdType
Definition: vtkType.h:247
virtual void InitTraversal(double scalarValue)=0
abstract class to specify cell behavior
Definition: vtkCell.h:58
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars)=0
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:53
virtual const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells)=0
virtual void Initialize()=0
virtual vtkIdType GetNumberOfCellBatches()=0
static vtkObject * New()
void PrintSelf(ostream &os, vtkIndent indent)
virtual void BuildTree()=0
organize data according to scalar values (used to accelerate contouring operations) ...