VTK
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 #ifndef vtkSpanSpace_h
39 #define vtkSpanSpace_h
40 
41 #include "vtkCommonExecutionModelModule.h" // For export macro
42 #include "vtkScalarTree.h"
43 
44 class vtkInternalSpanSpace;
45 
46 
47 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSpanSpace : public vtkScalarTree
48 {
49 public:
53  static vtkSpanSpace *New();
54 
56 
59  vtkTypeMacro(vtkSpanSpace,vtkScalarTree);
60  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
63  //----------------------------------------------------------------------
64  // The following methods are specific to the creation and configuration of
65  // vtkSpanSpace.
66 
68 
76  vtkSetClampMacro(Resolution,vtkIdType,1,VTK_INT_MAX);
77  vtkGetMacro(Resolution,vtkIdType);
79 
80  //----------------------------------------------------------------------
81  // The following methods satisfy the vtkScalarTree abstract API.
82 
86  void Initialize() override;
87 
92  void BuildTree() override;
93 
100  void InitTraversal(double scalarValue) override;
101 
108  vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
109  vtkDataArray *cellScalars) override;
110 
111  // The following methods supports parallel (threaded)
112  // applications. Basically batches of cells (which represent a
113  // portion of the whole dataset) are available for processing in a
114  // parallel For() operation. In the case of span space, a batch is
115  // taken from a portion of the span rectangle.
116 
126 
132  const vtkIdType* GetCellBatch(vtkIdType batchNum,
133  vtkIdType& numCells) override;
134 
135 protected:
136  vtkSpanSpace();
137  ~vtkSpanSpace() override;
138 
140  vtkInternalSpanSpace *SpanSpace;
142 
143 private:
144  // Internal variables supporting span space traversal
145  vtkIdType RMin[2]; //span space lower left corner
146  vtkIdType RMax[2]; //span space upper right corner
147 
148  // This supports serial traversal via GetNextCell()
149  vtkIdType CurrentRow; //the span space row currently being processed
150  vtkIdType *CurrentSpan; //pointer to current span row
151  vtkIdType CurrentIdx; //position into the current span row
152  vtkIdType CurrentNumCells; //number of cells on the current span row
153 
154 private:
155  vtkSpanSpace(const vtkSpanSpace&) = delete;
156  void operator=(const vtkSpanSpace&) = delete;
157 };
158 
159 #endif
vtkInternalSpanSpace * SpanSpace
Definition: vtkSpanSpace.h:140
#define VTK_INT_MAX
Definition: vtkType.h:159
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:347
virtual void InitTraversal(double scalarValue)=0
Begin to traverse the cells based on a scalar value.
abstract class to specify cell behavior
Definition: vtkCell.h:56
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
virtual vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars)=0
Return the next cell that may contain scalar value specified to initialize traversal.
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:54
vtkIdType BatchSize
Definition: vtkSpanSpace.h:141
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.
virtual vtkIdType GetNumberOfCellBatches()=0
Get the number of cell batches available for processing.
organize data according to scalar span space
Definition: vtkSpanSpace.h:47
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
virtual void BuildTree()=0
Construct the scalar tree from the dataset provided.
vtkIdType Resolution
Definition: vtkSpanSpace.h:139