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 =========================================================================*/
50 #ifndef vtkSimpleScalarTree_h
51 #define vtkSimpleScalarTree_h
52 
53 #include "vtkCommonExecutionModelModule.h" // For export macro
54 #include "vtkScalarTree.h"
55 
56 class vtkScalarNode;
57 
58 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleScalarTree : public vtkScalarTree
59 {
60 public:
66 
68 
72  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
76 
82  vtkSetClampMacro(BranchingFactor,int,2,VTK_INT_MAX);
83  vtkGetMacro(BranchingFactor,int);
85 
87 
91  vtkGetMacro(Level,int);
93 
95 
98  vtkSetClampMacro(MaxLevel,int,1,VTK_INT_MAX);
99  vtkGetMacro(MaxLevel,int);
101 
106  void BuildTree() override;
107 
111  void Initialize() override;
112 
117  void InitTraversal(double scalarValue) override;
118 
126  vtkDataArray *cellScalars) override;
127 
128  // The following methods supports parallel (threaded)
129  // applications. Basically batches of cells (which represent a
130  // portion of the whole dataset) are available for processing in a
131  // parallel For() operation.
132 
142 
149  vtkIdType& numCells) override;
150 
151 protected:
154 
155  int MaxLevel;
156  int Level;
157  int BranchingFactor; //number of children per node
158  vtkScalarNode *Tree; //pointerless scalar range tree
159  int TreeSize; //allocated size of tree
160  vtkIdType LeafOffset; //offset to leaf nodes of tree
161 
162 private:
163  vtkIdType NumCells; //the number of cells in this dataset
164  vtkIdType TreeIndex; //traversal location within tree
165  int ChildNumber; //current child in traversal
166  vtkIdType CellId; //current cell id being examined
167  int FindStartLeaf(vtkIdType index, int level);
168  int FindNextLeaf(vtkIdType index,int level);
169 
170  vtkIdType *CandidateCells; //to support parallel computing
171  vtkIdType NumCandidates;
172 
173 private:
174  vtkSimpleScalarTree(const vtkSimpleScalarTree&) = delete;
175  void operator=(const vtkSimpleScalarTree&) = delete;
176 };
177 
178 #endif
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:159
vtkSimpleScalarTree::InitTraversal
void InitTraversal(double scalarValue) override
Begin to traverse the cells based on a scalar value.
vtkSimpleScalarTree::LeafOffset
vtkIdType LeafOffset
Definition: vtkSimpleScalarTree.h:160
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkSimpleScalarTree::Initialize
void Initialize() override
Initialize locator.
vtkScalarTree.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:60
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:37
vtkSimpleScalarTree::Level
int Level
Definition: vtkSimpleScalarTree.h:156
vtkSimpleScalarTree::GetNextCell
vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars) override
Return the next cell that may contain scalar value specified to initialize traversal.
vtkSimpleScalarTree::vtkSimpleScalarTree
vtkSimpleScalarTree()
vtkSimpleScalarTree::TreeSize
int TreeSize
Definition: vtkSimpleScalarTree.h:159
vtkSimpleScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkSimpleScalarTree.h:59
vtkSimpleScalarTree::BranchingFactor
int BranchingFactor
Definition: vtkSimpleScalarTree.h:157
vtkSimpleScalarTree::GetCellBatch
const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells) override
Return the array of cell ids in the specified batch.
vtkSimpleScalarTree::GetNumberOfCellBatches
vtkIdType GetNumberOfCellBatches() override
Get the number of cell batches available for processing.
vtkSimpleScalarTree::New
static vtkSimpleScalarTree * New()
Instantiate scalar tree with maximum level of 20 and branching factor of three.
vtkSimpleScalarTree::MaxLevel
int MaxLevel
Definition: vtkSimpleScalarTree.h:155
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkSimpleScalarTree::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSimpleScalarTree::~vtkSimpleScalarTree
~vtkSimpleScalarTree() override
vtkSimpleScalarTree::Tree
vtkScalarNode * Tree
Definition: vtkSimpleScalarTree.h:158
vtkSimpleScalarTree::BuildTree
void BuildTree() override
Construct the scalar tree from the dataset provided.