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
38#ifndef vtkImplicitFunction_h
39#define vtkImplicitFunction_h
40
41#include "vtkCommonDataModelModule.h" // For export macro
42#include "vtkObject.h"
43
44VTK_ABI_NAMESPACE_BEGIN
45class vtkDataArray;
46
48
49class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunction : public vtkObject
50{
51public:
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
60
62
66 virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
67 double FunctionValue(const double x[3]);
68 double FunctionValue(double x, double y, double z)
69 {
70 double xyz[3] = { x, y, z };
71 return this->FunctionValue(xyz);
72 }
74
76
80 void FunctionGradient(const double x[3], double g[3]);
81 double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
82 {
83 this->FunctionGradient(x, this->ReturnValue);
84 return this->ReturnValue;
85 }
86 double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
87 {
88 double xyz[3] = { x, y, z };
89 return this->FunctionGradient(xyz);
90 }
92
94
99 virtual void SetTransform(const double elements[16]);
100 vtkGetObjectMacro(Transform, vtkAbstractTransform);
102
104
110 virtual double EvaluateFunction(double x[3]) = 0;
111 virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
112 virtual double EvaluateFunction(double x, double y, double z)
113 {
114 double xyz[3] = { x, y, z };
115 return this->EvaluateFunction(xyz);
116 }
118
125 virtual void EvaluateGradient(double x[3], double g[3]) = 0;
126
127protected:
130
132 double ReturnValue[3];
133
134private:
136 void operator=(const vtkImplicitFunction&) = delete;
137};
138
139VTK_ABI_NAMESPACE_END
140#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:29
abstract base class for most VTK objects
Definition vtkObject.h:49
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_SIZEHINT(...)