VTK  9.2.6
vtkSpanSpace.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSpanSpace.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=========================================================================*/
42#ifndef vtkSpanSpace_h
43#define vtkSpanSpace_h
44
45#include "vtkCommonExecutionModelModule.h" // For export macro
46#include "vtkScalarTree.h"
47
48class vtkSpanSpace;
49struct vtkInternalSpanSpace;
50
51class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSpanSpace : public vtkScalarTree
52{
53public:
58 static vtkSpanSpace* New();
59
61
65 void PrintSelf(ostream& os, vtkIndent indent) override;
67
72 void ShallowCopy(vtkScalarTree* stree) override;
73
74 //----------------------------------------------------------------------
75 // The following methods are specific to the creation and configuration of
76 // vtkSpanSpace.
77
79
87 vtkSetVector2Macro(ScalarRange, double);
88 vtkGetVectorMacro(ScalarRange, double, 2);
90
92
96 vtkSetMacro(ComputeScalarRange, vtkTypeBool);
97 vtkGetMacro(ComputeScalarRange, vtkTypeBool);
98 vtkBooleanMacro(ComputeScalarRange, vtkTypeBool);
100
102
110 vtkSetClampMacro(Resolution, vtkIdType, 1, 10000);
111 vtkGetMacro(Resolution, vtkIdType);
113
115
119 vtkSetMacro(ComputeResolution, vtkTypeBool);
120 vtkGetMacro(ComputeResolution, vtkTypeBool);
121 vtkBooleanMacro(ComputeResolution, vtkTypeBool);
123
125
129 vtkSetClampMacro(NumberOfCellsPerBucket, int, 1, VTK_INT_MAX);
130 vtkGetMacro(NumberOfCellsPerBucket, int);
132
133 //----------------------------------------------------------------------
134 // The following methods satisfy the vtkScalarTree abstract API.
135
140 void Initialize() override;
141
146 void BuildTree() override;
147
155 void InitTraversal(double scalarValue) override;
156
163 vtkCell* GetNextCell(vtkIdType& cellId, vtkIdList*& ptIds, vtkDataArray* cellScalars) override;
164
165 // The following methods supports parallel (threaded) traversal. Basically
166 // batches of cells (which are a portion of the whole dataset) are available for
167 // processing in a parallel For() operation.
168
174 vtkIdType GetNumberOfCellBatches(double scalarValue) override;
175
181 const vtkIdType* GetCellBatch(vtkIdType batchNum, vtkIdType& numCells) override;
182
184
188 vtkSetClampMacro(BatchSize, vtkIdType, 100, VTK_INT_MAX);
189 vtkGetMacro(BatchSize, vtkIdType);
191
192protected:
194 ~vtkSpanSpace() override;
195
196 double ScalarRange[2];
201 vtkInternalSpanSpace* SpanSpace;
203
204private:
205 // Internal variables supporting span space traversal
206 vtkIdType RMin[2]; // span space lower left corner
207 vtkIdType RMax[2]; // span space upper right corner
208
209 // This supports serial traversal via GetNextCell()
210 vtkIdType CurrentRow; // the span space row currently being processed
211 vtkIdType* CurrentSpan; // pointer to current span row
212 vtkIdType CurrentIdx; // position into the current span row
213 vtkIdType CurrentNumCells; // number of cells on the current span row
214
215private:
216 vtkSpanSpace(const vtkSpanSpace&) = delete;
217 void operator=(const vtkSpanSpace&) = delete;
218};
219
220#endif
abstract class to specify cell behavior
Definition vtkCell.h:61
abstract superclass for arrays of numeric data
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)
organize data according to scalar span space
vtkTypeBool ComputeScalarRange
vtkIdType Resolution
static vtkSpanSpace * New()
Instantiate a scalar tree with default resolution of 100 and automatic scalar range computation.
vtkIdType BatchSize
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type related macros and PrintSelf() method.
~vtkSpanSpace() override
void InitTraversal(double scalarValue) override
Begin to traverse the cells based on a scalar value.
const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells) override
Return the array of cell ids in the specified batch.
void Initialize() override
Initialize the span space.
vtkInternalSpanSpace * SpanSpace
vtkTypeBool ComputeResolution
void ShallowCopy(vtkScalarTree *stree) override
This method is used to copy data members when cloning an instance of the class.
vtkIdType GetNumberOfCellBatches(double scalarValue) override
Get the number of cell batches available for processing as a function of the specified scalar value.
int NumberOfCellsPerBucket
void BuildTree() override
Construct the scalar tree from the dataset provided.
vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars) override
Return the next cell that may contain scalar value specified to InitTraversal().
int vtkTypeBool
Definition vtkABI.h:69
int vtkIdType
Definition vtkType.h:332
#define VTK_INT_MAX
Definition vtkType.h:155