GLWindow2.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Copyright 2008 Isis Innovation Limited
00003 #ifndef __GL_WINDOW_2_H
00004 #define __GL_WINDOW_2_H
00005 //
00006 //  A class which wraps a CVD::GLWindow and provides some basic
00007 //  user-interface funtionality: A gvars-driven clickable menu, and a
00008 //  caption line for text display. Also provides some handy GL helpers
00009 //  and a wrapper for CVD's text display routines.
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   // The preferred event handler..
00023   void HandlePendingEvents();
00024   
00025   // Menu interface:
00026   void AddMenu(std::string sName, std::string sTitle);
00027   void DrawMenus();
00028   
00029   // Some OpenGL helpers:
00030   void SetupViewport();
00031   void SetupVideoOrtho();
00032   void SetupUnitOrtho();
00033   void SetupWindowOrtho();
00034   void SetupVideoRasterPosAndZoom();
00035 
00036   // Text display functions:
00037   void PrintString(CVD::ImageRef irPos, std::string s);
00038   void DrawCaption(std::string s);
00039   
00040   // Map viewer mouse interface:
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   // User interface menus:
00049   std::vector<GLWindowMenu*> mvpGLWindowMenus;
00050 
00051   MouseKeyHandler* myHandler;
00052 
00053   CVD::ImageRef mirVideoSize;   // The size of the source video material.
00054   
00055 
00056   // Event handling routines:
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   // Storage for map viewer updates:
00064   TooN::Vector<6> mvMCPoseUpdate;
00065   TooN::Vector<6> mvLeftPoseUpdate;
00066 };
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 #endif


tum_ardrone
Author(s):
autogenerated on Sat Jun 8 2019 20:27:22