Go to the documentation of this file.00001
00002
00003 #ifndef __GL_WINDOW_2_H
00004 #define __GL_WINDOW_2_H
00005
00006
00007
00008
00009
00010
00011 #include <cvd/glwindow.h>
00012 #include <TooN/TooN.h>
00013 #include "MouseKeyHandler.h"
00014
00015 class GLWindowMenu;
00016
00017 class GLWindow2 : public CVD::GLWindow, public CVD::GLWindow::EventHandler
00018 {
00019 public:
00020 GLWindow2(CVD::ImageRef irSize, std::string sTitle, MouseKeyHandler* handler);
00021
00022
00023 void HandlePendingEvents();
00024
00025
00026 void AddMenu(std::string sName, std::string sTitle);
00027 void DrawMenus();
00028
00029
00030 void SetupViewport();
00031 void SetupVideoOrtho();
00032 void SetupUnitOrtho();
00033 void SetupWindowOrtho();
00034 void SetupVideoRasterPosAndZoom();
00035
00036
00037 void PrintString(CVD::ImageRef irPos, std::string s);
00038 void DrawCaption(std::string s);
00039
00040
00041 std::pair<TooN::Vector<6>, TooN::Vector<6> > GetMousePoseUpdate();
00042
00043
00044 protected:
00045 void GUICommandHandler(std::string sCommand, std::string sParams);
00046 static void GUICommandCallBack(void* ptr, std::string sCommand, std::string sParams);
00047
00048
00049 std::vector<GLWindowMenu*> mvpGLWindowMenus;
00050
00051 MouseKeyHandler* myHandler;
00052
00053 CVD::ImageRef mirVideoSize;
00054
00055
00056
00057 virtual void on_key_down(GLWindow&, int key);
00058 virtual void on_mouse_move(GLWindow& win, CVD::ImageRef where, int state);
00059 virtual void on_mouse_down(GLWindow& win, CVD::ImageRef where, int state, int button);
00060 virtual void on_event(GLWindow& win, int event);
00061 CVD::ImageRef mirLastMousePos;
00062
00063
00064 TooN::Vector<6> mvMCPoseUpdate;
00065 TooN::Vector<6> mvLeftPoseUpdate;
00066 };
00067
00068
00069
00070
00071
00072
00073
00074
00075 #endif