VTK  9.3.0
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
47 #ifndef vtkImplicitFunction_h
48 #define vtkImplicitFunction_h
49 
50 #include "vtkCommonDataModelModule.h" // For export macro
51 #include "vtkObject.h"
52 
53 VTK_ABI_NAMESPACE_BEGIN
54 class vtkDataArray;
55 
57 
58 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunction : public vtkObject
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
68  vtkMTimeType GetMTime() override;
69 
71 
75  virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
76  double FunctionValue(const double x[3]);
77  double FunctionValue(double x, double y, double z)
78  {
79  double xyz[3] = { x, y, z };
80  return this->FunctionValue(xyz);
81  }
83 
85 
89  void FunctionGradient(const double x[3], double g[3]);
90  double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
91  {
92  this->FunctionGradient(x, this->ReturnValue);
93  return this->ReturnValue;
94  }
95  double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
96  {
97  double xyz[3] = { x, y, z };
98  return this->FunctionGradient(xyz);
99  }
101 
103 
108  virtual void SetTransform(const double elements[16]);
109  vtkGetObjectMacro(Transform, vtkAbstractTransform);
111 
113 
119  virtual double EvaluateFunction(double x[3]) = 0;
120  virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
121  virtual double EvaluateFunction(double x, double y, double z)
122  {
123  double xyz[3] = { x, y, z };
124  return this->EvaluateFunction(xyz);
125  }
127 
134  virtual void EvaluateGradient(double x[3], double g[3]) = 0;
135 
136 protected:
139 
141  double ReturnValue[3];
142 
143 private:
144  vtkImplicitFunction(const vtkImplicitFunction&) = delete;
145  void operator=(const vtkImplicitFunction&) = delete;
146 };
147 
148 VTK_ABI_NAMESPACE_END
149 #endif
superclass for all geometric transformations
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
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:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
@ Transform
Definition: vtkX3D.h:41
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_SIZEHINT(...)