VTK  9.7.20260718
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
59
60#ifndef vtkImplicitFunction_h
61#define vtkImplicitFunction_h
62
63#include "vtkCommonDataModelModule.h" // For export macro
64#include "vtkObject.h"
65#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
66
67VTK_ABI_NAMESPACE_BEGIN
68class vtkDataArray;
69
71
72class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkImplicitFunction : public vtkObject
73{
74public:
76 void PrintSelf(ostream& os, vtkIndent indent) override;
77
83
85
89 virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
90 double FunctionValue(const double x[3]);
91 double FunctionValue(double x, double y, double z)
92 {
93 double xyz[3] = { x, y, z };
94 return this->FunctionValue(xyz);
95 }
96
97
99
103 void FunctionGradient(const double x[3], double g[3]);
104 double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
105 {
106 this->FunctionGradient(x, this->ReturnValue);
107 return this->ReturnValue;
108 }
109 double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
110 {
111 double xyz[3] = { x, y, z };
112 return this->FunctionGradient(xyz);
113 }
114
115
117
122 virtual void SetTransform(const double elements[16]);
123 vtkGetObjectMacro(Transform, vtkAbstractTransform);
125
127
133 virtual double EvaluateFunction(double x[3]) = 0;
134 virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
135 virtual double EvaluateFunction(double x, double y, double z)
136 {
137 double xyz[3] = { x, y, z };
138 return this->EvaluateFunction(xyz);
139 }
140
141
148 virtual void EvaluateGradient(double x[3], double g[3]) = 0;
149
150protected:
153
155 double ReturnValue[3];
156
157private:
159 void operator=(const vtkImplicitFunction&) = delete;
160};
161
162VTK_ABI_NAMESPACE_END
163#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:108
#define vtkDataArray
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO