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
56class vtkScalarNode;
57
58class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleScalarTree : public vtkScalarTree
59{
60public:
66
68
72 void PrintSelf(ostream& os, vtkIndent indent) VTK_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() VTK_OVERRIDE;
107
111 void Initialize() VTK_OVERRIDE;
112
117 void InitTraversal(double scalarValue) VTK_OVERRIDE;
118
125 vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
126 vtkDataArray *cellScalars) VTK_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
141 vtkIdType GetNumberOfCellBatches() VTK_OVERRIDE;
142
148 const vtkIdType* GetCellBatch(vtkIdType batchNum,
149 vtkIdType& numCells) VTK_OVERRIDE;
150
151protected:
153 ~vtkSimpleScalarTree() VTK_OVERRIDE;
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
162private:
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
173private:
174 vtkSimpleScalarTree(const vtkSimpleScalarTree&) VTK_DELETE_FUNCTION;
175 void operator=(const vtkSimpleScalarTree&) VTK_DELETE_FUNCTION;
176};
177
178#endif
abstract class to specify cell behavior
Definition: vtkCell.h:60
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
list of point or cell ids
Definition: vtkIdList.h:37
a simple class to control print indentation
Definition: vtkIndent.h:40
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)
void BuildTree() override
Construct the scalar tree from the dataset provided.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkSimpleScalarTree * New()
Instantiate scalar tree with maximum level of 20 and branching factor of three.
@ level
Definition: vtkX3D.h:395
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:287
#define VTK_INT_MAX
Definition: vtkType.h:153