[0d9e02]: src / hugin1 / hugin / OverviewCameraTool.h Maximize Restore History

Download this file

OverviewCameraTool.h    98 lines (78 with data), 3.3 kB

 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// -*- c-basic-offset: 4 -*-
/** @file OverviewCameraTool.h
*
* @author Darko Makreshanski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __OVERVIEW_CAMERA_TOOL_H__
#define __OVERVIEW_CAMERA_TOOL_H__
#include "Tool.h"
#include "ToolHelper.h"
/**
* tool for the manipulation of the opengl 'camera' properties
* It handles rotation of the camera position around the panosphere and
* zooming in/out (i.e. moving the camera closer or further away from the panosphere)
* TODO add manipulation of the FOV of the camera, i.e. the perspective
*/
class PanosphereOverviewCameraTool : public PanosphereOverviewTool
{
public:
PanosphereOverviewCameraTool(PanosphereOverviewToolHelper* helper) : PanosphereOverviewTool (helper) {}
virtual ~PanosphereOverviewCameraTool() {}
void Activate();
void MouseMoveEvent(double x, double y, wxMouseEvent & e);
void MouseButtonEvent(wxMouseEvent &e);
void MouseWheelEvent(wxMouseEvent &);
void ChangeZoomLevel(bool zoomIn, double scale = 1.1);
void KeypressEvent(int keycode, int modifiers, bool pressed);
private:
//lower limit for the distance of the camera with respect to the sphere radius
static const double limit_low;
//upper limit for the distance of the camera with respect to the sphere radius
static const double limit_high;
bool down;
//starting position of the mouse
double start_x, start_y;
//starting position of the camera
double start_angx, start_angy;
};
/**
* tool for manipulation of the opengl 'camera' properties
* It handles the position of the camera in 3 dimensions.
* dragging with middle click or ctrl + left click for adjusting the XY position
* and mouse wheel for adjusting Z position (zooming in/out)
*/
class PlaneOverviewCameraTool : public PlaneOverviewTool
{
public:
PlaneOverviewCameraTool(PlaneOverviewToolHelper * helper) : PlaneOverviewTool (helper) {}
virtual ~PlaneOverviewCameraTool() {}
void Activate();
void MouseMoveEvent(double x, double y, wxMouseEvent & e);
void MouseButtonEvent(wxMouseEvent &e);
void MouseWheelEvent(wxMouseEvent &);
void ChangeZoomLevel(bool zoomIn, double scale = 1.1);
void KeypressEvent(int keycode, int modifiers, bool pressed);
private:
int counter;
bool down;
//starting position of the mouse
double start_x, start_y;
//starting position of the camera
double start_pos_x, start_pos_y;
};
#endif /* __OVERVIEW_DRAG_TOOL_H__ */