00001 00009 #ifndef WORLDTRANSLATE_H 00010 #define WORLDTRANSLATE_H 00011 00012 // gluebase includes 00013 #define OUTSIDE_GLUE_CORE 00014 #include "mlib/points.H" 00015 #include "mlib/math_translate.H" 00016 #include <config/config.H> 00017 00018 class vjDrawManager; 00019 00020 00021 namespace InSpace { 00022 00025 class WorldTranslate : public MathTranslate 00026 { 00027 public: 00028 00029 WorldTranslate() { }; 00030 virtual ~WorldTranslate() {}; 00031 00032 // ROOM and WORLD 00033 00034 virtual void setROOM_TO_WORLD(cWtransf &xf) { 00035 _room2world = xf; 00036 _world2room = _room2world.invert(); 00037 } 00038 virtual void setWORLD_TO_ROOM(cWtransf &xf) { 00039 _world2room = xf; 00040 _room2world = _world2room.invert(); 00041 } 00042 00043 00044 virtual void moveWorld(Wvec v); 00045 virtual void moveWorld(ROOMvec v); 00046 virtual void moveWorld(Wtransf m); 00047 00048 virtual void moveRoom(Wvec v); 00049 virtual void moveRoom(ROOMvec v); 00050 virtual void moveRoom(Wtransf m); 00051 00052 virtual const Wtransf &ROOM_TO_WORLD(); 00053 virtual const Wtransf &WORLD_TO_ROOM(); 00054 00055 00056 virtual Wpt toWpt(cXYpt &xypt, cWpt ¶llel_wpt); 00057 virtual Wpt toWpt(cXYpt &xypt, double distance); 00058 virtual Wpt toWpt(cXYpt &xypt); 00059 virtual Wvec toWvec(cXYpt &xypt); 00060 00061 virtual XYpt toXYpt(cWpt &wpt); 00062 00063 // View 00064 virtual void view_size(int &width, int &height); 00065 virtual void view_pixels(double &, NDCpt &); 00066 virtual double VIEW_ASPECT(); 00067 virtual Wtransf VIEW_NDC_TRANS(); 00068 00069 protected: 00070 00071 Wtransf _room2world, _world2room; 00072 00073 void nimp(const char *fnname) { 00074 if ( CONFIGval("VERBOSE_WORLD_TRANSLATE",1) ) 00075 cerr << "WorldTranslate::" << fnname << " not implemented." << endl; 00076 } 00077 00078 }; 00079 00080 } 00081 #endif