VTK  9.2.6
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 =========================================================================*/
50 #ifndef vtkSimpleScalarTree_h
51 #define vtkSimpleScalarTree_h
52 
53 #include "vtkCommonExecutionModelModule.h" // For export macro
54 #include "vtkScalarTree.h"
55 
56 class vtkScalarNode;
58 
59 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleScalarTree : public vtkScalarTree
60 {
61 public:
66  static vtkSimpleScalarTree* New();
67 
69 
73  void PrintSelf(ostream& os, vtkIndent indent) override;
75 
80  void ShallowCopy(vtkScalarTree* stree) override;
81 
83 
89  vtkSetClampMacro(BranchingFactor, int, 2, VTK_INT_MAX);
90  vtkGetMacro(BranchingFactor, int);
92 
94 
98  vtkGetMacro(Level, int);
100 
102 
105  vtkSetClampMacro(MaxLevel, int, 1, VTK_INT_MAX);
106  vtkGetMacro(MaxLevel, int);
108 
113  void BuildTree() override;
114 
118  void Initialize() override;
119 
124  void InitTraversal(double scalarValue) override;
125 
132  vtkCell* GetNextCell(vtkIdType& cellId, vtkIdList*& ptIds, vtkDataArray* cellScalars) override;
133 
134  // The following methods supports parallel (threaded) traversal. Basically
135  // batches of cells (which are a portion of the whole dataset) are available for
136  // processing in a parallel For() operation.
137 
143  vtkIdType GetNumberOfCellBatches(double scalarValue) override;
144 
150  const vtkIdType* GetCellBatch(vtkIdType batchNum, vtkIdType& numCells) override;
151 
152 protected:
154  ~vtkSimpleScalarTree() override;
155 
156  int MaxLevel;
157  int Level;
158  int BranchingFactor; // number of children per node
159  vtkScalarNode* Tree; // pointerless scalar range tree
160  int TreeSize; // allocated size of tree
161  vtkIdType LeafOffset; // offset to leaf nodes of tree
162 
163 private:
164  vtkIdType NumCells; // the number of cells in this dataset
165  vtkIdType TreeIndex; // traversal location within tree
166  int ChildNumber; // current child in traversal
167  vtkIdType CellId; // current cell id being examined
168  int FindStartLeaf(vtkIdType index, int level);
169  int FindNextLeaf(vtkIdType index, int level);
170 
171  vtkIdType* CandidateCells; // to support parallel computing
172  vtkIdType NumCandidates;
173 
174 private:
175  vtkSimpleScalarTree(const vtkSimpleScalarTree&) = delete;
176  void operator=(const vtkSimpleScalarTree&) = delete;
177 };
178 
179 #endif
#define VTK_INT_MAX
Definition: vtkType.h:155
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type related macros and PrintSelf() method.
int vtkIdType
Definition: vtkType.h:332
virtual void InitTraversal(double scalarValue)=0
Begin to traverse the cells based on a scalar value (serial traversal).
abstract class to specify cell behavior
Definition: vtkCell.h:60
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
virtual vtkIdType GetNumberOfCellBatches(double scalarValue)=0
Get the number of cell batches available for processing as a function of the specified scalar value...
virtual vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars)=0
Return the next cell that may contain scalar value specified to InitTraversal() (serial traversal)...
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:54
virtual const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells)=0
Return the array of cell ids in the specified batch.
virtual void Initialize()=0
Initialize locator.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void ShallowCopy(vtkScalarTree *stree)
This method is used to copy data members when cloning an instance of the class.
virtual void BuildTree()=0
Construct the scalar tree from the dataset provided.
organize data according to scalar values (used to accelerate contouring operations) ...