VTK
vtkScalarTree.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkScalarTree.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 vtkScalarTree_h
43 #define vtkScalarTree_h
44 
45 #include "vtkCommonExecutionModelModule.h" // For export macro
46 #include "vtkObject.h"
47 
48 class vtkCell;
49 class vtkDataArray;
50 class vtkDataSet;
51 class vtkIdList;
52 class vtkTimeStamp;
53 
54 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkScalarTree : public vtkObject
55 {
56 public:
57  vtkTypeMacro(vtkScalarTree,vtkObject);
58  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
59 
61 
65  virtual void SetDataSet(vtkDataSet*);
66  vtkGetObjectMacro(DataSet,vtkDataSet);
68 
70 
78  virtual void SetScalars(vtkDataArray*);
79  vtkGetObjectMacro(Scalars,vtkDataArray);
81 
86  virtual void BuildTree() = 0;
87 
91  virtual void Initialize() = 0;
92 
99  virtual void InitTraversal(double scalarValue) = 0;
100 
107  virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
108  vtkDataArray *cellScalars) = 0;
109 
114  double GetScalarValue()
115  {return this->ScalarValue;}
116 
117  // The following methods supports parallel (threaded) applications. Basically
118  // batches of cells (which are a portion of the whole dataset) are available for
119  // processing in a parallel For() operation.
120 
130 
136  virtual const vtkIdType* GetCellBatch(vtkIdType batchNum,
137  vtkIdType& numCells) = 0;
138 
139 
140 protected:
142  ~vtkScalarTree() VTK_OVERRIDE;
143 
144  vtkDataSet *DataSet; //the dataset over which the scalar tree is built
145  vtkDataArray *Scalars; //the scalars of the DataSet
146  double ScalarValue; //current scalar value for traversal
147 
148  vtkTimeStamp BuildTime; //time at which tree was built
149 
150 private:
151  vtkScalarTree(const vtkScalarTree&) VTK_DELETE_FUNCTION;
152  void operator=(const vtkScalarTree&) VTK_DELETE_FUNCTION;
153 };
154 
155 #endif
abstract class to specify cell behavior
Definition: vtkCell.h:60
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
list of point or cell ids
Definition: vtkIdList.h:37
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
virtual vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars)=0
Return the next cell that may contain scalar value specified to initialize traversal.
virtual vtkIdType GetNumberOfCellBatches()=0
Get the number of cell batches available for processing.
virtual void SetScalars(vtkDataArray *)
Build the tree from the points/cells and scalars defining the dataset and scalars provided.
virtual void Initialize()=0
Initialize locator.
virtual void BuildTree()=0
Construct the scalar tree from the dataset provided.
double GetScalarValue()
Return the current scalar value over which tree traversal is proceeding.
virtual void SetDataSet(vtkDataSet *)
Build the tree from the points/cells and scalars defining this dataset.
~vtkScalarTree() override
virtual void InitTraversal(double scalarValue)=0
Begin to traverse the cells based on a scalar value.
virtual const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells)=0
Return the array of cell ids in the specified batch.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkTimeStamp BuildTime
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287