VTK  9.7.0
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
55
56#ifndef vtkProbeFilter_h
57#define vtkProbeFilter_h
58
59#include "vtkDataSetAlgorithm.h"
60#include "vtkDataSetAttributes.h" // needed for vtkDataSetAttributes::FieldList
61#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_7_0
62#include "vtkFiltersCoreModule.h" // For export macro
63#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
64
65#include <vector> // For std::vector
66
67VTK_ABI_NAMESPACE_BEGIN
69class vtkCharArray;
70class vtkGenericCell;
71class vtkIdTypeArray;
72class vtkImageData;
73class vtkPointData;
75
76class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkProbeFilter : public vtkDataSetAlgorithm
77{
78public:
81 void PrintSelf(ostream& os, vtkIndent indent) override;
82
84
93
101
103
112 vtkBooleanMacro(CategoricalData, vtkTypeBool);
114
116
129 vtkBooleanMacro(SpatialMatch, vtkTypeBool);
131
133
139
141
146 vtkSetStringMacro(ValidPointMaskArrayName);
147 vtkGetStringMacro(ValidPointMaskArrayName);
149
151
157 vtkBooleanMacro(PassCellArrays, vtkTypeBool);
160
162
168 vtkBooleanMacro(PassPointArrays, vtkTypeBool);
171
173
180 vtkBooleanMacro(PassFieldArrays, vtkTypeBool);
183
185
193 vtkSetMacro(Tolerance, double);
194 vtkGetMacro(Tolerance, double);
196
198
206 vtkSetMacro(SnapToCellWithClosestPoint, bool);
207 vtkBooleanMacro(SnapToCellWithClosestPoint, bool);
208 vtkGetMacro(SnapToCellWithClosestPoint, bool);
210
212
219 vtkSetMacro(SnappingRadius, double);
220 vtkGetMacro(SnappingRadius, double);
222
224
232 vtkSetMacro(ComputeTolerance, bool);
233 vtkBooleanMacro(ComputeTolerance, bool);
234 vtkGetMacro(ComputeTolerance, bool);
236
238
244 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocator() instead.")
247 "GetFindCellStrategy() always returns nullptr. Use GetCellLocator() instead.")
250
252
260
262
270 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocator() instead.")
272 {
273 this->SetCellLocator(cellLocator);
274 }
275 VTK_DEPRECATED_IN_9_7_0("Use GetCellLocator() instead.")
278
279protected:
281 ~vtkProbeFilter() override;
282
284
288
294
298 void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
299
305
309 virtual void InitializeForProbing(vtkDataSet* input, vtkDataSet* output);
311 virtual void InitializeOutputArrays(vtkPointData* outPD, vtkIdType numPts);
312
317 void DoProbing(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
318
320
324
326
327 double Tolerance;
329
333
334 // support the FindCell() operation for vtkPointSet
336
339
340private:
341 vtkProbeFilter(const vtkProbeFilter&) = delete;
342 void operator=(const vtkProbeFilter&) = delete;
343
344 // Probe only those points that are marked as not-probed by the MaskPoints
345 // array.
346 void ProbeEmptyPoints(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
347
348 // A faster implementation for vtkImageData input.
349 void ProbePointsImageData(
350 vtkImageData* input, int srcIdx, vtkDataSet* source, vtkImageData* output);
351 void ProbeImagePointsInCell(vtkGenericCell* cell, vtkIdType cellId, vtkDataSet* source,
352 int srcBlockId, vtkImageData* input, vtkPointData* outPD, char* maskArray, double* wtsBuff);
353
354 class ProbeImageDataWorklet;
355
356 // A faster implementation for vtkImageData source.
357 void ProbeImageDataPoints(
358 vtkDataSet* input, int srcIdx, vtkImageData* sourceImage, vtkDataSet* output);
359 void ProbeImageDataPointsSMP(vtkDataSet* input, vtkImageData* source, int srcIdx,
360 vtkPointData* outPD, char* maskArray, vtkIdList* pointIds, vtkIdType startId, vtkIdType endId,
361 bool baseThread);
362
363 class ProbeImageDataPointsWorklet;
364
365 class ProbeEmptyPointsWorklet;
366
367 std::vector<vtkDataArray*> InputCellArrays;
368 std::vector<vtkDataArray*> SourceCellArrays;
369
370 bool SnapToCellWithClosestPoint;
371 double SnappingRadius;
372};
373
374VTK_ABI_NAMESPACE_END
375#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:57
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:26
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:29
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