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 =========================================================================*/
26 #ifndef vtkImplicitSum_h
27 #define vtkImplicitSum_h
28 
29 #include "vtkCommonDataModelModule.h" // For export macro
30 #include "vtkImplicitFunction.h"
31 
32 class vtkDoubleArray;
34 
35 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitSum : public vtkImplicitFunction
36 {
37 public:
38  static vtkImplicitSum *New();
39 
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
44 
48  double EvaluateFunction(double x[3]) VTK_OVERRIDE;
50 
55  void EvaluateGradient(double x[3], double g[3]) VTK_OVERRIDE;
56 
60  vtkMTimeType GetMTime() VTK_OVERRIDE;
61 
66  void AddFunction(vtkImplicitFunction *in, double weight);
67 
72  void AddFunction(vtkImplicitFunction *in) { this->AddFunction(in, 1.0); }
73 
77  void RemoveAllFunctions();
78 
82  void SetFunctionWeight(vtkImplicitFunction *f, double weight);
83 
85 
92  vtkSetMacro(NormalizeByWeight, int);
93  vtkGetMacro(NormalizeByWeight, int);
94  vtkBooleanMacro(NormalizeByWeight, int);
96 
97 protected:
99  ~vtkImplicitSum() VTK_OVERRIDE;
100 
102  vtkDoubleArray *Weights;
103  double TotalWeight;
104 
105  void CalculateTotalWeight(void);
106  int NormalizeByWeight;
107 
108 private:
109  vtkImplicitSum(const vtkImplicitSum&) VTK_DELETE_FUNCTION;
110  void operator=(const vtkImplicitSum&) VTK_DELETE_FUNCTION;
111 };
112 
113 #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:300
maintain a list of implicit functions
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
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
implicit sum of other implicit functions
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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.