VTK  9.2.6
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 =========================================================================*/
29 #ifndef vtkImplicitSum_h
30 #define vtkImplicitSum_h
31 
32 #include "vtkCommonDataModelModule.h" // For export macro
33 #include "vtkImplicitFunction.h"
34 
35 class vtkDoubleArray;
37 
38 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitSum : public vtkImplicitFunction
39 {
40 public:
41  static vtkImplicitSum* New();
42 
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
51  double EvaluateFunction(double x[3]) override;
53 
58  void EvaluateGradient(double x[3], double g[3]) override;
59 
63  vtkMTimeType GetMTime() override;
64 
69  void AddFunction(vtkImplicitFunction* in, double weight);
70 
75  void AddFunction(vtkImplicitFunction* in) { this->AddFunction(in, 1.0); }
76 
80  void RemoveAllFunctions();
81 
85  void SetFunctionWeight(vtkImplicitFunction* f, double weight);
86 
88 
95  vtkSetMacro(NormalizeByWeight, vtkTypeBool);
96  vtkGetMacro(NormalizeByWeight, vtkTypeBool);
97  vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
99 
100 protected:
101  vtkImplicitSum();
102  ~vtkImplicitSum() override;
103 
106  double TotalWeight;
107 
108  void CalculateTotalWeight(void);
110 
111 private:
112  vtkImplicitSum(const vtkImplicitSum&) = delete;
113  void operator=(const vtkImplicitSum&) = delete;
114 };
115 
116 #endif
abstract interface for implicit functions
void AddFunction(vtkImplicitFunction *in)
Add another implicit function to the list of functions, weighting it by a factor of 1...
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkImplicitFunctionCollection * FunctionList
maintain a list of implicit functions
vtkDoubleArray * Weights
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
dynamic, self-adjusting array of double
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkTypeBool NormalizeByWeight
implicit sum of other implicit functions
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.