VTK
dox/Common/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 "vtkObject.h"
00053 
00054 class vtkAbstractTransform;
00055 
00056 class VTK_COMMON_EXPORT vtkImplicitFunction : public vtkObject
00057 {
00058 public:
00059   vtkTypeMacro(vtkImplicitFunction,vtkObject);
00060   void PrintSelf(ostream& os, vtkIndent indent);
00061 
00064   unsigned long GetMTime();
00065 
00067 
00069   double FunctionValue(const double x[3]);
00070   double FunctionValue(double x, double y, double z) {
00071     double xyz[3] = {x, y, z}; return this->FunctionValue(xyz); };
00073 
00075 
00077   void FunctionGradient(const double x[3], double g[3]);
00078   double *FunctionGradient(const double x[3]) {
00079     this->FunctionGradient(x,this->ReturnValue);
00080     return this->ReturnValue; };
00081   double *FunctionGradient(double x, double y, double z) {
00082     double xyz[3] = {x, y, z}; return this->FunctionGradient(xyz); };
00084 
00086 
00088   virtual void SetTransform(vtkAbstractTransform*);
00089   virtual void SetTransform(const double elements[16]);
00090   vtkGetObjectMacro(Transform,vtkAbstractTransform);
00092 
00094 
00098   virtual double EvaluateFunction(double x[3]) = 0;
00099   double EvaluateFunction(double x, double y, double z) {
00100     double xyz[3] = {x, y, z}; return this->EvaluateFunction(xyz); };
00102 
00107   virtual void EvaluateGradient(double x[3], double g[3]) = 0;
00108 
00109 protected:
00110   vtkImplicitFunction();
00111   ~vtkImplicitFunction();
00112 
00113   vtkAbstractTransform *Transform;
00114   double ReturnValue[3];
00115 private:
00116   vtkImplicitFunction(const vtkImplicitFunction&);  // Not implemented.
00117   void operator=(const vtkImplicitFunction&);  // Not implemented.
00118 };
00119 
00120 #endif