StelMovementMgr.hpp   StelMovementMgr.hpp 
skipping to change at line 28 skipping to change at line 28
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#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" #include "StelObjectType.hpp"
#include <QTimeLine> #include <QTimeLine>
#include <QTimer>
#include <QCursor> #include <QCursor>
//! @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
Q_PROPERTY(bool equatorialMount Q_PROPERTY(bool equatorialMount
READ getEquatorialMount READ getEquatorialMount
WRITE setEquatorialMount WRITE setEquatorialMount
skipping to change at line 131 skipping to change at line 132
void setMovementSpeedFactor(float s) {movementsSpeedFactor=s;} void setMovementSpeedFactor(float s) {movementsSpeedFactor=s;}
float getMovementSpeedFactor() const {return movementsSpeedFactor;} float getMovementSpeedFactor() const {return movementsSpeedFactor;}
void setDragTriggerDistance(float d) {dragTriggerDistance=d;} void setDragTriggerDistance(float d) {dragTriggerDistance=d;}
public slots: public slots:
//! Toggle current mount mode between equatorial and altazimuthal //! Toggle current mount mode between equatorial and altazimuthal
void toggleMountMode() {if (getMountMode()==MountAltAzimuthal) setMo untMode(MountEquinoxEquatorial); else setMountMode(MountAltAzimuthal);} void toggleMountMode() {if (getMountMode()==MountAltAzimuthal) setMo untMode(MountEquinoxEquatorial); else setMountMode(MountAltAzimuthal);}
//! Define whether we should use equatorial mount or altazimuthal //! Define whether we should use equatorial mount or altazimuthal
void setEquatorialMount(bool b) {setMountMode(b ? MountEquinoxEquato rial : MountAltAzimuthal);} void setEquatorialMount(bool b);
//! 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); 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;}
skipping to change at line 181 skipping to change at line 182
//! 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;}
//! Get the state of flag for indication of mount mode
bool getFlagIndicationMountMode() const {return flagIndicationMountM
ode;}
//! Set the state of flag for indication of mount mode
void setFlagIndicationMountMode(bool b) { flagIndicationMountMode=b;
}
//! Move the view to a specified J2000 position. //! Move the view to a specified J2000 position.
//! @param aim The position to move to expressed as a vector. //! @param aim The position to move to expressed as a vector.
//! @param aimUp Up vector. Can be usually (0/0/1) but may have to b e exact for looking into the zenith/pole //! @param aimUp Up vector. Can be usually (0/0/1) but may have to b e exact for looking into the zenith/pole
//! @param moveDuration The time it takes for the move to complete. //! @param moveDuration The time it takes for the move to complete.
//! @param zooming you want to zoom in, out or not (just center). //! @param zooming you want to zoom in, out or not (just center).
//! @code //! @code
//! // You can use the following code most of the times to find a va lid aimUp vector: //! // You can use the following code most of the times to find a va lid aimUp vector:
//! StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr); //! StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr);
//! mvmgr->moveToJ2000(pos, mvmgr->mountFrameToJ2000(Vec3d(0., 0., 1 .)), mvmgr->getAutoMoveDuration()); //! mvmgr->moveToJ2000(pos, mvmgr->mountFrameToJ2000(Vec3d(0., 0., 1 .)), mvmgr->getAutoMoveDuration());
//! @endcode //! @endcode
skipping to change at line 226 skipping to change at line 232
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 //! Return the inital viewing direction in altazimuthal coordinates
const Vec3d getInitViewingDirection() {return initViewPos;} const Vec3d getInitViewingDirection() {return initViewPos;}
//! Sets the initial direction of view to the current altitude and a zimuth. //! Sets the initial direction of view to the current altitude and a zimuth.
//! Note: Updates the configuration file. //! Note: Updates the configuration file.
void setInitViewDirectionToCurrent(); void setInitViewDirectionToCurrent();
//! Return the current viewing direction in equatorial J2000 frame. //! Return the current viewing direction in the equatorial J2000 fra me.
Vec3d getViewDirectionJ2000() const {return viewDirectionJ2000;} Vec3d getViewDirectionJ2000() const {return viewDirectionJ2000;}
//! Set the current viewing direction in the equatorial J2000 frame.
void setViewDirectionJ2000(const Vec3d& v); 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;}
//! Get the minimum field of View in degrees. //! Get the minimum field of View in degrees.
double getMinFov(void) const {return minFov;} double getMinFov(void) const {return minFov;}
skipping to change at line 318 skipping to change at line 325
void viewportHorizontalOffsetTargetChanged(float f); void viewportHorizontalOffsetTargetChanged(float f);
void viewportVerticalOffsetTargetChanged(float f); void viewportVerticalOffsetTargetChanged(float f);
private slots: private slots:
//! Called when the selected object changes. //! Called when the selected object changes.
void selectedObjectChange(StelModule::StelModuleSelectAction action) ; void selectedObjectChange(StelModule::StelModuleSelectAction action) ;
//! Connected to the viewportOffsetTimeLine, does the actual viewpor t shift. //! Connected to the viewportOffsetTimeLine, does the actual viewpor t shift.
void handleViewportOffsetMovement(qreal value); void handleViewportOffsetMovement(qreal value);
//! Display a message on the screen for a few seconds.
void displayMessage(const QString& message, const QString hexColor="
#99FF99");
//! Hide all messages.
void hideMessages();
public: public:
Vec3d j2000ToMountFrame(const Vec3d& v) const; Vec3d j2000ToMountFrame(const Vec3d& v) const;
Vec3d mountFrameToJ2000(const Vec3d& v) const; Vec3d mountFrameToJ2000(const Vec3d& v) const;
private: private:
double currentFov; // The current FOV in degrees double currentFov; // The current FOV in degrees
double initFov; // The FOV at startup double initFov; // The FOV at startup
double minFov; // Minimum FOV in degrees double minFov; // Minimum FOV in degrees
double maxFov; // Maximum FOV in degrees double maxFov; // Maximum FOV in degrees
double deltaFov; // requested change of FOV (degrees) used during zooming. double deltaFov; // requested change of FOV (degrees) used during zooming.
void setFov(double f) void setFov(double f)
{ {
currentFov=qMax(minFov, qMin(f, maxFov)); currentFov=qBound(minFov, f, maxFov);
} }
// immediately add deltaFov argument to FOV - does not change privat e var. // immediately add deltaFov argument to FOV - does not change privat e var.
void changeFov(double deltaFov); void changeFov(double deltaFov);
// Move (a bit) to selected/tracked object until move.coef reaches 1 , or auto-follow (track) selected object. // Move (a bit) to selected/tracked object until move.coef reaches 1 , or auto-follow (track) selected object.
// Does nothing if flagInhibitAllAutomoves=true // Does nothing if flagInhibitAllAutomoves=true
void updateVisionVector(double deltaTime); void updateVisionVector(double deltaTime);
void updateAutoZoom(double deltaTime); // Update autoZoom if activat ed void updateAutoZoom(double deltaTime); // Update autoZoom if activat ed
//! Make the first screen position correspond to the second (useful for mouse dragging and also time dragging.) //! Make the first screen position correspond to the second (useful for mouse dragging and also time dragging.)
skipping to change at line 458 skipping to change at line 470
// TODO: Docfix? // TODO: Docfix?
float dragTriggerDistance; float dragTriggerDistance;
// Viewport shifting. This animates a property belonging to StelCore . But the shift itself is likely best placed here. // Viewport shifting. This animates a property belonging to StelCore . But the shift itself is likely best placed here.
QTimeLine *viewportOffsetTimeline; QTimeLine *viewportOffsetTimeline;
// Those two are used during viewport offset animation transitions. Both are set by moveViewport(), and irrelevant after the transition. // Those two are used during viewport offset animation transitions. Both are set by moveViewport(), and irrelevant after the transition.
Vec2f oldViewportOffset; Vec2f oldViewportOffset;
Vec2f targetViewportOffset; Vec2f targetViewportOffset;
bool flagIndicationMountMode; // state of mount mode
//! @name Screen message infrastructure
//@{
QTimer* messageTimer;
QList<int> messageIDs;
//@}
}; };
#endif // _STELMOVEMENTMGR_HPP_ #endif // _STELMOVEMENTMGR_HPP_
 End of changes. 8 change blocks. 
3 lines changed or deleted 26 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/