VTK  9.3.20240418
vtkImplicitSum.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
17 #ifndef vtkImplicitSum_h
18 #define vtkImplicitSum_h
19 
20 #include "vtkCommonDataModelModule.h" // For export macro
21 #include "vtkImplicitFunction.h"
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkDoubleArray;
26 
27 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitSum : public vtkImplicitFunction
28 {
29 public:
30  static vtkImplicitSum* New();
31 
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36 
40  double EvaluateFunction(double x[3]) override;
42 
47  void EvaluateGradient(double x[3], double g[3]) override;
48 
52  vtkMTimeType GetMTime() override;
53 
59 
64  void AddFunction(vtkImplicitFunction* in) { this->AddFunction(in, 1.0); }
65 
70 
75 
77 
84  vtkSetMacro(NormalizeByWeight, vtkTypeBool);
85  vtkGetMacro(NormalizeByWeight, vtkTypeBool);
86  vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
88 
89 protected:
91  ~vtkImplicitSum() override;
92 
95  double TotalWeight;
96 
99 
100 private:
101  vtkImplicitSum(const vtkImplicitSum&) = delete;
102  void operator=(const vtkImplicitSum&) = delete;
103 };
104 
105 VTK_ABI_NAMESPACE_END
106 #endif
dynamic, self-adjusting array of double
maintain a list of implicit functions
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
implicit sum of other implicit functions
void AddFunction(vtkImplicitFunction *in, double weight)
Add another implicit function to the list of functions, along with a weighting factor.
void AddFunction(vtkImplicitFunction *in)
Add another implicit function to the list of functions, weighting it by a factor of 1.
void SetFunctionWeight(vtkImplicitFunction *f, double weight)
Set the weight (coefficient) of the given function to be weight.
void RemoveAllFunctions()
Remove all functions from the list.
double EvaluateFunction(double x[3]) override
Evaluate implicit function using current functions and weights.
vtkMTimeType GetMTime() override
Override modified time retrieval because of object dependencies.
~vtkImplicitSum() override
void CalculateTotalWeight()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkImplicitSum * New()
vtkImplicitFunctionCollection * FunctionList
vtkDoubleArray * Weights
void EvaluateGradient(double x[3], double g[3]) override
Evaluate gradient of the weighted sum of functions.
vtkTypeBool NormalizeByWeight
a simple class to control print indentation
Definition: vtkIndent.h:108
@ weight
Definition: vtkX3D.h:532
int vtkTypeBool
Definition: vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270