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
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkGradientFilter::ComputeVorticity
vtkTypeBool ComputeVorticity
Flag to indicate that vorticity/curl of the input vector is to be computed.
Definition: vtkGradientFilter.h:304
vtkGradientFilter::FasterApproximation
vtkTypeBool FasterApproximation
When this flag is on (default is off), the gradient filter will provide a less accurate (but close) a...
Definition: vtkGradientFilter.h:277
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:180
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
vtkGradientFilter::ResultArrayName
char * ResultArrayName
If non-null then it contains the name of the outputted gradient array.
Definition: vtkGradientFilter.h:248
vtkGradientFilter::ReplacementValueOption
int ReplacementValueOption
Option to specify what replacement value or entities that don't have any gradient computed over them ...
Definition: vtkGradientFilter.h:317
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:48
vtkGradientFilter::ReplacementValueEnum
ReplacementValueEnum
The replacement value or entities that don't have any gradient computed over them based on the Contri...
Definition: vtkGradientFilter.h:65
vtkGradientFilter::QCriterionArrayName
char * QCriterionArrayName
If non-null then it contains the name of the outputted Q criterion array.
Definition: vtkGradientFilter.h:266
vtkGradientFilter::ContributingCellEnum
ContributingCellEnum
Options to choose what cells contribute to the gradient calculation.
Definition: vtkGradientFilter.h:57
vtkGradientFilter::ContributingCellOption
int ContributingCellOption
Option to specify what cells to include in the gradient computation.
Definition: vtkGradientFilter.h:310
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkDataSetAlgorithm::New
static vtkDataSetAlgorithm * New()
vtkGradientFilter::ComputeGradient
vtkTypeBool ComputeGradient
Flag to indicate that the gradient of the input vector is to be computed.
Definition: vtkGradientFilter.h:283
vtkGradientFilter::VorticityArrayName
char * VorticityArrayName
If non-null then it contains the name of the outputted vorticity array.
Definition: vtkGradientFilter.h:260
vtkX3D::name
Definition: vtkX3D.h:219
vtkGradientFilter
A general filter for gradient estimation.
Definition: vtkGradientFilter.h:50
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkGradientFilter::ComputeDivergence
vtkTypeBool ComputeDivergence
Flag to indicate that the divergence of the input vector is to be computed.
Definition: vtkGradientFilter.h:290
vtkDataSetAlgorithm.h
vtkDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkGradientFilter::ComputeQCriterion
vtkTypeBool ComputeQCriterion
Flag to indicate that the Q-criterion of the input vector is to be computed.
Definition: vtkGradientFilter.h:297
vtkGradientFilter::DivergenceArrayName
char * DivergenceArrayName
If non-null then it contains the name of the outputted divergence array.
Definition: vtkGradientFilter.h:254