VTK  9.5.20250806
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
63
64VTK_ABI_NAMESPACE_BEGIN
65class vtkDataArray;
66
68
69class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkImplicitFunction : public vtkObject
70{
71public:
73 void PrintSelf(ostream& os, vtkIndent indent) override;
74
80
82
86 virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
87 double FunctionValue(const double x[3]);
88 double FunctionValue(double x, double y, double z)
89 {
90 double xyz[3] = { x, y, z };
91 return this->FunctionValue(xyz);
92 }
94
96
100 void FunctionGradient(const double x[3], double g[3]);
101 double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
102 {
103 this->FunctionGradient(x, this->ReturnValue);
104 return this->ReturnValue;
105 }
106 double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
107 {
108 double xyz[3] = { x, y, z };
109 return this->FunctionGradient(xyz);
110 }
112
114
119 virtual void SetTransform(const double elements[16]);
120 vtkGetObjectMacro(Transform, vtkAbstractTransform);
122
124
130 virtual double EvaluateFunction(double x[3]) = 0;
131 virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
132 virtual double EvaluateFunction(double x, double y, double z)
133 {
134 double xyz[3] = { x, y, z };
135 return this->EvaluateFunction(xyz);
136 }
138
145 virtual void EvaluateGradient(double x[3], double g[3]) = 0;
146
147protected:
150
152 double ReturnValue[3];
153
154private:
156 void operator=(const vtkImplicitFunction&) = delete;
157};
158
159VTK_ABI_NAMESPACE_END
160#endif
superclass for all geometric transformations
abstract superclass for arrays of numeric data
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.
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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO