VTK  9.6.20260521
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
219 vtkBooleanMacro(CategoricalData, vtkTypeBool);
221
223
235 vtkBooleanMacro(SpatialMatch, vtkTypeBool);
237
239
245
247
252 vtkSetStringMacro(ValidPointMaskArrayName);
253 vtkGetStringMacro(ValidPointMaskArrayName);
255
257
262 vtkBooleanMacro(PassCellArrays, vtkTypeBool);
266
271 vtkBooleanMacro(PassPointArrays, vtkTypeBool);
274
276
281 vtkBooleanMacro(PassFieldArrays, vtkTypeBool);
284
286
291 vtkSetMacro(Tolerance, double);
292 vtkGetMacro(Tolerance, double);
294
296
304 vtkSetMacro(SnapToCellWithClosestPoint, bool);
305 vtkBooleanMacro(SnapToCellWithClosestPoint, bool);
306 vtkGetMacro(SnapToCellWithClosestPoint, bool);
308
310
315 vtkSetMacro(SnappingRadius, double);
316 vtkGetMacro(SnappingRadius, double);
318
320
325 vtkSetMacro(ComputeTolerance, bool);
326 vtkBooleanMacro(ComputeTolerance, bool);
327 vtkGetMacro(ComputeTolerance, bool);
329
331
337 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocator() instead.")
340 "GetFindCellStrategy() always returns nullptr. Use GetCellLocator() instead.")
343
345
353
355
363 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocator() instead.")
365 {
366 this->SetCellLocator(cellLocator);
367 }
368 VTK_DEPRECATED_IN_9_7_0("Use GetCellLocator() instead.")
371
372protected:
374 ~vtkProbeFilter() override;
375
377
381
387
391 void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
392
398
402 virtual void InitializeForProbing(vtkDataSet* input, vtkDataSet* output);
404 virtual void InitializeOutputArrays(vtkPointData* outPD, vtkIdType numPts);
405
410 void DoProbing(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
411
413
417
419
420 double Tolerance;
422
426
427 // support the FindCell() operation for vtkPointSet
429
432
433private:
434 vtkProbeFilter(const vtkProbeFilter&) = delete;
435 void operator=(const vtkProbeFilter&) = delete;
436
437 // Probe only those points that are marked as not-probed by the MaskPoints
438 // array.
439 void ProbeEmptyPoints(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
440
441 // A faster implementation for vtkImageData input.
442 void ProbePointsImageData(
443 vtkImageData* input, int srcIdx, vtkDataSet* source, vtkImageData* output);
444 void ProbeImagePointsInCell(vtkGenericCell* cell, vtkIdType cellId, vtkDataSet* source,
445 int srcBlockId, vtkImageData* input, vtkPointData* outPD, char* maskArray, double* wtsBuff);
446
447 class ProbeImageDataWorklet;
448
449 // A faster implementation for vtkImageData source.
450 void ProbeImageDataPoints(
451 vtkDataSet* input, int srcIdx, vtkImageData* sourceImage, vtkDataSet* output);
452 void ProbeImageDataPointsSMP(vtkDataSet* input, vtkImageData* source, int srcIdx,
453 vtkPointData* outPD, char* maskArray, vtkIdList* pointIds, vtkIdType startId, vtkIdType endId,
454 bool baseThread);
455
456 class ProbeImageDataPointsWorklet;
457
458 class ProbeEmptyPointsWorklet;
459
460 std::vector<vtkDataArray*> InputCellArrays;
461 std::vector<vtkDataArray*> SourceCellArrays;
462
463 bool SnapToCellWithClosestPoint;
464 double SnappingRadius;
465};
466
467VTK_ABI_NAMESPACE_END
468#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