VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
44 
45 VTK_ABI_NAMESPACE_BEGIN
46 class vtkDataArray;
47 
49 
50 class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkImplicitFunction : public vtkObject
51 {
52 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
60  vtkMTimeType GetMTime() override;
61 
63 
67  virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
68  double FunctionValue(const double x[3]);
69  double FunctionValue(double x, double y, double z)
70  {
71  double xyz[3] = { x, y, z };
72  return this->FunctionValue(xyz);
73  }
75 
77 
81  void FunctionGradient(const double x[3], double g[3]);
82  double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
83  {
84  this->FunctionGradient(x, this->ReturnValue);
85  return this->ReturnValue;
86  }
87  double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
88  {
89  double xyz[3] = { x, y, z };
90  return this->FunctionGradient(xyz);
91  }
93 
95 
99  virtual void SetTransform(vtkAbstractTransform*);
100  virtual void SetTransform(const double elements[16]);
101  vtkGetObjectMacro(Transform, vtkAbstractTransform);
103 
105 
111  virtual double EvaluateFunction(double x[3]) = 0;
112  virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
113  virtual double EvaluateFunction(double x, double y, double z)
114  {
115  double xyz[3] = { x, y, z };
116  return this->EvaluateFunction(xyz);
117  }
119 
126  virtual void EvaluateGradient(double x[3], double g[3]) = 0;
127 
128 protected:
130  ~vtkImplicitFunction() override;
131 
133  double ReturnValue[3];
134 
135 private:
136  vtkImplicitFunction(const vtkImplicitFunction&) = delete;
137  void operator=(const vtkImplicitFunction&) = delete;
138 };
139 
140 VTK_ABI_NAMESPACE_END
141 #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:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
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(...)
#define VTK_MARSHALAUTO
virtual double EvaluateFunction(double x, double y, double z)
Evaluate function at position x-y-z and return value.