VTK  9.5.20251126
vtkCellGridEvaluator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
102
103#ifndef vtkCellGridEvaluator_h
104#define vtkCellGridEvaluator_h
105
106#include "vtkCellAttribute.h" // For Attribute ivar.
107#include "vtkCellGridQuery.h"
108#include "vtkNew.h" // For ivars.
109#include "vtkStringToken.h" // For Allocations ivar.
110#include "vtkTypeUInt32Array.h" // For ivars.
111#include "vtkTypeUInt64Array.h" // For ivars.
112
113#include <set>
114#include <unordered_map>
115
116VTK_ABI_NAMESPACE_BEGIN
117
119class vtkPointSet;
120
121class VTKCOMMONDATAMODEL_EXPORT vtkCellGridEvaluator : public vtkCellGridQuery
122{
123public:
126 void PrintSelf(ostream& os, vtkIndent indent) override;
127
136
138 struct VTKCOMMONDATAMODEL_EXPORT AllocationsByCellType
139 {
140 std::map<vtkIdType, std::set<vtkIdType>> InputPoints;
142
144 };
145
149 vtkSetObjectMacro(CellAttribute, vtkCellAttribute);
150 vtkGetObjectMacro(CellAttribute, vtkCellAttribute);
151
154 vtkGetObjectMacro(InputPoints, vtkDataArray);
155
157 vtkGetObjectMacro(ClassifierCellTypes, vtkTypeUInt32Array);
158
160 vtkGetObjectMacro(ClassifierCellOffsets, vtkTypeUInt64Array);
161
163 vtkGetObjectMacro(ClassifierPointIDs, vtkTypeUInt64Array);
164
166 vtkGetObjectMacro(ClassifierCellIndices, vtkTypeUInt64Array);
167
170
172 vtkGetObjectMacro(InterpolatedValues, vtkDataArray);
173
176
179
185 void InterpolateCellParameters(vtkTypeUInt32Array* cellTypes, vtkTypeUInt64Array* cellOffsets,
186 vtkTypeUInt64Array* cellIndices, vtkDataArray* pointParameters);
187
190
192 bool Initialize() override;
194 void StartPass() override;
196 bool IsAnotherPassRequired() override;
198 bool Finalize() override;
199
200 // Return a point locator that can be used to find input points quickly.
201 // vtkStaticPointLocator* GetLocator();
202 vtkGetObjectMacro(Locator, vtkStaticPointLocator);
203
207
208protected:
211
214 vtkSetObjectMacro(InputPoints, vtkDataArray);
215
217 vtkSetObjectMacro(ClassifierCellTypes, vtkTypeUInt32Array);
218
220 vtkSetObjectMacro(ClassifierCellOffsets, vtkTypeUInt64Array);
221
223 vtkSetObjectMacro(ClassifierPointIDs, vtkTypeUInt64Array);
224
226 vtkSetObjectMacro(ClassifierCellIndices, vtkTypeUInt64Array);
227
230
232 vtkSetObjectMacro(InterpolatedValues, vtkDataArray);
233
237
241 vtkTypeUInt32Array* ClassifierCellTypes{ nullptr };
242 vtkTypeUInt64Array* ClassifierCellOffsets{ nullptr };
243 vtkTypeUInt64Array* ClassifierPointIDs{ nullptr };
244 vtkTypeUInt64Array* ClassifierCellIndices{ nullptr };
247
249
255 std::unordered_map<vtkStringToken, AllocationsByCellType> Allocations;
256
257private:
259 void operator=(const vtkCellGridEvaluator&) = delete;
260};
261
262VTK_ABI_NAMESPACE_END
263#endif // vtkCellGridEvaluator_h
A function defined over the physical domain of a vtkCellGrid.
bool Finalize() override
Invoked during evaluation after all cell-grid responders are run.
vtkIdType NumberOfOutputPoints
The total number of output points (across all cell types).
~vtkCellGridEvaluator() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InterpolateCellParameters(vtkTypeUInt32Array *cellTypes, vtkTypeUInt64Array *cellOffsets, vtkTypeUInt64Array *cellIndices, vtkDataArray *pointParameters)
Configure the query to run only the interpolator.
void AllocateClassificationOutput()
vtkTypeUInt32Array * ClassifierCellTypes
vtkCellAttribute * CellAttribute
std::unordered_map< vtkStringToken, AllocationsByCellType > Allocations
Internal state used during classification to compute the size of the output arrays.
vtkNew< vtkStaticPointLocator > Locator
void InterpolatePoints(vtkDataArray *points)
Configure the query to run the classifier followed by the interpolator.
static vtkCellGridEvaluator * New()
vtkTypeUInt64Array * ClassifierCellIndices
Phases
Indicate which phases of the query to perform.
void StartPass() override
Invoked at the start of each pass.
vtkGetEnumMacro(PhasesToPerform, vtkCellGridEvaluator::Phases)
Return what work the query has been configured to do.
void AllocateInterpolationOutput()
Phases PhasesToPerform
Which of the phases are the arrays above configured to perform?
bool IsAnotherPassRequired() override
Invoked at the end of each pass.
vtkTypeUInt64Array * ClassifierCellOffsets
AllocationsByCellType & GetAllocationsForCellType(vtkStringToken cellType)
Return a reference to a cellType's allocated input points for responders to fill out.
bool Initialize() override
Invoked during evaluation before any cell-grid responders are run.
void ClassifyPoints(vtkDataArray *points)
Configure the query to run the classifier but not the interpolator.
vtkTypeUInt64Array * ClassifierPointIDs
vtkDataArray * InterpolatedValues
vtkDataArray * ClassifierPointParameters
vtkCellGridQuery()=default
Visualization data composed of cells of arbitrary type.
Definition vtkCellGrid.h:49
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:167
concrete class for storing a set of points
Definition vtkPointSet.h:98
quickly locate points in 3-space
Represent a string by its integer hash.
Hold per-type input point assignment and an offset for output arrays.
std::map< vtkIdType, std::set< vtkIdType > > InputPoints
#define vtkDataArray
int vtkIdType
Definition vtkType.h:367