StelMovementMgr.hpp   StelMovementMgr.hpp 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STELMOVEMENTMGR_HPP_ #ifndef _STELMOVEMENTMGR_HPP_
#define _STELMOVEMENTMGR_HPP_ #define _STELMOVEMENTMGR_HPP_
#include "StelModule.hpp" #include "StelModule.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelObjectType.hpp"
//! @class StelMovementMgr //! @class StelMovementMgr
//! Manages the head movements and zoom operations. //! Manages the head movements and zoom operations.
class StelMovementMgr : public StelModule class StelMovementMgr : public StelModule
{ {
Q_OBJECT Q_OBJECT
public: public:
//! Possible mount modes defining the reference frame in which head
movements occur.
enum MountMode { MountAltAzimuthal, MountEquinoxEquatorial, MountGal
actic};
StelMovementMgr(StelCore* core); StelMovementMgr(StelCore* core);
virtual ~StelMovementMgr(); virtual ~StelMovementMgr();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
//! Initializes the object based on the application settings //! Initializes the object based on the application settings
//! Includes: //! Includes:
//! - Enabling/disabling the movement keys //! - Enabling/disabling the movement keys
//! - Enabling/disabling the zoom keys //! - Enabling/disabling the zoom keys
//! - Enabling/disabling the mouse zoom //! - Enabling/disabling the mouse zoom
skipping to change at line 76 skipping to change at line 81
//! Increment/decrement smoothly the vision field and position. //! Increment/decrement smoothly the vision field and position.
void updateMotion(double deltaTime); void updateMotion(double deltaTime);
// These are hopefully temporary. // These are hopefully temporary.
bool getHasDragged() const {return hasDragged;} bool getHasDragged() const {return hasDragged;}
//! Get the zoom speed //! Get the zoom speed
// TODO: what are the units? // TODO: what are the units?
double getZoomSpeed() {return keyZoomSpeed;} double getZoomSpeed() {return keyZoomSpeed;}
//! Return the current up view vector.
Vec3d getViewUpVectorJ2000() const;
void setMovementSpeedFactor(float s) {movementsSpeedFactor=s;}
float getMovementSpeedFactor() const {return movementsSpeedFactor;}
public slots: public slots:
//! Toggle current mount mode between equatorial and altazimuthal
void toggleMountMode() {if (getMountMode()==MountAltAzimuthal) setMo
untMode(MountEquinoxEquatorial); else setMountMode(MountAltAzimuthal);}
//! Define whether we should use equatorial mount or altazimuthal
void setEquatorialMount(bool b) {setMountMode(b ? MountEquinoxEquato
rial : MountAltAzimuthal);}
//! Set object tracking on/off and go to selected object //! Set object tracking on/off and go to selected object
void setFlagTracking(bool b=true); void setFlagTracking(bool b=true);
//! Get current object tracking status. //! Get current object tracking status.
bool getFlagTracking(void) const {return flagTracking;} bool getFlagTracking(void) const {return flagTracking;}
//! Set whether sky position is to be locked. //! Set whether sky position is to be locked.
void setFlagLockEquPos(bool b) {flagLockEquPos=b;} void setFlagLockEquPos(bool b);
//! Get whether sky position is locked. //! Get whether sky position is locked.
bool getFlagLockEquPos(void) const {return flagLockEquPos;} bool getFlagLockEquPos(void) const {return flagLockEquPos;}
//! Move view in alt/az (or equatorial if in that mode) coordinates. //! Move view in alt/az (or equatorial if in that mode) coordinates.
//! Changes to viewing direction are instantaneous. //! Changes to viewing direction are instantaneous.
//! @param deltaAz change in azimuth angle in radians //! @param deltaAz change in azimuth angle in radians
//! @param deltaAlt change in altitude angle in radians //! @param deltaAlt change in altitude angle in radians
void panView(double deltaAz, double deltaAlt); void panView(double deltaAz, double deltaAlt);
//! Set automove duration in seconds //! Set automove duration in seconds
skipping to change at line 125 skipping to change at line 141
//! Get whether being at the edge of the screen activates movement //! Get whether being at the edge of the screen activates movement
bool getFlagEnableMoveAtScreenEdge() const {return flagEnableMoveAtS creenEdge;} bool getFlagEnableMoveAtScreenEdge() const {return flagEnableMoveAtS creenEdge;}
//! Set whether being at the edge of the screen activates movement //! Set whether being at the edge of the screen activates movement
void setFlagEnableMoveAtScreenEdge(bool b) {flagEnableMoveAtScreenEd ge=b;} void setFlagEnableMoveAtScreenEdge(bool b) {flagEnableMoveAtScreenEd ge=b;}
//! Get whether mouse can control movement //! Get whether mouse can control movement
bool getFlagEnableMouseNavigation() const {return flagEnableMouseNav igation;} bool getFlagEnableMouseNavigation() const {return flagEnableMouseNav igation;}
//! Set whether mouse can control movement //! Set whether mouse can control movement
void setFlagEnableMouseNavigation(bool b) {flagEnableMouseNavigation =b;} void setFlagEnableMouseNavigation(bool b) {flagEnableMouseNavigation =b;}
//! Move the view to a specified position. //! Move the view to a specified J2000 position.
//! Uses equatorial or local coordinate depending on _localPos value
.
//! @param aim The position to move to expressed as a vector. //! @param aim The position to move to expressed as a vector.
//! @param moveDuration The time it takes for the move to complete. //! @param moveDuration The time it takes for the move to complete.
//! @param localPos If false, use equatorial position, else use loca l.
//! @param zooming ??? //! @param zooming ???
void moveTo(const Vec3d& aim, float moveDuration = 1., bool localPos void moveToJ2000(const Vec3d& aim, float moveDuration = 1., int zoom
= false, int zooming = 0); ing = 0);
void moveToObject(const StelObjectP& target, float moveDuration = 1.
, int zooming = 0);
//! Change the zoom level. //! Change the zoom level.
//! @param aimFov The desired field of view in degrees. //! @param aimFov The desired field of view in degrees.
//! @param moveDuration The time that the operation should take to c omplete. //! @param moveDuration The time that the operation should take to c omplete.
void zoomTo(double aimFov, float moveDuration = 1.); void zoomTo(double aimFov, float moveDuration = 1.);
//! Get the current Field Of View in degrees //! Get the current Field Of View in degrees
double getCurrentFov() const {return currentFov;} double getCurrentFov() const {return currentFov;}
//! Return the initial default FOV in degree. //! Return the initial default FOV in degree.
double getInitFov() const {return initFov;} double getInitFov() const {return initFov;}
//! Set the initial Field Of View in degree. //! Set the initial Field Of View in degree.
void setInitFov(double fov) {initFov=fov;} void setInitFov(double fov) {initFov=fov;}
//! Return the inital viewing direction in altazimuthal coordinates
const Vec3d& getInitViewingDirection() {return initViewPos;}
//! Sets the initial direction of view to the current altitude and a
zimuth.
//! Note: Updates the configuration file.
void setInitViewDirectionToCurrent();
//! Return the current viewing direction in equatorial J2000 frame.
Vec3d getViewDirectionJ2000() const {return viewDirectionJ2000;}
void setViewDirectionJ2000(const Vec3d& v);
//! Set the maximum field of View in degrees. //! Set the maximum field of View in degrees.
void setMaxFov(double max); void setMaxFov(double max);
//! Get the maximum field of View in degrees. //! Get the maximum field of View in degrees.
double getMaxFov(void) const {return maxFov;} double getMaxFov(void) const {return maxFov;}
//! Go and zoom to the selected object. A later call to autoZoomOut will come back to the previous zoom level. //! Go and zoom to the selected object. A later call to autoZoomOut will come back to the previous zoom level.
void autoZoomIn(float moveDuration = 1.f, bool allowManualZoom = 1); void autoZoomIn(float moveDuration = 1.f, bool allowManualZoom = 1);
//! Unzoom to the previous position. //! Unzoom to the previous position.
void autoZoomOut(float moveDuration = 1.f, bool full = 0); void autoZoomOut(float moveDuration = 1.f, bool full = 0);
skipping to change at line 167 skipping to change at line 192
//! Viewing direction function : true move, false stop. //! Viewing direction function : true move, false stop.
void turnRight(bool); void turnRight(bool);
void turnLeft(bool); void turnLeft(bool);
void turnUp(bool); void turnUp(bool);
void turnDown(bool); void turnDown(bool);
void moveSlow(bool b) {flagMoveSlow=b;} void moveSlow(bool b) {flagMoveSlow=b;}
void zoomIn(bool); void zoomIn(bool);
void zoomOut(bool); void zoomOut(bool);
//! Set current mount type defining the reference frame in which hea
d movements occur.
void setMountMode(MountMode m);
//! Get current mount type defining the reference frame in which hea
d movements occur.
MountMode getMountMode(void) const {return mountMode;}
private: private:
Vec3d j2000ToMountFrame(const Vec3d& v) const;
Vec3d mountFrameToJ2000(const Vec3d& v) const;
double currentFov; // The current FOV in degree double currentFov; // The current FOV in degree
double initFov; // The FOV at startup double initFov; // The FOV at startup
double minFov; // Minimum FOV in degree double minFov; // Minimum FOV in degree
double maxFov; // Maximum FOV in degree double maxFov; // Maximum FOV in degree
void setFov(double f) void setFov(double f)
{ {
currentFov = f; currentFov = f;
if (f>maxFov) if (f>maxFov)
currentFov = maxFov; currentFov = maxFov;
if (f<minFov) if (f<minFov)
currentFov = minFov; currentFov = minFov;
} }
void changeFov(double deltaFov); void changeFov(double deltaFov);
skipping to change at line 208 skipping to change at line 241
bool flagEnableMoveAtScreenEdge; // allow mouse at edge of screen to move view bool flagEnableMoveAtScreenEdge; // allow mouse at edge of screen to move view
bool flagEnableMouseNavigation; bool flagEnableMouseNavigation;
float mouseZoomSpeed; float mouseZoomSpeed;
bool flagEnableZoomKeys; bool flagEnableZoomKeys;
bool flagEnableMoveKeys; bool flagEnableMoveKeys;
float keyMoveSpeed; // Speed of keys movement float keyMoveSpeed; // Speed of keys movement
float keyZoomSpeed; // Speed of keys zoom float keyZoomSpeed; // Speed of keys zoom
bool flagMoveSlow; bool flagMoveSlow;
// Speed factor for real life time movements, used for fast forward
when playing scripts.
float movementsSpeedFactor;
//! @internal //! @internal
//! Store data for auto-move //! Store data for auto-move
struct AutoMove struct AutoMove
{ {
Vec3d start; Vec3d start;
Vec3d aim; Vec3d aim;
float speed; float speed;
float coef; float coef;
bool localPos; // Define if the position are in equatorial // If not null, move to the object.
or altazimuthal StelObjectP targetObject;
}; };
AutoMove move; // Current auto movement AutoMove move; // Current auto movement
int flagAutoMove; // Define if automove is on or off bool flagAutoMove; // Define if automove is on or off
int zoomingMode; // 0 : undefined, 1 zooming, -1 unzooming int zoomingMode; // 0 : undefined, 1 zooming, -1 unzooming
double deltaFov,deltaAlt,deltaAz; // View movement double deltaFov,deltaAlt,deltaAz; // View movement
bool flagManualZoom; // Define whether auto zoom can go further bool flagManualZoom; // Define whether auto zoom can go further
float autoMoveDuration; // Duration of movement for the auto move to a selected objectin seconds float autoMoveDuration; // Duration of movement for the auto move to a selected objectin seconds
// Mouse control options // Mouse control options
bool isDragging, hasDragged; bool isDragging, hasDragged;
int previousX, previousY; int previousX, previousY;
skipping to change at line 246 skipping to change at line 283
double start; double start;
double aim; double aim;
float speed; float speed;
float coef; float coef;
}; };
// Automove // Automove
AutoZoom zoomMove; // Current auto movement AutoZoom zoomMove; // Current auto movement
bool flagAutoZoom; // Define if autozoom is on or off bool flagAutoZoom; // Define if autozoom is on or off
bool flagAutoZoomOutResetsDirection; bool flagAutoZoomOutResetsDirection;
// defines if view corrects for horizon, or uses equatorial coordina
tes
MountMode mountMode;
Vec3d initViewPos; // Default viewing direction
// Viewing direction in equatorial J2000 coordinates
Vec3d viewDirectionJ2000;
// Viewing direction in the mount reference frame.
Vec3d viewDirectionMountFrame;
}; };
#endif // _STELMOVEMENTMGR_HPP_ #endif // _STELMOVEMENTMGR_HPP_
 End of changes. 16 change blocks. 
11 lines changed or deleted 66 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/