VTK  9.5.20250926
vtkProbeFilter.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
168#ifndef vtkProbeFilter_h
169#define vtkProbeFilter_h
170
171#include "vtkDataSetAlgorithm.h"
172#include "vtkDataSetAttributes.h" // needed for vtkDataSetAttributes::FieldList
173#include "vtkFiltersCoreModule.h" // For export macro
174#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
175
176#include <vector> // For std::vector
177
178VTK_ABI_NAMESPACE_BEGIN
180class vtkCharArray;
181class vtkGenericCell;
182class vtkIdTypeArray;
183class vtkImageData;
184class vtkPointData;
186
187class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkProbeFilter : public vtkDataSetAlgorithm
188{
189public:
192 void PrintSelf(ostream& os, vtkIndent indent) override;
193
195
204
212
214
219 vtkSetMacro(CategoricalData, vtkTypeBool);
220 vtkGetMacro(CategoricalData, vtkTypeBool);
221 vtkBooleanMacro(CategoricalData, vtkTypeBool);
223
225
235 vtkSetMacro(SpatialMatch, vtkTypeBool);
236 vtkGetMacro(SpatialMatch, vtkTypeBool);
237 vtkBooleanMacro(SpatialMatch, vtkTypeBool);
239
241
247
249
254 vtkSetStringMacro(ValidPointMaskArrayName);
255 vtkGetStringMacro(ValidPointMaskArrayName);
257
259
263 vtkSetMacro(PassCellArrays, vtkTypeBool);
264 vtkBooleanMacro(PassCellArrays, vtkTypeBool);
265 vtkGetMacro(PassCellArrays, vtkTypeBool);
268
272 vtkSetMacro(PassPointArrays, vtkTypeBool);
273 vtkBooleanMacro(PassPointArrays, vtkTypeBool);
274 vtkGetMacro(PassPointArrays, vtkTypeBool);
276
278
282 vtkSetMacro(PassFieldArrays, vtkTypeBool);
283 vtkBooleanMacro(PassFieldArrays, vtkTypeBool);
284 vtkGetMacro(PassFieldArrays, vtkTypeBool);
286
288
293 vtkSetMacro(Tolerance, double);
294 vtkGetMacro(Tolerance, double);
296
298
306 vtkSetMacro(SnapToCellWithClosestPoint, bool);
307 vtkBooleanMacro(SnapToCellWithClosestPoint, bool);
308 vtkGetMacro(SnapToCellWithClosestPoint, bool);
310
312
317 vtkSetMacro(ComputeTolerance, bool);
318 vtkBooleanMacro(ComputeTolerance, bool);
319 vtkGetMacro(ComputeTolerance, bool);
321
323
330 vtkGetObjectMacro(FindCellStrategy, vtkFindCellStrategy);
332
334
343 vtkGetObjectMacro(CellLocatorPrototype, vtkAbstractCellLocator);
345
346protected:
348 ~vtkProbeFilter() override;
349
353
359
363 void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
364
370
374 virtual void InitializeForProbing(vtkDataSet* input, vtkDataSet* output);
376 virtual void InitializeOutputArrays(vtkPointData* outPD, vtkIdType numPts);
377
382 void DoProbing(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
383
385
389
391
392 double Tolerance;
395
399
400 // Support various methods to support the FindCell() operation
403
406
407private:
408 vtkProbeFilter(const vtkProbeFilter&) = delete;
409 void operator=(const vtkProbeFilter&) = delete;
410
411 // Probe only those points that are marked as not-probed by the MaskPoints
412 // array.
413 void ProbeEmptyPoints(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
414
415 // A faster implementation for vtkImageData input.
416 void ProbePointsImageData(
417 vtkImageData* input, int srcIdx, vtkDataSet* source, vtkImageData* output);
418 void ProbeImagePointsInCell(vtkGenericCell* cell, vtkIdType cellId, vtkDataSet* source,
419 int srcBlockId, vtkImageData* input, vtkPointData* outPD, char* maskArray, double* wtsBuff);
420
421 class ProbeImageDataWorklet;
422
423 // A faster implementation for vtkImageData source.
424 void ProbeImageDataPoints(
425 vtkDataSet* input, int srcIdx, vtkImageData* sourceImage, vtkDataSet* output);
426 void ProbeImageDataPointsSMP(vtkDataSet* input, vtkImageData* source, int srcIdx,
427 vtkPointData* outPD, char* maskArray, vtkIdList* pointIds, vtkIdType startId, vtkIdType endId,
428 bool baseThread);
429
430 class ProbeImageDataPointsWorklet;
431
432 class ProbeEmptyPointsWorklet;
433
434 std::vector<vtkDataArray*> InputCellArrays;
435 std::vector<vtkDataArray*> SourceCellArrays;
436};
437
438VTK_ABI_NAMESPACE_END
439#endif
an abstract base class for locators which find cells
Proxy object to connect input/output ports.
dynamic, self-adjusting array of char
general representation of visualization data
Superclass for algorithms that produce output of the same type as input.
helps manage arrays from multiple vtkDataSetAttributes.
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
helper class to manage the vtkPointSet::FindCell() method
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:133
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
sample data values at specified point locations
virtual void InitializeForProbing(vtkDataSet *input, vtkDataSet *output)
Initializes output and various arrays which keep track for probing status.
void SetSourceData(vtkDataObject *source)
Specify the data set that will be probed at the input points.
vtkFindCellStrategy * FindCellStrategy
vtkIdTypeArray * ValidPoints
virtual void SetCellLocatorPrototype(vtkAbstractCellLocator *)
Set/Get the prototype cell locator to perform the FindCell() operation.
virtual void SetFindCellStrategy(vtkFindCellStrategy *)
Set / get the strategy used to perform the FindCell() operation.
virtual void InitializeOutputArrays(vtkPointData *outPD, vtkIdType numPts)
vtkTypeBool CategoricalData
void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output)
Equivalent to calling BuildFieldList(); InitializeForProbing(); DoProbing().
~vtkProbeFilter() override
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
vtkCharArray * MaskPoints
char * ValidPointMaskArrayName
vtkTypeBool SpatialMatch
vtkDataSetAttributes::FieldList * CellList
vtkIdTypeArray * GetValidPoints()
Get the list of point ids in the output that contain attribute data interpolated from the source.
vtkTypeBool PassCellArrays
vtkDataSetAttributes::FieldList * PointList
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the data set that will be probed at the input points.
bool SnapToCellWithClosestPoint
void PassAttributeData(vtkDataSet *input, vtkDataObject *source, vtkDataSet *output)
Call at end of RequestData() to pass attribute data respecting the PassCellArrays,...
void BuildFieldList(vtkDataSet *source)
Build the field lists.
vtkAbstractCellLocator * CellLocatorPrototype
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
static vtkProbeFilter * New()
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
void DoProbing(vtkDataSet *input, int srcIdx, vtkDataSet *source, vtkDataSet *output)
Probe appropriate points srcIdx is the index in the PointList for the given source.
vtkDataObject * GetSource()
Specify the data set that will be probed at the input points.
vtkTypeBool PassPointArrays
vtkTypeBool PassFieldArrays
virtual void InitializeSourceArrays(vtkDataSet *source)
int vtkTypeBool
Definition vtkABI.h:64
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
int vtkIdType
Definition vtkType.h:334
#define VTK_MARSHALAUTO