VTK
vtkGradientFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGradientFilter.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 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
44 #ifndef vtkGradientFilter_h
45 #define vtkGradientFilter_h
46 
47 #include "vtkFiltersGeneralModule.h" // For export macro
48 #include "vtkDataSetAlgorithm.h"
49 
50 class VTKFILTERSGENERAL_EXPORT vtkGradientFilter : public vtkDataSetAlgorithm
51 {
52 public:
54  void PrintSelf(ostream &os, vtkIndent indent) override;
55 
58  All=0,
59  Patch=1,
60  DataSetMax=2
61  };
62 
66  Zero=0,
67  NaN=1,
68  DataTypeMin=2,
69  DataTypeMax=3
70  };
71 
72  static vtkGradientFilter *New();
73 
75 
81  virtual void SetInputScalars(int fieldAssociation, const char *name);
82  virtual void SetInputScalars(int fieldAssociation, int fieldAttributeType);
84 
86 
91  vtkGetStringMacro(ResultArrayName);
92  vtkSetStringMacro(ResultArrayName);
94 
96 
101  vtkGetStringMacro(DivergenceArrayName);
102  vtkSetStringMacro(DivergenceArrayName);
104 
106 
111  vtkGetStringMacro(VorticityArrayName);
112  vtkSetStringMacro(VorticityArrayName);
114 
116 
121  vtkGetStringMacro(QCriterionArrayName);
122  vtkSetStringMacro(QCriterionArrayName);
124 
126 
135  vtkGetMacro(FasterApproximation, vtkTypeBool);
136  vtkSetMacro(FasterApproximation, vtkTypeBool);
137  vtkBooleanMacro(FasterApproximation, vtkTypeBool);
139 
141 
146  vtkSetMacro(ComputeGradient, vtkTypeBool);
147  vtkGetMacro(ComputeGradient, vtkTypeBool);
148  vtkBooleanMacro(ComputeGradient, vtkTypeBool);
150 
152 
158  vtkSetMacro(ComputeDivergence, vtkTypeBool);
159  vtkGetMacro(ComputeDivergence, vtkTypeBool);
160  vtkBooleanMacro(ComputeDivergence, vtkTypeBool);
162 
164 
170  vtkSetMacro(ComputeVorticity, vtkTypeBool);
171  vtkGetMacro(ComputeVorticity, vtkTypeBool);
172  vtkBooleanMacro(ComputeVorticity, vtkTypeBool);
174 
176 
183  vtkSetMacro(ComputeQCriterion, vtkTypeBool);
184  vtkGetMacro(ComputeQCriterion, vtkTypeBool);
185  vtkBooleanMacro(ComputeQCriterion, vtkTypeBool);
187 
189 
193  vtkSetClampMacro(ContributingCellOption, int, 0, 2);
194  vtkGetMacro(ContributingCellOption, int);
196 
198 
203  vtkSetClampMacro(ReplacementValueOption, int, 0, 3);
204  vtkGetMacro(ReplacementValueOption, int);
206 
207 protected:
209  ~vtkGradientFilter() override;
210 
213  vtkInformationVector *) override;
215  vtkInformationVector *) override;
216 
222  virtual int ComputeUnstructuredGridGradient(
223  vtkDataArray* Array, int fieldAssociation, vtkDataSet* input,
224  bool computeVorticity, bool computeQCriterion, bool computeDivergence,
225  vtkDataSet* output);
226 
232  virtual int ComputeRegularGridGradient(
233  vtkDataArray* Array, int fieldAssociation, bool computeVorticity,
234  bool computeQCriterion, bool computeDivergence, vtkDataSet* output);
235 
242  int GetOutputArrayType(vtkDataArray* inputArray);
243 
249 
255 
261 
267 
278 
284 
291 
298 
305 
311 
318 
319 private:
320  vtkGradientFilter(const vtkGradientFilter &) = delete;
321  void operator=(const vtkGradientFilter &) = delete;
322 };
323 
324 #endif //_vtkGradientFilter_h
int ReplacementValueOption
Option to specify what replacement value or entities that don't have any gradient computed over them ...
char * ResultArrayName
If non-null then it contains the name of the outputted gradient array.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
char * DivergenceArrayName
If non-null then it contains the name of the outputted divergence array.
char * QCriterionArrayName
If non-null then it contains the name of the outputted Q criterion array.
vtkTypeBool ComputeGradient
Flag to indicate that the gradient of the input vector is to be computed.
vtkTypeBool ComputeVorticity
Flag to indicate that vorticity/curl of the input vector is to be computed.
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.
vtkTypeBool FasterApproximation
When this flag is on (default is off), the gradient filter will provide a less accurate (but close) a...
vtkTypeBool ComputeDivergence
Flag to indicate that the divergence of the input vector is to be computed.
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
A general filter for gradient estimation.
ReplacementValueEnum
The replacement value or entities that don't have any gradient computed over them based on the Contri...
ContributingCellEnum
Options to choose what cells contribute to the gradient calculation.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
int ContributingCellOption
Option to specify what cells to include in the gradient computation.
vtkTypeBool ComputeQCriterion
Flag to indicate that the Q-criterion of the input vector is to be computed.
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
char * VorticityArrayName
If non-null then it contains the name of the outputted vorticity array.
static vtkDataSetAlgorithm * New()