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 =========================================================================*/
40 #ifndef vtkSpanSpace_h
41 #define vtkSpanSpace_h
42 
43 #include "vtkCommonExecutionModelModule.h" // For export macro
44 #include "vtkScalarTree.h"
45 
46 class vtkInternalSpanSpace;
47 
48 
50 {
51 public:
53  static vtkSpanSpace *New();
54 
56 
57  vtkTypeMacro(vtkSpanSpace,vtkScalarTree);
58  void PrintSelf(ostream& os, vtkIndent indent);
60 
61  //----------------------------------------------------------------------
62  // The following methods are specific to the creationg and configuration of
63  // vtkSpanSpace.
64 
66 
72  vtkSetClampMacro(Resolution,vtkIdType,1,VTK_INT_MAX);
73  vtkGetMacro(Resolution,vtkIdType);
75 
76  //----------------------------------------------------------------------
77  // The following methods satisfy the vtkScalarTree abstract API.
78 
80  virtual void Initialize();
81 
85  virtual void BuildTree();
86 
91  virtual void InitTraversal(double scalarValue);
92 
94 
98  virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
99  vtkDataArray *cellScalars);
101 
102  // The following methods supports parallel (threaded)
103  // applications. Basically batches of cells (which represent a
104  // portion of the whole dataset) are available for processing in a
105  // parallel For() operation. In the case of span space, a batch is
106  // taken from a portion of the span rectangle.
107 
115 
117 
120  virtual const vtkIdType* GetCellBatch(vtkIdType batchNum,
121  vtkIdType& numCells);
123 
124 protected:
125  vtkSpanSpace();
126  ~vtkSpanSpace();
127 
129  vtkInternalSpanSpace *SpanSpace;
131 
132 private:
133  // Internal variables supporting span space traversal
134  vtkIdType RMin[2]; //span space lower left corner
135  vtkIdType RMax[2]; //span space upper right corner
136  vtkIdType NumBuckets; //number of span space bins
137 
138  // This supports serial traversal via GetNextCell()
139  vtkIdType CurrentRow; //the span space row currently being processed
140  vtkIdType *CurrentSpan; //pointer to current span row
141  vtkIdType CurrentIdx; //position into the current span row
142  vtkIdType CurrentNumCells; //number of cells on the current span row
143 
144 private:
145  vtkSpanSpace(const vtkSpanSpace&); // Not implemented.
146  void operator=(const vtkSpanSpace&); // Not implemented.
147 };
148 
149 #endif
#define VTKCOMMONEXECUTIONMODEL_EXPORT
vtkInternalSpanSpace * SpanSpace
Definition: vtkSpanSpace.h:129
#define VTK_INT_MAX
Definition: vtkType.h:130
int vtkIdType
Definition: vtkType.h:247
virtual void InitTraversal(double scalarValue)=0
abstract class to specify cell behavior
Definition: vtkCell.h:58
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars)=0
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:53
vtkIdType BatchSize
Definition: vtkSpanSpace.h:130
virtual const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells)=0
virtual void Initialize()=0
virtual vtkIdType GetNumberOfCellBatches()=0
organize data according to scalar span space
Definition: vtkSpanSpace.h:49
static vtkObject * New()
void PrintSelf(ostream &os, vtkIndent indent)
virtual void BuildTree()=0
vtkIdType Resolution
Definition: vtkSpanSpace.h:128