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=========================================================================*/
38
39#ifndef vtkSpanSpace_h
40#define vtkSpanSpace_h
41
42#include "vtkCommonExecutionModelModule.h" // For export macro
43#include "vtkScalarTree.h"
44
45class vtkSpanSpace;
46struct vtkInternalSpanSpace;
47
48class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSpanSpace : public vtkScalarTree
49{
50public:
55 static vtkSpanSpace* New();
56
58
62 void PrintSelf(ostream& os, vtkIndent indent) override;
64
69 void ShallowCopy(vtkScalarTree* stree) override;
70
71 //----------------------------------------------------------------------
72 // The following methods are specific to the creation and configuration of
73 // vtkSpanSpace.
74
76
84 vtkSetVector2Macro(ScalarRange, double);
85 vtkGetVectorMacro(ScalarRange, double, 2);
87
89
97
99
107 vtkSetClampMacro(Resolution, vtkIdType, 1, 10000);
108 vtkGetMacro(Resolution, vtkIdType);
110
112
120
122
126 vtkSetClampMacro(NumberOfCellsPerBucket, int, 1, VTK_INT_MAX);
127 vtkGetMacro(NumberOfCellsPerBucket, int);
129
130 //----------------------------------------------------------------------
131 // The following methods satisfy the vtkScalarTree abstract API.
132
137 void Initialize() override;
138
143 void BuildTree() override;
144
152 void InitTraversal(double scalarValue) override;
153
160 vtkCell* GetNextCell(vtkIdType& cellId, vtkIdList*& ptIds, vtkDataArray* cellScalars) override;
161
162 // The following methods supports parallel (threaded) traversal. Basically
163 // batches of cells (which are a portion of the whole dataset) are available for
164 // processing in a parallel For() operation.
165
171 vtkIdType GetNumberOfCellBatches(double scalarValue) override;
172
178 const vtkIdType* GetCellBatch(vtkIdType batchNum, vtkIdType& numCells) override;
179
181
185 vtkSetClampMacro(BatchSize, vtkIdType, 100, VTK_INT_MAX);
186 vtkGetMacro(BatchSize, vtkIdType);
188
189protected:
191 ~vtkSpanSpace() override;
192
193 double ScalarRange[2];
198 vtkInternalSpanSpace* SpanSpace;
200
201private:
202 // Internal variables supporting span space traversal
203 vtkIdType RMin[2]; // span space lower left corner
204 vtkIdType RMax[2]; // span space upper right corner
205
206 // This supports serial traversal via GetNextCell()
207 vtkIdType CurrentRow; // the span space row currently being processed
208 vtkIdType* CurrentSpan; // pointer to current span row
209 vtkIdType CurrentIdx; // position into the current span row
210 vtkIdType CurrentNumCells; // number of cells on the current span row
211
212private:
213 vtkSpanSpace(const vtkSpanSpace&) = delete;
214 void operator=(const vtkSpanSpace&) = delete;
215};
216
217#endif
abstract class to specify cell behavior
Definition vtkCell.h:58
list of point or cell ids
Definition vtkIdList.h:31
a simple class to control print indentation
Definition vtkIndent.h:34
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
double ScalarRange[2]
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
#define vtkDataArray
int vtkIdType
Definition vtkType.h:332
#define VTK_INT_MAX
Definition vtkType.h:155