VTK  9.2.6
vtkImplicitFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitFunction.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
69 #ifndef vtkImplicitFunction_h
70 #define vtkImplicitFunction_h
71 
72 #include "vtkCommonDataModelModule.h" // For export macro
73 #include "vtkObject.h"
74 
75 class vtkDataArray;
76 
78 
79 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunction : public vtkObject
80 {
81 public:
83  void PrintSelf(ostream& os, vtkIndent indent) override;
84 
89  vtkMTimeType GetMTime() override;
90 
92 
96  virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
97  double FunctionValue(const double x[3]);
98  double FunctionValue(double x, double y, double z)
99  {
100  double xyz[3] = { x, y, z };
101  return this->FunctionValue(xyz);
102  }
104 
106 
110  void FunctionGradient(const double x[3], double g[3]);
111  double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
112  {
113  this->FunctionGradient(x, this->ReturnValue);
114  return this->ReturnValue;
115  }
116  double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
117  {
118  double xyz[3] = { x, y, z };
119  return this->FunctionGradient(xyz);
120  }
122 
124 
129  virtual void SetTransform(const double elements[16]);
130  vtkGetObjectMacro(Transform, vtkAbstractTransform);
132 
134 
140  virtual double EvaluateFunction(double x[3]) = 0;
141  virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
142  virtual double EvaluateFunction(double x, double y, double z)
143  {
144  double xyz[3] = { x, y, z };
145  return this->EvaluateFunction(xyz);
146  }
148 
155  virtual void EvaluateGradient(double x[3], double g[3]) = 0;
156 
157 protected:
160 
162  double ReturnValue[3];
163 
164 private:
165  vtkImplicitFunction(const vtkImplicitFunction&) = delete;
166  void operator=(const vtkImplicitFunction&) = delete;
167 };
168 
169 #endif
superclass for all geometric transformations
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
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.
virtual void FunctionValue(vtkDataArray *input, vtkDataArray *output)
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, 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(const double x[3])
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:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
@ Transform
Definition: vtkX3D.h:47
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_SIZEHINT(...)