VTK  9.5.2
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
37
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
45VTK_ABI_NAMESPACE_BEGIN
46class vtkDataArray;
47
49
50class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkImplicitFunction : public vtkObject
51{
52public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
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 }
74
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 }
92
93
95
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 }
118
119
126 virtual void EvaluateGradient(double x[3], double g[3]) = 0;
127
128protected:
131
133 double ReturnValue[3];
134
135private:
137 void operator=(const vtkImplicitFunction&) = delete;
138};
139
140VTK_ABI_NAMESPACE_END
141#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:287
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO