VTK  9.2.6
vtkImplicitFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitFunction.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 =========================================================================*/
59 #ifndef vtkImplicitFunction_h
60 #define vtkImplicitFunction_h
61 
62 #include "vtkCommonDataModelModule.h" // For export macro
63 #include "vtkObject.h"
64 
65 class vtkDataArray;
66 
68 
69 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunction : public vtkObject
70 {
71 public:
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
79  vtkMTimeType GetMTime() override;
80 
82 
86  virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
87  double FunctionValue(const double x[3]);
88  double FunctionValue(double x, double y, double z)
89  {
90  double xyz[3] = { x, y, z };
91  return this->FunctionValue(xyz);
92  }
94 
96 
100  void FunctionGradient(const double x[3], double g[3]);
101  double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
102  {
103  this->FunctionGradient(x, this->ReturnValue);
104  return this->ReturnValue;
105  }
106  double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
107  {
108  double xyz[3] = { x, y, z };
109  return this->FunctionGradient(xyz);
110  }
112 
114 
119  virtual void SetTransform(const double elements[16]);
120  vtkGetObjectMacro(Transform, vtkAbstractTransform);
122 
124 
130  virtual double EvaluateFunction(double x[3]) = 0;
131  virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
132  virtual double EvaluateFunction(double x, double y, double z)
133  {
134  double xyz[3] = { x, y, z };
135  return this->EvaluateFunction(xyz);
136  }
138 
145  virtual void EvaluateGradient(double x[3], double g[3]) = 0;
146 
147 protected:
150 
152  double ReturnValue[3];
153 
154 private:
155  vtkImplicitFunction(const vtkImplicitFunction&) = delete;
156  void operator=(const vtkImplicitFunction&) = delete;
157 };
158 
159 #endif
superclass for all geometric transformations
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:65
abstract interface for implicit functions
virtual void EvaluateFunction(vtkDataArray *input, vtkDataArray *output)
Evaluate function at position x-y-z and return value.
virtual void SetTransform(const double elements[16])
Set/Get a transformation to apply to input points before executing the implicit function.
vtkAbstractTransform * Transform
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
virtual void FunctionValue(vtkDataArray *input, vtkDataArray *output)
Evaluate function at position x-y-z and return value.
double * FunctionGradient(double x, double y, double z)
Evaluate function gradient at position x-y-z and pass back vector.
virtual double EvaluateFunction(double x, double y, double z)
Evaluate function at position x-y-z and return value.
vtkMTimeType GetMTime() override
Overload standard modified time function.
virtual void SetTransform(vtkAbstractTransform *)
Set/Get a transformation to apply to input points before executing the implicit function.
double FunctionValue(double x, double y, double z)
Evaluate function at position x-y-z and return value.
double * FunctionGradient(const double x[3])
Evaluate function gradient at position x-y-z and pass back vector.
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double FunctionValue(const double x[3])
Evaluate function at position x-y-z and return value.
void FunctionGradient(const double x[3], double g[3])
Evaluate function gradient at position x-y-z and pass back vector.
~vtkImplicitFunction() override
a simple class to control print indentation
Definition: vtkIndent.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:72
@ Transform
Definition: vtkX3D.h:47
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_SIZEHINT(...)