-
Notifications
You must be signed in to change notification settings - Fork 3
/
GLWindow2.h
78 lines (53 loc) · 1.99 KB
/
GLWindow2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// -*- c++ -*-
// Copyright 2008 Isis Innovation Limited
#ifndef __GL_WINDOW_2_H
#define __GL_WINDOW_2_H
//
// A class which wraps a CVD::GLWindow and provides some basic
// user-interface funtionality: A gvars-driven clickable menu, and a
// caption line for text display. Also provides some handy GL helpers
// and a wrapper for CVD's text display routines.
#include <cvd/glwindow.h>
#include <TooN/TooN.h>
class GLWindowMenu;
class GLWindow2 : public CVD::GLWindow, public CVD::GLWindow::EventHandler
{
public:
GLWindow2(CVD::ImageRef irSize, std::string sTitle);
// The preferred event handler..
void HandlePendingEvents();
// functions for getting x,y coords of click
CVD::ImageRef getClick();
bool wasClicked;
CVD::ImageRef location;
// Menu interface:
void AddMenu(std::string sName, std::string sTitle);
void DrawMenus();
// Some OpenGL helpers:
void SetupViewport();
void SetupVideoOrtho();
void SetupUnitOrtho();
void SetupWindowOrtho();
void SetupVideoRasterPosAndZoom();
// Text display functions:
void PrintString(CVD::ImageRef irPos, std::string s);
void DrawCaption(std::string s);
// Map viewer mouse interface:
std::pair<TooN::Vector<6>, TooN::Vector<6> > GetMousePoseUpdate();
protected:
void GUICommandHandler(std::string sCommand, std::string sParams);
static void GUICommandCallBack(void* ptr, std::string sCommand, std::string sParams);
// User interface menus:
std::vector<GLWindowMenu*> mvpGLWindowMenus;
CVD::ImageRef mirVideoSize; // The size of the source video material.
// Event handling routines:
virtual void on_key_down(GLWindow&, int key);
virtual void on_mouse_move(GLWindow& win, CVD::ImageRef where, int state);
virtual void on_mouse_down(GLWindow& win, CVD::ImageRef where, int state, int button);
virtual void on_event(GLWindow& win, int event);
CVD::ImageRef mirLastMousePos;
// Storage for map viewer updates:
TooN::Vector<6> mvMCPoseUpdate;
TooN::Vector<6> mvLeftPoseUpdate;
};
#endif