VTK  9.1.0
vtkImplicitSum.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImplicitSum.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
26#ifndef vtkImplicitSum_h
27#define vtkImplicitSum_h
28
29#include "vtkCommonDataModelModule.h" // For export macro
30#include "vtkImplicitFunction.h"
31
32class vtkDoubleArray;
34
35class VTKCOMMONDATAMODEL_EXPORT vtkImplicitSum : public vtkImplicitFunction
36{
37public:
39
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
48 double EvaluateFunction(double x[3]) override;
50
55 void EvaluateGradient(double x[3], double g[3]) override;
56
61
66 void AddFunction(vtkImplicitFunction* in, double weight);
67
72 void AddFunction(vtkImplicitFunction* in) { this->AddFunction(in, 1.0); }
73
78
82 void SetFunctionWeight(vtkImplicitFunction* f, double weight);
83
85
92 vtkSetMacro(NormalizeByWeight, vtkTypeBool);
93 vtkGetMacro(NormalizeByWeight, vtkTypeBool);
94 vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
96
97protected:
99 ~vtkImplicitSum() override;
100
104
107
108private:
109 vtkImplicitSum(const vtkImplicitSum&) = delete;
110 void operator=(const vtkImplicitSum&) = delete;
111};
112
113#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 CalculateTotalWeight(void)
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 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:113
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287