VTK  9.4.20250206
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
23VTK_ABI_NAMESPACE_BEGIN
24class vtkDoubleArray;
26
27class VTKCOMMONDATAMODEL_EXPORT vtkImplicitSum : public vtkImplicitFunction
28{
29public:
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
53
58 void AddFunction(vtkImplicitFunction* in, double weight);
59
64 void AddFunction(vtkImplicitFunction* in) { this->AddFunction(in, 1.0); }
65
70
74 void SetFunctionWeight(vtkImplicitFunction* f, double weight);
75
77
84 vtkSetMacro(NormalizeByWeight, vtkTypeBool);
85 vtkGetMacro(NormalizeByWeight, vtkTypeBool);
86 vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
88
89protected:
91 ~vtkImplicitSum() override;
92
96
99
100private:
101 vtkImplicitSum(const vtkImplicitSum&) = delete;
102 void operator=(const vtkImplicitSum&) = delete;
103};
104
105VTK_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
static vtkImplicitSum * New()
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.
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
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270