VTK  9.1.0
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=========================================================================*/
47#ifndef vtkSimpleScalarTree_h
48#define vtkSimpleScalarTree_h
49
50#include "vtkCommonExecutionModelModule.h" // For export macro
51#include "vtkScalarTree.h"
52
53class vtkScalarNode;
55
56class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleScalarTree : public vtkScalarTree
57{
58public:
64
66
70 void PrintSelf(ostream& os, vtkIndent indent) override;
72
77 void ShallowCopy(vtkScalarTree* stree) override;
78
80
86 vtkSetClampMacro(BranchingFactor, int, 2, VTK_INT_MAX);
87 vtkGetMacro(BranchingFactor, int);
89
91
95 vtkGetMacro(Level, int);
97
99
102 vtkSetClampMacro(MaxLevel, int, 1, VTK_INT_MAX);
103 vtkGetMacro(MaxLevel, int);
105
110 void BuildTree() override;
111
115 void Initialize() override;
116
121 void InitTraversal(double scalarValue) override;
122
129 vtkCell* GetNextCell(vtkIdType& cellId, vtkIdList*& ptIds, vtkDataArray* cellScalars) override;
130
131 // The following methods supports parallel (threaded) traversal. Basically
132 // batches of cells (which are a portion of the whole dataset) are available for
133 // processing in a parallel For() operation.
134
140 vtkIdType GetNumberOfCellBatches(double scalarValue) override;
141
147 const vtkIdType* GetCellBatch(vtkIdType batchNum, vtkIdType& numCells) override;
148
149protected:
152
154 int Level;
155 int BranchingFactor; // number of children per node
156 vtkScalarNode* Tree; // pointerless scalar range tree
157 int TreeSize; // allocated size of tree
158 vtkIdType LeafOffset; // offset to leaf nodes of tree
159
160private:
161 vtkIdType NumCells; // the number of cells in this dataset
162 vtkIdType TreeIndex; // traversal location within tree
163 int ChildNumber; // current child in traversal
164 vtkIdType CellId; // current cell id being examined
165 int FindStartLeaf(vtkIdType index, int level);
166 int FindNextLeaf(vtkIdType index, int level);
167
168 vtkIdType* CandidateCells; // to support parallel computing
169 vtkIdType NumCandidates;
170
171private:
173 void operator=(const vtkSimpleScalarTree&) = delete;
174};
175
176#endif
abstract class to specify cell behavior
Definition: vtkCell.h:147
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
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.
int vtkIdType
Definition: vtkType.h:332
#define VTK_INT_MAX
Definition: vtkType.h:155