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=========================================================================*/
49
50#ifndef vtkSimpleScalarTree_h
51#define vtkSimpleScalarTree_h
52
53#include "vtkCommonExecutionModelModule.h" // For export macro
54#include "vtkScalarTree.h"
55
56class vtkScalarNode;
58
59class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleScalarTree : public vtkScalarTree
60{
61public:
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
152protected:
155
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
163private:
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
174private:
176 void operator=(const vtkSimpleScalarTree&) = delete;
177};
178
179#endif
abstract class to specify cell behavior
Definition vtkCell.h:61
list of point or cell ids
Definition vtkIdList.h:34
a simple class to control print indentation
Definition vtkIndent.h:40
organize data according to scalar values (used to accelerate contouring operations)
vtkIdType GetNumberOfCellBatches(double scalarValue) override
Get the number of cell batches available for processing as a function of the specified scalar value.
~vtkSimpleScalarTree() override
const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells) override
Return the array of cell ids in the specified batch.
void ShallowCopy(vtkScalarTree *stree) override
This method is used to copy data members when cloning an instance of the class.
void BuildTree() override
Construct the scalar tree from the dataset provided.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type related macros and PrintSelf() method.
static vtkSimpleScalarTree * New()
Instantiate scalar tree with maximum level of 20 and branching factor of three.
vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars) override
Return the next cell that may contain scalar value specified to initialize traversal.
void InitTraversal(double scalarValue) override
Begin to traverse the cells based on a scalar value.
void Initialize() override
Initialize locator.
#define vtkDataArray
int vtkIdType
Definition vtkType.h:332
#define VTK_INT_MAX
Definition vtkType.h:155