VTK
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 =========================================================================*/
44 #ifndef vtkProbeFilter_h
45 #define vtkProbeFilter_h
46 
47 #include "vtkFiltersCoreModule.h" // For export macro
48 #include "vtkDataSetAlgorithm.h"
49 #include "vtkDataSetAttributes.h" // needed for vtkDataSetAttributes::FieldList
50 
52 class vtkCell;
53 class vtkCharArray;
54 class vtkIdTypeArray;
55 class vtkImageData;
56 class vtkPointData;
58 
59 class VTKFILTERSCORE_EXPORT vtkProbeFilter : public vtkDataSetAlgorithm
60 {
61 public:
62  static vtkProbeFilter *New();
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
73  void SetSourceData(vtkDataObject *source);
74  vtkDataObject *GetSource();
76 
83  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
84 
86 
91  vtkSetMacro(CategoricalData,vtkTypeBool);
92  vtkGetMacro(CategoricalData,vtkTypeBool);
93  vtkBooleanMacro(CategoricalData,vtkTypeBool);
95 
97 
107  vtkSetMacro(SpatialMatch, vtkTypeBool);
108  vtkGetMacro(SpatialMatch, vtkTypeBool);
109  vtkBooleanMacro(SpatialMatch, vtkTypeBool);
111 
113 
117  vtkIdTypeArray *GetValidPoints();
119 
121 
126  vtkSetStringMacro(ValidPointMaskArrayName)
127  vtkGetStringMacro(ValidPointMaskArrayName)
129 
131 
135  vtkSetMacro(PassCellArrays, vtkTypeBool);
136  vtkBooleanMacro(PassCellArrays, vtkTypeBool);
137  vtkGetMacro(PassCellArrays, vtkTypeBool);
139 
140 
144  vtkSetMacro(PassPointArrays, vtkTypeBool);
145  vtkBooleanMacro(PassPointArrays, vtkTypeBool);
146  vtkGetMacro(PassPointArrays, vtkTypeBool);
148 
149 
151 
155  vtkSetMacro(PassFieldArrays, vtkTypeBool);
156  vtkBooleanMacro(PassFieldArrays, vtkTypeBool);
157  vtkGetMacro(PassFieldArrays, vtkTypeBool);
159 
161 
166  vtkSetMacro(Tolerance, double);
167  vtkGetMacro(Tolerance, double);
169 
171 
176  vtkSetMacro(ComputeTolerance, bool);
177  vtkBooleanMacro(ComputeTolerance, bool);
178  vtkGetMacro(ComputeTolerance, bool);
180 
182 
186  virtual void SetCellLocatorPrototype(vtkAbstractCellLocator*);
187  vtkGetObjectMacro(CellLocatorPrototype, vtkAbstractCellLocator);
189 
190 protected:
191  vtkProbeFilter();
192  ~vtkProbeFilter() override;
193 
194  int RequestData(vtkInformation *, vtkInformationVector **,
195  vtkInformationVector *) override;
196  int RequestInformation(vtkInformation *, vtkInformationVector **,
197  vtkInformationVector *) override;
198  int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
199  vtkInformationVector *) override;
200 
205  void PassAttributeData(
206  vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
207 
211  void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output);
212 
217  void BuildFieldList(vtkDataSet* source);
218 
222  virtual void InitializeForProbing(vtkDataSet *input, vtkDataSet *output);
223  virtual void InitializeOutputArrays(vtkPointData *outPD, vtkIdType numPts);
224 
229  void DoProbing(vtkDataSet *input, int srcIdx, vtkDataSet *source,
230  vtkDataSet *output);
231 
232  vtkTypeBool CategoricalData;
233 
234  vtkTypeBool PassCellArrays;
235  vtkTypeBool PassPointArrays;
236  vtkTypeBool PassFieldArrays;
237 
238  vtkTypeBool SpatialMatch;
239 
240  double Tolerance;
241  bool ComputeTolerance;
242 
243  char* ValidPointMaskArrayName;
244  vtkIdTypeArray *ValidPoints;
245  vtkCharArray* MaskPoints;
246 
247  vtkAbstractCellLocator* CellLocatorPrototype;
248 
249  vtkDataSetAttributes::FieldList* CellList;
250  vtkDataSetAttributes::FieldList* PointList;
251 private:
252  vtkProbeFilter(const vtkProbeFilter&) = delete;
253  void operator=(const vtkProbeFilter&) = delete;
254 
255  // Probe only those points that are marked as not-probed by the MaskPoints
256  // array.
257  void ProbeEmptyPoints(vtkDataSet *input, int srcIdx, vtkDataSet *source,
258  vtkDataSet *output);
259 
260  // A faster implementation for vtkImageData input.
261  void ProbePointsImageData(vtkImageData *input, int srcIdx, vtkDataSet *source,
262  vtkImageData *output);
263  void ProbeImagePointsInCell(vtkCell *cell, vtkIdType cellId, vtkDataSet *source,
264  int srcBlockId, const double start[3], const double spacing[3],
265  const int dim[3], vtkPointData *outPD, char *maskArray, double *wtsBuff);
266 
267  class ProbeImageDataWorklet;
268 
269  class vtkVectorOfArrays;
270  vtkVectorOfArrays* CellArrays;
271 };
272 
273 #endif
sample data values at specified point locations
represent and manipulate point attribute data
Definition: vtkPointData.h:37
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
an abstract base class for locators which find cells
dynamic, self-adjusting array of vtkIdType
perform fast cell location operations
int vtkIdType
Definition: vtkType.h:347
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:69
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:38
abstract class to specify cell behavior
Definition: vtkCell.h:59
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
represent and manipulate attribute data in a dataset
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
general representation of visualization data
Definition: vtkDataObject.h:64
static vtkDataSetAlgorithm * New()