VTK  9.3.1
vtkToImplicitStrategy.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
3 // Funded by CEA, DAM, DIF, F-91297 Arpajon, France
4 #ifndef vtkToImplicitStrategy_h
5 #define vtkToImplicitStrategy_h
6 
7 #include "vtkFiltersReductionModule.h" // for export
8 #include "vtkObject.h"
9 
10 VTK_ABI_NAMESPACE_BEGIN
18 class vtkDataArray;
19 class VTKFILTERSREDUCTION_EXPORT vtkToImplicitStrategy : public vtkObject
20 {
21 public:
23  void PrintSelf(std::ostream& os, vtkIndent indent) override;
24 
26 
34  vtkSetMacro(Tolerance, double);
35  vtkGetMacro(Tolerance, double);
37 
41  struct Optional
42  {
43  bool IsSome = false;
44  double Value;
45 
47  : IsSome(false)
48  {
49  }
50 
51  Optional(double val)
52  : IsSome(true)
53  , Value(val)
54  {
55  }
56  };
57 
64  virtual Optional EstimateReduction(vtkDataArray*) = 0;
65 
69  virtual vtkSmartPointer<vtkDataArray> Reduce(vtkDataArray*) = 0;
70 
77  virtual void ClearCache(){};
78 
79 protected:
80  vtkToImplicitStrategy() = default;
81  ~vtkToImplicitStrategy() override = default;
82 
83  double Tolerance = 0.001;
84 
85 private:
87  void operator=(const vtkToImplicitStrategy&) = delete;
88 };
89 VTK_ABI_NAMESPACE_END
90 
91 #endif // vtkToImplicitStrategy_h
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Pure interface for strategies to transform explicit arrays into implicit arrays.
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
A helper structure for communicating a result with an optional double value.
virtual void ClearCache()
Destroy any cached variables present in the object (useful for storing calculation results in-between...