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
00039
namespace sc {
00040
00042 class Volume:
public Function {
00043
private:
00044
double _interp_acc;
00045
protected:
00046
double& interpolation_accuracy();
00047
00048
virtual void compute() = 0;
00049
00050
virtual void failure(
const char*);
00051
public:
00052
Volume();
00053
Volume(
const Ref<KeyVal>&);
00054 ~
Volume();
00055
00056
void set_gradient(
const SCVector3& g);
00057
void set_gradient(
RefSCVector& g);
00058
void get_gradient(SCVector3& g);
00059
void set_x(
const SCVector3& x);
00060
void set_x(
const RefSCVector& x);
00061
void get_x(SCVector3& x);
00062
00063
00064
00065
00066
virtual void boundingbox(
double valuemin,
00067
double valuemax,
00068 SCVector3& p1, SCVector3& p2) = 0;
00069
00070
virtual void interpolate(
const SCVector3& p1,
00071
const SCVector3& p2,
00072
double value,
00073 SCVector3& result);
00074
virtual void solve(
const SCVector3& p,
00075
const SCVector3& grad,
00076
double value,
00077 SCVector3& result);
00078 };
00079
00080 }
00081
00082
#ifdef INLINE_FUNCTIONS
00083
#include <math/isosurf/volume_i.h>
00084
#endif
00085
00086
#endif
00087
00088
00089
00090
00091