VTK  9.4.20250310
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
10VTK_ABI_NAMESPACE_BEGIN
18class vtkDataArray;
19class VTKFILTERSREDUCTION_EXPORT vtkToImplicitStrategy : public vtkObject
20{
21public:
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
65
70
77 virtual void ClearCache() {}
78
79protected:
81 ~vtkToImplicitStrategy() override = default;
82
83 double Tolerance = 0.001;
84
85private:
87 void operator=(const vtkToImplicitStrategy&) = delete;
88};
89VTK_ABI_NAMESPACE_END
90
91#endif // vtkToImplicitStrategy_h
abstract superclass for arrays of numeric data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Hold a reference to a vtkObjectBase instance.
Pure interface for strategies to transform explicit arrays into implicit arrays.
void PrintSelf(std::ostream &os, vtkIndent indent) override
vtkToImplicitStrategy()=default
~vtkToImplicitStrategy() override=default
virtual void ClearCache()
Destroy any cached variables present in the object (useful for storing calculation results in-between...
virtual Optional EstimateReduction(vtkDataArray *)=0
Estimate the reduction (if possible) that can be obtained on the array using this strategy.
virtual vtkSmartPointer< vtkDataArray > Reduce(vtkDataArray *)=0
Return a reduced version of the input array.
A helper structure for communicating a result with an optional double value.