VTK  9.1.0
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
48class vtkCell;
49class vtkDataArray;
50class vtkDataSet;
51class vtkIdList;
52class vtkTimeStamp;
53
54class VTKCOMMONEXECUTIONMODEL_EXPORT vtkScalarTree : public vtkObject
55{
56public:
58
61 vtkTypeMacro(vtkScalarTree, vtkObject);
62 void PrintSelf(ostream& os, vtkIndent indent) override;
64
69 virtual void ShallowCopy(vtkScalarTree* stree);
70
72
76 virtual void SetDataSet(vtkDataSet*);
77 vtkGetObjectMacro(DataSet, vtkDataSet);
79
81
89 virtual void SetScalars(vtkDataArray*);
90 vtkGetObjectMacro(Scalars, vtkDataArray);
92
97 virtual void BuildTree() = 0;
98
102 virtual void Initialize() = 0;
103
110 virtual void InitTraversal(double scalarValue) = 0;
111
118 virtual vtkCell* GetNextCell(vtkIdType& cellId, vtkIdList*& ptIds, vtkDataArray* cellScalars) = 0;
119
124 double GetScalarValue() { return this->ScalarValue; }
125
126 // The following methods supports parallel (threaded) traversal. Basically
127 // batches of cells (which are a portion of the whole dataset) are available for
128 // processing in a parallel For() operation.
129
135 virtual vtkIdType GetNumberOfCellBatches(double scalarValue) = 0;
136
142 virtual const vtkIdType* GetCellBatch(vtkIdType batchNum, vtkIdType& numCells) = 0;
143
144protected:
146 ~vtkScalarTree() override;
147
148 vtkDataSet* DataSet; // the dataset over which the scalar tree is built
149 vtkDataArray* Scalars; // the scalars of the DataSet
150 double ScalarValue; // current scalar value for traversal
151
152 vtkTimeStamp BuildTime; // time at which tree was built
153
154private:
155 vtkScalarTree(const vtkScalarTree&) = delete;
156 void operator=(const vtkScalarTree&) = delete;
157};
158
159#endif
abstract class to specify cell behavior
Definition: vtkCell.h:147
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
virtual const vtkIdType * GetCellBatch(vtkIdType batchNum, vtkIdType &numCells)=0
Return the array of cell ids in the specified batch.
vtkTimeStamp BuildTime
vtkDataSet * DataSet
double ScalarValue
virtual void SetScalars(vtkDataArray *)
Build the tree from the points/cells and scalars defining the dataset and scalars provided.
virtual vtkIdType GetNumberOfCellBatches(double scalarValue)=0
Get the number of cell batches available for processing as a function of the specified scalar value.
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 (serial traversal).
vtkDataArray * Scalars
virtual vtkCell * GetNextCell(vtkIdType &cellId, vtkIdList *&ptIds, vtkDataArray *cellScalars)=0
Return the next cell that may contain scalar value specified to InitTraversal() (serial traversal).
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type related macros and PrintSelf() method.
virtual void ShallowCopy(vtkScalarTree *stree)
This method is used to copy data members when cloning an instance of the class.
record modification and/or execution time
Definition: vtkTimeStamp.h:52
int vtkIdType
Definition: vtkType.h:332