00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GLUE_MLIB_MATH_TRANSLATE_H
00024 #define GLUE_MLIB_MATH_TRANSLATE_H
00025 #include "points.H"
00026
00027
00028 class DllImpExp MathTranslate {
00029 protected:
00030 static MathTranslate *instance_;
00031 public:
00032 virtual ~MathTranslate() {}
00033 virtual Wpt toWpt(cXYpt &xypt, cWpt ¶llel_wpt) = 0;
00034 virtual Wpt toWpt(cXYpt &xypt, double distance) = 0;
00035 virtual Wpt toWpt(cXYpt &xypt) = 0;
00036 virtual Wvec toWvec(cXYpt &xypt) = 0;
00037
00038 virtual XYpt toXYpt(cWpt &wpt) = 0;
00039
00040
00041 virtual void view_size(int &width, int &height) = 0;
00042 virtual void view_pixels(double &, NDCpt &) = 0;
00043 virtual double VIEW_ASPECT() = 0;
00044 virtual Wtransf VIEW_NDC_TRANS() = 0;
00045
00046
00047 virtual void setROOM_TO_WORLD(cWtransf &) { }
00048 virtual void setWORLD_TO_ROOM(cWtransf &) { }
00049 virtual const Wtransf &ROOM_TO_WORLD() = 0;
00050 virtual const Wtransf &WORLD_TO_ROOM() = 0;
00051 virtual ROOMpt toROOM(cWpt &p) { Wpt a(WORLD_TO_ROOM()*p);
00052 return ROOMpt(a[0],a[1],a[2]); }
00053 virtual ROOMvec toROOM(cWvec &v) { Wvec a(WORLD_TO_ROOM()*v);
00054 return ROOMvec(a[0],a[1],a[2]); }
00055 virtual Wpt toW(cROOMpt &p) { return ROOM_TO_WORLD()*
00056 Wpt(p[0],p[1],p[2]); }
00057 virtual Wvec toW(cROOMvec &v) { return ROOM_TO_WORLD()*
00058 Wvec(v[0],v[1],v[2]); }
00059
00060 static MathTranslate *instance() { return instance_; }
00061 static void set_instance(MathTranslate *inst) { instance_ = inst; }
00062 };
00063 #endif