VTK  9.3.20240328
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
57 #ifndef vtkImplicitFunction_h
58 #define vtkImplicitFunction_h
59 
60 #include "vtkCommonDataModelModule.h" // For export macro
61 #include "vtkObject.h"
62 
63 VTK_ABI_NAMESPACE_BEGIN
64 class vtkDataArray;
65 
67 
68 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunction : public vtkObject
69 {
70 public:
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
78  vtkMTimeType GetMTime() override;
79 
81 
85  virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
86  double FunctionValue(const double x[3]);
87  double FunctionValue(double x, double y, double z)
88  {
89  double xyz[3] = { x, y, z };
90  return this->FunctionValue(xyz);
91  }
93 
95 
99  void FunctionGradient(const double x[3], double g[3]);
100  double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
101  {
102  this->FunctionGradient(x, this->ReturnValue);
103  return this->ReturnValue;
104  }
105  double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
106  {
107  double xyz[3] = { x, y, z };
108  return this->FunctionGradient(xyz);
109  }
111 
113 
118  virtual void SetTransform(const double elements[16]);
119  vtkGetObjectMacro(Transform, vtkAbstractTransform);
121 
123 
129  virtual double EvaluateFunction(double x[3]) = 0;
130  virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
131  virtual double EvaluateFunction(double x, double y, double z)
132  {
133  double xyz[3] = { x, y, z };
134  return this->EvaluateFunction(xyz);
135  }
137 
144  virtual void EvaluateGradient(double x[3], double g[3]) = 0;
145 
146 protected:
149 
151  double ReturnValue[3];
152 
153 private:
154  vtkImplicitFunction(const vtkImplicitFunction&) = delete;
155  void operator=(const vtkImplicitFunction&) = delete;
156 };
157 
158 VTK_ABI_NAMESPACE_END
159 #endif
superclass for all geometric transformations
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
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:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
@ Transform
Definition: vtkX3D.h:41
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_SIZEHINT(...)