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 
48 class vtkSpanSpace;
49 struct vtkInternalSpanSpace;
50 
51 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSpanSpace : public vtkScalarTree
52 {
53 public:
58  static vtkSpanSpace* New();
59 
61 
64  vtkTypeMacro(vtkSpanSpace, vtkScalarTree);
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 
192 protected:
193  vtkSpanSpace();
194  ~vtkSpanSpace() override;
195 
196  double ScalarRange[2];
201  vtkInternalSpanSpace* SpanSpace;
203 
204 private:
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 
215 private:
216  vtkSpanSpace(const vtkSpanSpace&) = delete;
217  void operator=(const vtkSpanSpace&) = delete;
218 };
219 
220 #endif
vtkInternalSpanSpace * SpanSpace
Definition: vtkSpanSpace.h:201
#define VTK_INT_MAX
Definition: vtkType.h:155
int NumberOfCellsPerBucket
Definition: vtkSpanSpace.h:200
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type related macros and PrintSelf() method.
int vtkIdType
Definition: vtkType.h:332
virtual void InitTraversal(double scalarValue)=0
Begin to traverse the cells based on a scalar value (serial traversal).
int vtkTypeBool
Definition: vtkABI.h:69
abstract class to specify cell behavior
Definition: vtkCell.h:60
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
virtual vtkIdType GetNumberOfCellBatches(double scalarValue)=0
Get the number of cell batches available for processing as a function of the specified scalar value...
virtual vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars)=0
Return the next cell that may contain scalar value specified to InitTraversal() (serial traversal)...
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:54
vtkIdType BatchSize
Definition: vtkSpanSpace.h:202
vtkTypeBool ComputeScalarRange
Definition: vtkSpanSpace.h:197
virtual const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells)=0
Return the array of cell ids in the specified batch.
virtual void Initialize()=0
Initialize locator.
organize data according to scalar span space
Definition: vtkSpanSpace.h:51
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void ShallowCopy(vtkScalarTree *stree)
This method is used to copy data members when cloning an instance of the class.
vtkTypeBool ComputeResolution
Definition: vtkSpanSpace.h:199
virtual void BuildTree()=0
Construct the scalar tree from the dataset provided.
vtkIdType Resolution
Definition: vtkSpanSpace.h:198