VTK  9.3.1
vtkImplicitFunction.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
38 #ifndef vtkImplicitFunction_h
39 #define vtkImplicitFunction_h
40 
41 #include "vtkCommonDataModelModule.h" // For export macro
42 #include "vtkObject.h"
43 
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkDataArray;
46 
48 
49 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunction : public vtkObject
50 {
51 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
59  vtkMTimeType GetMTime() override;
60 
62 
66  virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
67  double FunctionValue(const double x[3]);
68  double FunctionValue(double x, double y, double z)
69  {
70  double xyz[3] = { x, y, z };
71  return this->FunctionValue(xyz);
72  }
74 
76 
80  void FunctionGradient(const double x[3], double g[3]);
81  double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
82  {
83  this->FunctionGradient(x, this->ReturnValue);
84  return this->ReturnValue;
85  }
86  double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
87  {
88  double xyz[3] = { x, y, z };
89  return this->FunctionGradient(xyz);
90  }
92 
94 
98  virtual void SetTransform(vtkAbstractTransform*);
99  virtual void SetTransform(const double elements[16]);
100  vtkGetObjectMacro(Transform, vtkAbstractTransform);
102 
104 
110  virtual double EvaluateFunction(double x[3]) = 0;
111  virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
112  virtual double EvaluateFunction(double x, double y, double z)
113  {
114  double xyz[3] = { x, y, z };
115  return this->EvaluateFunction(xyz);
116  }
118 
125  virtual void EvaluateGradient(double x[3], double g[3]) = 0;
126 
127 protected:
129  ~vtkImplicitFunction() override;
130 
132  double ReturnValue[3];
133 
134 private:
135  vtkImplicitFunction(const vtkImplicitFunction&) = delete;
136  void operator=(const vtkImplicitFunction&) = delete;
137 };
138 
139 VTK_ABI_NAMESPACE_END
140 #endif
abstract interface for implicit functions
double * FunctionGradient(double x, double y, double z)
Evaluate function gradient at position x-y-z and pass back vector.
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
double * FunctionGradient(const double x[3])
Evaluate function gradient at position x-y-z and pass back vector.
double FunctionValue(double x, double y, double z)
Evaluate function at position x-y-z and return value.
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
superclass for all geometric transformations
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkAbstractTransform * Transform
#define VTK_SIZEHINT(...)
virtual double EvaluateFunction(double x, double y, double z)
Evaluate function at position x-y-z and return value.