Mouse control
[tecorrec.git] / geo / tcObserver.h
blob2049e060bd83bfe941412d09d0fa3cea4c3206e2
1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * Tecorrec is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * Tecorrec is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with Tecorrec. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _tcObserver_h_
21 #define _tcObserver_h_
23 /**
24 * @file tcObserver.h
25 * @brief Viewing information for an observer.
28 #include "tcGeo.h"
29 #include "tcGeoVector.h"
31 /// Viewing information for an observer.
32 class tcObserver
34 public:
37 * Constructors + destructor
40 /// Primary constructor.
41 tcObserver();
43 /// Destructor.
44 virtual ~tcObserver();
47 * Main interface
50 /// Set up the OpenGL projection matrix for this observer.
51 void setupProjection(double aspect) const;
53 /// Set up the OpenGL modelview matrix for this observer.
54 void setupModelView() const;
57 * Mutators
60 /// Adjust the focus directly.
61 void setFocus(const tcGeo& focus, double altitude);
63 /// Make a local transformation of the focus.
64 void moveFocusRelative(double dx, double dy);
66 /// Adjust the range exponentially.
67 void adjustRange(double x);
69 /// Adjust the azimuth in radians.
70 void adjustAzimuth(double daz);
72 /// Adjust the elevation in radians.
73 void adjustElevation(double del);
75 private:
78 * Variables
81 /// Geographical position of focus.
82 tcGeo m_focus;
84 /// Altitude of focus.
85 double m_focusAltitude;
87 /// Observation direction.
88 tcGeoVector m_view;
90 /// Range of camera.
91 double m_range;
94 #endif