VTK  9.0.1
vtkProbeFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkProbeFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
65 #ifndef vtkProbeFilter_h
66 #define vtkProbeFilter_h
67 
68 #include "vtkDataSetAlgorithm.h"
69 #include "vtkDataSetAttributes.h" // needed for vtkDataSetAttributes::FieldList
70 #include "vtkFiltersCoreModule.h" // For export macro
71 
73 class vtkCell;
74 class vtkCharArray;
75 class vtkIdTypeArray;
76 class vtkImageData;
77 class vtkPointData;
79 
80 class VTKFILTERSCORE_EXPORT vtkProbeFilter : public vtkDataSetAlgorithm
81 {
82 public:
83  static vtkProbeFilter* New();
85  void PrintSelf(ostream& os, vtkIndent indent) override;
86 
88 
94  void SetSourceData(vtkDataObject* source);
95  vtkDataObject* GetSource();
97 
104  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
105 
107 
112  vtkSetMacro(CategoricalData, vtkTypeBool);
113  vtkGetMacro(CategoricalData, vtkTypeBool);
114  vtkBooleanMacro(CategoricalData, vtkTypeBool);
116 
118 
128  vtkSetMacro(SpatialMatch, vtkTypeBool);
129  vtkGetMacro(SpatialMatch, vtkTypeBool);
130  vtkBooleanMacro(SpatialMatch, vtkTypeBool);
132 
134 
138  vtkIdTypeArray* GetValidPoints();
140 
142 
147  vtkSetStringMacro(ValidPointMaskArrayName);
148  vtkGetStringMacro(ValidPointMaskArrayName);
150 
152 
156  vtkSetMacro(PassCellArrays, vtkTypeBool);
157  vtkBooleanMacro(PassCellArrays, vtkTypeBool);
158  vtkGetMacro(PassCellArrays, vtkTypeBool);
160 
161 
165  vtkSetMacro(PassPointArrays, vtkTypeBool);
166  vtkBooleanMacro(PassPointArrays, vtkTypeBool);
167  vtkGetMacro(PassPointArrays, vtkTypeBool);
169 
171 
175  vtkSetMacro(PassFieldArrays, vtkTypeBool);
176  vtkBooleanMacro(PassFieldArrays, vtkTypeBool);
177  vtkGetMacro(PassFieldArrays, vtkTypeBool);
179 
181 
186  vtkSetMacro(Tolerance, double);
187  vtkGetMacro(Tolerance, double);
189 
191 
196  vtkSetMacro(ComputeTolerance, bool);
197  vtkBooleanMacro(ComputeTolerance, bool);
198  vtkGetMacro(ComputeTolerance, bool);
200 
202 
208  virtual void SetFindCellStrategy(vtkFindCellStrategy*);
209  vtkGetObjectMacro(FindCellStrategy, vtkFindCellStrategy);
211 
213 
221  virtual void SetCellLocatorPrototype(vtkAbstractCellLocator*);
222  vtkGetObjectMacro(CellLocatorPrototype, vtkAbstractCellLocator);
224 
225 protected:
226  vtkProbeFilter();
227  ~vtkProbeFilter() override;
228 
232 
237  void PassAttributeData(vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
238 
242  void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
243 
248  void BuildFieldList(vtkDataSet* source);
249 
253  virtual void InitializeForProbing(vtkDataSet* input, vtkDataSet* output);
254  virtual void InitializeOutputArrays(vtkPointData* outPD, vtkIdType numPts);
255 
260  void DoProbing(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
261 
263 
267 
269 
270  double Tolerance;
272 
276 
277  // Support various methods to support the FindCell() operation
280 
283 
284 private:
285  vtkProbeFilter(const vtkProbeFilter&) = delete;
286  void operator=(const vtkProbeFilter&) = delete;
287 
288  // Probe only those points that are marked as not-probed by the MaskPoints
289  // array.
290  void ProbeEmptyPoints(vtkDataSet* input, int srcIdx, vtkDataSet* source, vtkDataSet* output);
291 
292  // A faster implementation for vtkImageData input.
293  void ProbePointsImageData(
294  vtkImageData* input, int srcIdx, vtkDataSet* source, vtkImageData* output);
295  void ProbeImagePointsInCell(vtkCell* cell, vtkIdType cellId, vtkDataSet* source, int srcBlockId,
296  const double start[3], const double spacing[3], const int dim[3], vtkPointData* outPD,
297  char* maskArray, double* wtsBuff);
298 
299  class ProbeImageDataWorklet;
300 
301  class vtkVectorOfArrays;
302  vtkVectorOfArrays* CellArrays;
303 };
304 
305 #endif
vtkProbeFilter::PassPointArrays
vtkTypeBool PassPointArrays
Definition: vtkProbeFilter.h:265
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkProbeFilter::SpatialMatch
vtkTypeBool SpatialMatch
Definition: vtkProbeFilter.h:268
vtkProbeFilter::PassFieldArrays
vtkTypeBool PassFieldArrays
Definition: vtkProbeFilter.h:266
vtkDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
Definition: vtkDataSetAlgorithm.h:176
vtkProbeFilter
sample data values at specified point locations
Definition: vtkProbeFilter.h:80
vtkFindCellStrategy
helper class to manage the vtkPointSet::FindCell() METHOD
Definition: vtkFindCellStrategy.h:51
vtkProbeFilter::CategoricalData
vtkTypeBool CategoricalData
Definition: vtkProbeFilter.h:262
vtkProbeFilter::Tolerance
double Tolerance
Definition: vtkProbeFilter.h:270
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:48
vtkCharArray
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:35
vtkDataSetAttributesFieldList
helps manage arrays from multiple vtkDataSetAttributes.
Definition: vtkDataSetAttributesFieldList.h:69
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:56
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkDataSetAlgorithm::New
static vtkDataSetAlgorithm * New()
vtkProbeFilter::ValidPointMaskArrayName
char * ValidPointMaskArrayName
Definition: vtkProbeFilter.h:273
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:48
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:487
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkDataSetAlgorithm.h
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkProbeFilter::FindCellStrategy
vtkFindCellStrategy * FindCellStrategy
Definition: vtkProbeFilter.h:279
vtkProbeFilter::ComputeTolerance
bool ComputeTolerance
Definition: vtkProbeFilter.h:271
vtkDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkDataSetAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
Definition: vtkDataSetAlgorithm.h:152
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:959
vtkProbeFilter::ValidPoints
vtkIdTypeArray * ValidPoints
Definition: vtkProbeFilter.h:274
vtkProbeFilter::CellLocatorPrototype
vtkAbstractCellLocator * CellLocatorPrototype
Definition: vtkProbeFilter.h:278
vtkProbeFilter::MaskPoints
vtkCharArray * MaskPoints
Definition: vtkProbeFilter.h:275
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:59
vtkProbeFilter::PassCellArrays
vtkTypeBool PassCellArrays
Definition: vtkProbeFilter.h:264
vtkDataSetAttributes.h
vtkProbeFilter::CellList
vtkDataSetAttributes::FieldList * CellList
Definition: vtkProbeFilter.h:281
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkDataSetAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks for Information.
Definition: vtkDataSetAlgorithm.h:140
vtkProbeFilter::PointList
vtkDataSetAttributes::FieldList * PointList
Definition: vtkProbeFilter.h:282