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 =========================================================================*/
41 #ifndef vtkSpanSpace_h
42 #define vtkSpanSpace_h
43 
44 #include "vtkCommonExecutionModelModule.h" // For export macro
45 #include "vtkScalarTree.h"
46 
47 class vtkInternalSpanSpace;
48 
49 
50 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSpanSpace : public vtkScalarTree
51 {
52 public:
56  static vtkSpanSpace *New();
57 
59 
62  vtkTypeMacro(vtkSpanSpace,vtkScalarTree);
63  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
66  //----------------------------------------------------------------------
67  // The following methods are specific to the creation and configuration of
68  // vtkSpanSpace.
69 
71 
79  vtkSetClampMacro(Resolution,vtkIdType,1,VTK_INT_MAX);
80  vtkGetMacro(Resolution,vtkIdType);
82 
83  //----------------------------------------------------------------------
84  // The following methods satisfy the vtkScalarTree abstract API.
85 
89  void Initialize() override;
90 
95  void BuildTree() override;
96 
103  void InitTraversal(double scalarValue) override;
104 
112  vtkDataArray *cellScalars) override;
113 
114  // The following methods supports parallel (threaded)
115  // applications. Basically batches of cells (which represent a
116  // portion of the whole dataset) are available for processing in a
117  // parallel For() operation. In the case of span space, a batch is
118  // taken from a portion of the span rectangle.
119 
129 
136  vtkIdType& numCells) override;
137 
138 protected:
140  ~vtkSpanSpace() override;
141 
143  vtkInternalSpanSpace *SpanSpace;
145 
146 private:
147  // Internal variables supporting span space traversal
148  vtkIdType RMin[2]; //span space lower left corner
149  vtkIdType RMax[2]; //span space upper right corner
150 
151  // This supports serial traversal via GetNextCell()
152  vtkIdType CurrentRow; //the span space row currently being processed
153  vtkIdType *CurrentSpan; //pointer to current span row
154  vtkIdType CurrentIdx; //position into the current span row
155  vtkIdType CurrentNumCells; //number of cells on the current span row
156 
157 private:
158  vtkSpanSpace(const vtkSpanSpace&) = delete;
159  void operator=(const vtkSpanSpace&) = delete;
160 };
161 
162 #endif
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:159
vtkSpanSpace::~vtkSpanSpace
~vtkSpanSpace() override
vtkSpanSpace::Initialize
void Initialize() override
Initialize locator.
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkScalarTree.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkSpanSpace::GetNumberOfCellBatches
vtkIdType GetNumberOfCellBatches() override
Get the number of cell batches available for processing.
vtkSpanSpace::BuildTree
void BuildTree() override
Construct the scalar tree from the dataset provided.
vtkSpanSpace::vtkSpanSpace
vtkSpanSpace()
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:60
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:37
vtkSpanSpace::InitTraversal
void InitTraversal(double scalarValue) override
Begin to traverse the cells based on a scalar value.
vtkSpanSpace::GetNextCell
vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars) override
Return the next cell that may contain scalar value specified to InitTraversal().
vtkSpanSpace::New
static vtkSpanSpace * New()
Instantiate a scalar tree with default number of rows of 100.
vtkSpanSpace::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSpanSpace::BatchSize
vtkIdType BatchSize
Definition: vtkSpanSpace.h:144
vtkSpanSpace::Resolution
vtkIdType Resolution
Definition: vtkSpanSpace.h:142
vtkSpanSpace
organize data according to scalar span space
Definition: vtkSpanSpace.h:51
vtkSpanSpace::GetCellBatch
const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells) override
Return the array of cell ids in the specified batch.
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
vtkSpanSpace::SpanSpace
vtkInternalSpanSpace * SpanSpace
Definition: vtkSpanSpace.h:143