VTK  9.6.20260612
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
164
165#ifndef vtkProbeFilter_h
166#define vtkProbeFilter_h
167
168#include "vtkDataSetAlgorithm.h"
169#include "vtkDataSetAttributes.h" // needed for vtkDataSetAttributes::FieldList
170#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_7_0
171#include "vtkFiltersCoreModule.h" // For export macro
172#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
173
174#include <vector> // For std::vector
175
176VTK_ABI_NAMESPACE_BEGIN
178class vtkCharArray;
179class vtkGenericCell;
180class vtkIdTypeArray;
181class vtkImageData;
182class vtkPointData;
184
185class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkProbeFilter : public vtkDataSetAlgorithm
186{
187public:
190 void PrintSelf(ostream& os, vtkIndent indent) override;
191
193
202
210
212
221 vtkBooleanMacro(CategoricalData, vtkTypeBool);
223
225
238 vtkBooleanMacro(SpatialMatch, vtkTypeBool);
240
242
248
250
255 vtkSetStringMacro(ValidPointMaskArrayName);
256 vtkGetStringMacro(ValidPointMaskArrayName);
258
260
266 vtkBooleanMacro(PassCellArrays, vtkTypeBool);
269
271
277 vtkBooleanMacro(PassPointArrays, vtkTypeBool);
280
282
289 vtkBooleanMacro(PassFieldArrays, vtkTypeBool);
292
294
302 vtkSetMacro(Tolerance, double);
303 vtkGetMacro(Tolerance, double);
305
307
315 vtkSetMacro(SnapToCellWithClosestPoint, bool);
316 vtkBooleanMacro(SnapToCellWithClosestPoint, bool);
317 vtkGetMacro(SnapToCellWithClosestPoint, bool);
319
321
328 vtkSetMacro(SnappingRadius, double);
329 vtkGetMacro(SnappingRadius, double);
331
333
341 vtkSetMacro(ComputeTolerance, bool);
342 vtkBooleanMacro(ComputeTolerance, bool);
343 vtkGetMacro(ComputeTolerance, bool);
345
347
353 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocator() instead.")
356 "GetFindCellStrategy() always returns nullptr. Use GetCellLocator() instead.")
359
361
369
371
379 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocator() instead.")
381 {
382 this->SetCellLocator(cellLocator);
383 }
384 VTK_DEPRECATED_IN_9_7_0("Use GetCellLocator() instead.")
387
388protected:
390 ~vtkProbeFilter() override;
391
393
397
403
407 void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
408
414
418 virtual void InitializeForProbing(vtkDataSet* input, vtkDataSet* output);
420 virtual void InitializeOutputArrays(vtkPointData* outPD, vtkIdType numPts);
421
426 void DoProbing(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
427
429
433
435
436 double Tolerance;
438
442
443 // support the FindCell() operation for vtkPointSet
445
448
449private:
450 vtkProbeFilter(const vtkProbeFilter&) = delete;
451 void operator=(const vtkProbeFilter&) = delete;
452
453 // Probe only those points that are marked as not-probed by the MaskPoints
454 // array.
455 void ProbeEmptyPoints(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
456
457 // A faster implementation for vtkImageData input.
458 void ProbePointsImageData(
459 vtkImageData* input, int srcIdx, vtkDataSet* source, vtkImageData* output);
460 void ProbeImagePointsInCell(vtkGenericCell* cell, vtkIdType cellId, vtkDataSet* source,
461 int srcBlockId, vtkImageData* input, vtkPointData* outPD, char* maskArray, double* wtsBuff);
462
463 class ProbeImageDataWorklet;
464
465 // A faster implementation for vtkImageData source.
466 void ProbeImageDataPoints(
467 vtkDataSet* input, int srcIdx, vtkImageData* sourceImage, vtkDataSet* output);
468 void ProbeImageDataPointsSMP(vtkDataSet* input, vtkImageData* source, int srcIdx,
469 vtkPointData* outPD, char* maskArray, vtkIdList* pointIds, vtkIdType startId, vtkIdType endId,
470 bool baseThread);
471
472 class ProbeImageDataPointsWorklet;
473
474 class ProbeEmptyPointsWorklet;
475
476 std::vector<vtkDataArray*> InputCellArrays;
477 std::vector<vtkDataArray*> SourceCellArrays;
478
479 bool SnapToCellWithClosestPoint;
480 double SnappingRadius;
481};
482
483VTK_ABI_NAMESPACE_END
484#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
vtkDataSetAttributesFieldList FieldList
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
helper class to manage the vtkPointSet::FindCell() method
Detect and break reference loops.
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:135
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
virtual void SetCellLocator(vtkAbstractCellLocator *)
Set / get the cell locator used to perform the FindCell() operation for vtkPointSet.
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.
vtkIdTypeArray * ValidPoints
virtual vtkAbstractCellLocator * GetCellLocator()
Set / get the cell locator used to perform the FindCell() operation for vtkPointSet.
vtkFindCellStrategy * GetFindCellStrategy()
Set / get the strategy used 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().
vtkAbstractCellLocator * CellLocator
~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.
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.
virtual void SetCellLocatorPrototype(vtkAbstractCellLocator *cellLocator)
Set/Get the prototype cell locator to perform the FindCell() operation.
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.
void ReportReferences(vtkGarbageCollector *) override
vtkDataObject * GetSource()
Specify the data set that will be probed at the input points.
virtual vtkAbstractCellLocator * GetCellLocatorPrototype()
Set/Get the prototype cell locator to perform the FindCell() operation.
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 *)
#define VTK_DEPRECATED_IN_9_7_0(reason)
int vtkIdType
Definition vtkType.h:363
#define VTK_MARSHALAUTO