VTK  9.3.1
vtkHyperTreeGridGradient.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
23 #ifndef vtkHyperTreeGridGradient_h
24 #define vtkHyperTreeGridGradient_h
25 
26 #include "vtkFiltersHyperTreeModule.h" // For export macro
27 
28 #include "vtkDeprecation.h" // for deprecatin S/GetRenderWindow
30 #include "vtkNew.h" // for internal fields
31 #include "vtkSmartPointer.h" // for internal fields
32 
33 #include <cstring> // for strdup, to initialize char*
34 
35 VTK_ABI_NAMESPACE_BEGIN
36 
38 class vtkBitArray;
39 class vtkDoubleArray;
41 
42 class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridGradient : public vtkHyperTreeGridAlgorithm
43 {
44 public:
46  {
47  UNLIMITED = 0,
48  UNSTRUCTURED
49  };
50 
51  static vtkHyperTreeGridGradient* New();
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
56 
60  vtkSetMacro(ComputeGradient, bool);
61  vtkGetMacro(ComputeGradient, bool);
62  vtkBooleanMacro(ComputeGradient, bool);
64 
66 
69  vtkSetStringMacro(GradientArrayName);
70  vtkGetStringMacro(GradientArrayName);
71  VTK_DEPRECATED_IN_9_3_0("Please use unambiguous SetGradientArrayName method instead.")
72  void SetResultArrayName(std::string name) { this->SetGradientArrayName(name.c_str()); }
73  VTK_DEPRECATED_IN_9_3_0("Please use unambiguous GetGradientArrayName method instead.")
74  std::string GetResultArrayName() { return std::string(this->GetGradientArrayName()); }
76 
78 
84  vtkSetClampMacro(Mode, int, UNLIMITED, UNSTRUCTURED);
85  vtkGetMacro(Mode, int);
87 
89 
94  vtkSetMacro(ExtensiveComputation, bool);
95  vtkGetMacro(ExtensiveComputation, bool);
96  vtkBooleanMacro(ExtensiveComputation, bool);
98 
100 
104  vtkSetMacro(ComputeDivergence, bool);
105  vtkGetMacro(ComputeDivergence, bool);
106  vtkBooleanMacro(ComputeDivergence, bool);
108 
110 
113  vtkSetStringMacro(DivergenceArrayName);
114  vtkGetStringMacro(DivergenceArrayName);
116 
118 
122  vtkSetMacro(ComputeVorticity, bool);
123  vtkGetMacro(ComputeVorticity, bool);
124  vtkBooleanMacro(ComputeVorticity, bool);
126 
128 
131  vtkSetStringMacro(VorticityArrayName);
132  vtkGetStringMacro(VorticityArrayName);
134 
136 
140  vtkSetMacro(ComputeQCriterion, bool);
141  vtkGetMacro(ComputeQCriterion, bool);
142  vtkBooleanMacro(ComputeQCriterion, bool);
144 
146 
149  vtkSetStringMacro(QCriterionArrayName);
150  vtkGetStringMacro(QCriterionArrayName);
152 
153 protected:
155  ~vtkHyperTreeGridGradient() override;
156 
161 
166  template <class Cursor, class GradWorker>
167  void RecursivelyProcessGradientTree(Cursor*, GradWorker&);
168 
173  template <class FieldsWorker>
174  void ProcessFields(FieldsWorker&);
175 
176  // Fields
177  // ------
178 
179  // Gradient
180  bool ComputeGradient = true;
182  char* GradientArrayName = strdup("Gradient");
183  int Mode = ComputeMode::UNLIMITED;
184  bool ExtensiveComputation = false;
185 
186  // Divergence
187  bool ComputeDivergence = false;
189  char* DivergenceArrayName = strdup("Divergence");
190 
191  // Vorticity
192  bool ComputeVorticity = false;
194  char* VorticityArrayName = strdup("Vorticity");
195 
196  // QCriterion
197  bool ComputeQCriterion = false;
199  char* QCriterionArrayName = strdup("QCriterion");
200 
205 
206  // shortcut to HTG fields
207  vtkBitArray* InMask = nullptr;
208  vtkUnsignedCharArray* InGhostArray = nullptr;
209 
210 private:
212  void operator=(const vtkHyperTreeGridGradient&) = delete;
213 };
214 
215 VTK_ABI_NAMESPACE_END
216 #endif // vtkHyperTreeGridGradient_h
vtkNew< vtkDoubleArray > OutVortArray
vtkNew< vtkDoubleArray > OutDivArray
vtkSmartPointer< vtkDataArray > InArray
Keep track of selected input scalars / vectors.
VTKACCELERATORSVTKMDATAMODEL_EXPORT void ProcessFields(vtkDataSet *input, vtkm::cont::DataSet &dataset, tovtkm::FieldsFlag fields)
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Objects for traversal a HyperTreeGrid.
dynamic, self-adjusting array of double
#define VTK_DEPRECATED_IN_9_3_0(reason)
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of unsigned char
vtkNew< vtkDoubleArray > OutGradArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:28
Superclass for algorithms that produce a hyper tree grid as output.
static vtkAlgorithm * New()
Compute the gradient of a scalar field on a Hyper Tree Grid.
general representation of visualization data
Definition: vtkDataObject.h:54
vtkNew< vtkDoubleArray > OutQCritArray
virtual int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *)=0
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...