VTK  9.0.1
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 =========================================================================*/
50 #ifndef vtkImplicitFunction_h
51 #define vtkImplicitFunction_h
52 
53 #include "vtkCommonDataModelModule.h" // For export macro
54 #include "vtkObject.h"
55 
56 class vtkDataArray;
57 
59 
60 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunction : public vtkObject
61 {
62 public:
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
70  vtkMTimeType GetMTime() override;
71 
73 
77  virtual void FunctionValue(vtkDataArray* input, vtkDataArray* output);
78  double FunctionValue(const double x[3]);
79  double FunctionValue(double x, double y, double z)
80  {
81  double xyz[3] = { x, y, z };
82  return this->FunctionValue(xyz);
83  }
85 
87 
91  void FunctionGradient(const double x[3], double g[3]);
92  double* FunctionGradient(const double x[3]) VTK_SIZEHINT(3)
93  {
94  this->FunctionGradient(x, this->ReturnValue);
95  return this->ReturnValue;
96  }
97  double* FunctionGradient(double x, double y, double z) VTK_SIZEHINT(3)
98  {
99  double xyz[3] = { x, y, z };
100  return this->FunctionGradient(xyz);
101  }
103 
105 
110  virtual void SetTransform(const double elements[16]);
111  vtkGetObjectMacro(Transform, vtkAbstractTransform);
113 
115 
121  virtual double EvaluateFunction(double x[3]) = 0;
122  virtual void EvaluateFunction(vtkDataArray* input, vtkDataArray* output);
123  virtual double EvaluateFunction(double x, double y, double z)
124  {
125  double xyz[3] = { x, y, z };
126  return this->EvaluateFunction(xyz);
127  }
129 
136  virtual void EvaluateGradient(double x[3], double g[3]) = 0;
137 
138 protected:
141 
143  double ReturnValue[3];
144 
145 private:
146  vtkImplicitFunction(const vtkImplicitFunction&) = delete;
147  void operator=(const vtkImplicitFunction&) = delete;
148 };
149 
150 #endif
superclass for all geometric transformations
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
abstract interface for implicit functions
virtual void EvaluateFunction(vtkDataArray *input, vtkDataArray *output)
virtual void SetTransform(const double elements[16])
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)
virtual double EvaluateFunction(double x, double y, double z)
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)
double * FunctionGradient(const double x[3])
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])
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:34
abstract base class for most VTK objects
Definition: vtkObject.h:54
@ Transform
Definition: vtkX3D.h:47
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
#define VTK_SIZEHINT(...)