VTK
dox/Common/DataModel/vtkImplicitFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImplicitFunction.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00049 #ifndef __vtkImplicitFunction_h
00050 #define __vtkImplicitFunction_h
00051 
00052 #include "vtkCommonDataModelModule.h" // For export macro
00053 #include "vtkObject.h"
00054 
00055 class vtkAbstractTransform;
00056 
00057 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunction : public vtkObject
00058 {
00059 public:
00060   vtkTypeMacro(vtkImplicitFunction,vtkObject);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00062 
00065   unsigned long GetMTime();
00066 
00068 
00070   double FunctionValue(const double x[3]);
00071   double FunctionValue(double x, double y, double z) {
00072     double xyz[3] = {x, y, z}; return this->FunctionValue(xyz); };
00074 
00076 
00078   void FunctionGradient(const double x[3], double g[3]);
00079   double *FunctionGradient(const double x[3]) {
00080     this->FunctionGradient(x,this->ReturnValue);
00081     return this->ReturnValue; };
00082   double *FunctionGradient(double x, double y, double z) {
00083     double xyz[3] = {x, y, z}; return this->FunctionGradient(xyz); };
00085 
00087 
00089   virtual void SetTransform(vtkAbstractTransform*);
00090   virtual void SetTransform(const double elements[16]);
00091   vtkGetObjectMacro(Transform,vtkAbstractTransform);
00093 
00095 
00099   virtual double EvaluateFunction(double x[3]) = 0;
00100   double EvaluateFunction(double x, double y, double z) {
00101     double xyz[3] = {x, y, z}; return this->EvaluateFunction(xyz); };
00103 
00108   virtual void EvaluateGradient(double x[3], double g[3]) = 0;
00109 
00110 protected:
00111   vtkImplicitFunction();
00112   ~vtkImplicitFunction();
00113 
00114   vtkAbstractTransform *Transform;
00115   double ReturnValue[3];
00116 private:
00117   vtkImplicitFunction(const vtkImplicitFunction&);  // Not implemented.
00118   void operator=(const vtkImplicitFunction&);  // Not implemented.
00119 };
00120 
00121 #endif