00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #ifndef _math_isosurf_volume_h
00029 #define _math_isosurf_volume_h
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <math/optimize/function.h>
00036 #include <math/scmat/matrix.h>
00037 #include <math/scmat/vector3.h>
00038 
00040 class Volume: public Function {
00041   private:
00042     double _interp_acc;
00043   protected:
00044     double& interpolation_accuracy();
00045 
00046     virtual void compute() = 0;
00047 
00048     virtual void failure(const char*);
00049   public:
00050     Volume();
00051     Volume(const Ref<KeyVal>&);
00052     ~Volume();
00053 
00054     void set_gradient(const SCVector3& g);
00055     void set_gradient(RefSCVector& g);
00056     void get_gradient(SCVector3& g);
00057     void set_x(const SCVector3& x);
00058     void set_x(const RefSCVector& x);
00059     void get_x(SCVector3& x);
00060 
00061     
00062     
00063     
00064     virtual void boundingbox(double valuemin,
00065                              double valuemax,
00066                              SCVector3& p1, SCVector3& p2) = 0;
00067 
00068     virtual void interpolate(const SCVector3& p1,
00069                              const SCVector3& p2,
00070                              double value,
00071                              SCVector3& result);
00072     virtual void solve(const SCVector3& p,
00073                        const SCVector3& grad,
00074                        double value,
00075                        SCVector3& result);
00076 };
00077 
00078 
00079 
00080 #ifdef INLINE_FUNCTIONS
00081 #include <math/isosurf/volume_i.h>
00082 #endif
00083 
00084 #endif
00085 
00086 
00087 
00088 
00089