VTK  9.7.20260805
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
40
41#ifndef vtkImplicitFunction_h
42#define vtkImplicitFunction_h
43
44#include "vtkCommonDataModelModule.h" // For export macro
45#include "vtkObject.h"
46#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
47
48VTK_ABI_NAMESPACE_BEGIN
49class vtkDataArray;
50
52
53class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkImplicitFunction : public vtkObject
54{
55public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
64
66
70 virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
71 double FunctionValue(const double x[3]);
72 double FunctionValue(double x, double y, double z)
73 {
74 double xyz[3] = { x, y, z };
75 return this->FunctionValue(xyz);
76 }
77
78
80
84 void FunctionGradient(const double x[3], double g[3]);
85 double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
86 {
87 this->FunctionGradient(x, this->ReturnValue);
88 return this->ReturnValue;
89 }
90 double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
91 {
92 double xyz[3] = { x, y, z };
93 return this->FunctionGradient(xyz);
94 }
95
96
98
103 virtual void SetTransform(const double elements[16]);
104 vtkGetObjectMacro(Transform, vtkAbstractTransform);
106
108
114 virtual double EvaluateFunction(double x[3]) = 0;
115 virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
116 virtual double EvaluateFunction(double x, double y, double z)
117 {
118 double xyz[3] = { x, y, z };
119 return this->EvaluateFunction(xyz);
120 }
121
122
129 virtual void EvaluateGradient(double x[3], double g[3]) = 0;
130
131protected:
134
136 double ReturnValue[3];
137
138private:
140 void operator=(const vtkImplicitFunction&) = delete;
141};
142
143VTK_ABI_NAMESPACE_END
144#endif
superclass for all geometric transformations
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.
double * FunctionGradient(const double x[3])
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.
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(double x, double y, double z)
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:29
#define vtkDataArray
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO