VTK
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 =========================================================================*/
32 #ifndef vtkImplicitSum_h
33 #define vtkImplicitSum_h
34 
35 #include "vtkCommonDataModelModule.h" // For export macro
36 #include "vtkImplicitFunction.h"
37 
38 class vtkDoubleArray;
40 
41 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitSum : public vtkImplicitFunction
42 {
43 public:
44  static vtkImplicitSum *New();
45 
47  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
48 
50 
53  double EvaluateFunction(double x[3]) VTK_OVERRIDE;
54  double EvaluateFunction(double x, double y, double z)
55  {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
57 
62  void EvaluateGradient(double x[3], double g[3]) VTK_OVERRIDE;
63 
67  vtkMTimeType GetMTime() VTK_OVERRIDE;
68 
73  void AddFunction(vtkImplicitFunction *in, double weight);
74 
79  void AddFunction(vtkImplicitFunction *in) { this->AddFunction(in, 1.0); }
80 
85 
90 
92 
99  vtkSetMacro(NormalizeByWeight, int);
100  vtkGetMacro(NormalizeByWeight, int);
101  vtkBooleanMacro(NormalizeByWeight, int);
103 
104 protected:
106  ~vtkImplicitSum() VTK_OVERRIDE;
107 
109  vtkDoubleArray *Weights;
110  double TotalWeight;
111 
112  void CalculateTotalWeight(void);
113  int NormalizeByWeight;
114 
115 private:
116  vtkImplicitSum(const vtkImplicitSum&) VTK_DELETE_FUNCTION;
117  void operator=(const vtkImplicitSum&) VTK_DELETE_FUNCTION;
118 };
119 
120 #endif
vtkImplicitSum::EvaluateFunction
double EvaluateFunction(double x, double y, double z)
Definition: vtkImplicitSum.h:54
vtkImplicitSum::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::weight
@ weight
Definition: vtkX3D.h:532
vtkImplicitFunction::EvaluateFunction
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkImplicitSum::EvaluateGradient
void EvaluateGradient(double x[3], double g[3]) override
Evaluate gradient of the weighted sum of functions.
vtkImplicitSum::GetMTime
vtkMTimeType GetMTime() override
Override modified time retrieval because of object dependencies.
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:59
vtkImplicitSum
implicit sum of other implicit functions
Definition: vtkImplicitSum.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkImplicitSum::SetFunctionWeight
void SetFunctionWeight(vtkImplicitFunction *f, double weight)
Set the weight (coefficient) of the given function to be weight.
vtkImplicitSum::~vtkImplicitSum
~vtkImplicitSum() override
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkImplicitFunction.h
vtkImplicitSum::EvaluateFunction
double EvaluateFunction(double x[3]) override
Evaluate implicit function using current functions and weights.
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:42
vtkImplicitSum::AddFunction
void AddFunction(vtkImplicitFunction *in)
Add another implicit function to the list of functions, weighting it by a factor of 1.
Definition: vtkImplicitSum.h:79
vtkImplicitSum::RemoveAllFunctions
void RemoveAllFunctions()
Remove all functions from the list.
vtkImplicitSum::New
static vtkImplicitSum * New()
vtkImplicitFunctionCollection
maintain a list of implicit functions
Definition: vtkImplicitFunctionCollection.h:34
vtkImplicitSum::vtkImplicitSum
vtkImplicitSum()