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 //class WINDOW; 00021 // Translate - subclass of MathTranslate that takes care of translating 00022 // between various point/vector types 00023 class WorldTranslate : public MathTranslate 00024 { 00025 public: 00026 00027 WorldTranslate() { }; 00028 virtual ~WorldTranslate() {}; 00029 00030 // ROOM and WORLD 00031 00032 virtual void setROOM_TO_WORLD(cWtransf &xf) { 00033 _room2world = xf; 00034 _world2room = _room2world.invert(); 00035 } 00036 virtual void setWORLD_TO_ROOM(cWtransf &xf) { 00037 _world2room = xf; 00038 _room2world = _world2room.invert(); 00039 } 00040 00041 00042 virtual void moveWorld(Wvec v); 00043 virtual void moveWorld(ROOMvec v); 00044 virtual void moveWorld(Wtransf m); 00045 00046 virtual void moveRoom(Wvec v); 00047 virtual void moveRoom(ROOMvec v); 00048 virtual void moveRoom(Wtransf m); 00049 00050 virtual const Wtransf &ROOM_TO_WORLD(); 00051 virtual const Wtransf &WORLD_TO_ROOM(); 00052 00053 00054 virtual Wpt toWpt(cXYpt &xypt, cWpt ¶llel_wpt); 00055 virtual Wpt toWpt(cXYpt &xypt, double distance); 00056 virtual Wpt toWpt(cXYpt &xypt); 00057 virtual Wvec toWvec(cXYpt &xypt); 00058 00059 virtual XYpt toXYpt(cWpt &wpt); 00060 00061 // View 00062 virtual void view_size(int &width, int &height); 00063 virtual void view_pixels(double &, NDCpt &); 00064 virtual double VIEW_ASPECT(); 00065 virtual Wtransf VIEW_NDC_TRANS(); 00066 00067 protected: 00068 00069 Wtransf _room2world, _world2room; 00070 00071 void nimp(const char *fnname) { 00072 if ( CONFIGval("VERBOSE_WORLD_TRANSLATE",1) ) 00073 cerr << "WorldTranslate::" << fnname << " not implemented." << endl; 00074 } 00075 00076 }; 00077 00078 #endif