21 #ifndef _STELMOVEMENTMGR_HPP_ 22 #define _STELMOVEMENTMGR_HPP_ 24 #include "StelModule.hpp" 25 #include "StelProjector.hpp" 36 Q_PROPERTY(
bool equatorialMount
37 READ getEquatorialMount
39 NOTIFY equatorialMountChanged)
40 Q_PROPERTY(
bool tracking
46 Q_PROPERTY(
float viewportHorizontalOffsetTarget
47 READ getViewportHorizontalOffsetTarget
48 WRITE setViewportHorizontalOffsetTarget
49 NOTIFY viewportHorizontalOffsetTargetChanged)
50 Q_PROPERTY(
float viewportVerticalOffsetTarget
51 READ getViewportVerticalOffsetTarget
52 WRITE setViewportVerticalOffsetTarget
53 NOTIFY viewportVerticalOffsetTargetChanged)
55 Q_PROPERTY(
bool flagAutoZoomOutResetsDirection
58 NOTIFY flagAutoZoomOutResetsDirectionChanged)
64 enum MountMode { MountAltAzimuthal, MountEquinoxEquatorial, MountGalactic, MountSupergalactic};
88 addTimeDragPoint(QCursor::pos().x(), QCursor::pos().y());
103 virtual bool handlePinch(qreal scale,
bool started);
118 void setViewUpVectorJ2000(
const Vec3d& up);
121 void setViewUpVector(
const Vec3d& up);
123 void setMovementSpeedFactor(
float s) {movementsSpeedFactor=s;}
124 float getMovementSpeedFactor()
const {
return movementsSpeedFactor;}
126 void setDragTriggerDistance(
float d) {dragTriggerDistance=d;}
148 void panView(
const double deltaAz,
const double deltaAlt);
217 void zoomTo(
double aimFov,
float moveDuration = 1.);
246 void autoZoomIn(
float moveDuration = 1.f,
bool allowManualZoom = 1);
248 void autoZoomOut(
float moveDuration = 1.f,
bool full = 0);
258 void moveSlow(
bool b) {flagMoveSlow=b;}
288 void moveViewport(
float offsetX,
float offsetY,
const float duration=0.f);
294 bool getEquatorialMount(
void)
const {
return mountMode == MountEquinoxEquatorial;}
302 float getViewportHorizontalOffsetTarget()
const {
return targetViewportOffset[0]; }
303 float getViewportVerticalOffsetTarget()
const {
return targetViewportOffset[1]; }
305 void setViewportHorizontalOffsetTarget(
float f) {
moveViewport(f,getViewportVerticalOffsetTarget()); }
306 void setViewportVerticalOffsetTarget(
float f) {
moveViewport(getViewportHorizontalOffsetTarget(),f); }
311 void equatorialMountChanged(
bool b);
313 void flagAutoZoomOutResetsDirectionChanged(
bool b);
315 void viewportHorizontalOffsetTargetChanged(
float f);
316 void viewportVerticalOffsetTargetChanged(
float f);
323 void handleViewportOffsetMovement(qreal value);
326 void displayMessage(
const QString& message,
const QString hexColor=
"#99FF99");
331 Vec3d j2000ToMountFrame(
const Vec3d& v)
const;
332 Vec3d mountFrameToJ2000(
const Vec3d& v)
const;
340 void setFov(
double f)
342 currentFov=qBound(minFov, f, maxFov);
345 void changeFov(
double deltaFov);
349 void updateVisionVector(
double deltaTime);
350 void updateAutoZoom(
double deltaTime);
353 void dragView(
int x1,
int y1,
int x2,
int y2);
359 bool flagInhibitAllAutomoves;
362 bool isMouseMovingHoriz;
363 bool isMouseMovingVert;
365 bool flagEnableMoveAtScreenEdge;
366 bool flagEnableMouseNavigation;
367 float mouseZoomSpeed;
369 bool flagEnableZoomKeys;
370 bool flagEnableMoveKeys;
376 float movementsSpeedFactor;
402 double deltaAlt,deltaAz;
405 float autoMoveDuration;
408 bool isDragging, hasDragged;
409 int previousX, previousY;
412 struct DragHistoryEntry
419 QList<DragHistoryEntry> timeDragHistory;
420 void addTimeDragPoint(
int x,
int y);
421 float beforeTimeDragTimeRate;
444 bool flagAutoZoomOutResetsDirection;
453 Vec3d viewDirectionJ2000;
455 Vec3d viewDirectionMountFrame;
459 Vec3d upVectorMountFrame;
462 float dragTriggerDistance;
465 QTimeLine *viewportOffsetTimeline;
467 Vec2f oldViewportOffset;
468 Vec2f targetViewportOffset;
470 bool flagIndicationMountMode;
474 QTimer* messageTimer;
475 QList<int> messageIDs;
480 #endif // _STELMOVEMENTMGR_HPP_ void setInitFov(double fov)
Set the initial Field Of View in degree.
bool getFlagLockEquPos(void) const
Get whether sky position is locked.
void flagTrackingChanged(bool b)
Emitted when the tracking property changes.
virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b)
Handle mouse movement events.
void setInhibitAllAutomoves(bool inhibit)
Function designed only for scripting context.
bool getFlagAutoZoomOutResetsDirection(void)
Get whether auto zoom out will reset the viewing direction to the inital value.
void setFlagEnableZoomKeys(bool b)
Set whether keys can control zoom.
bool getFlagEnableMoveKeys() const
Get whether keys can control movement.
double getMinFov(void) const
Get the minimum field of View in degrees.
void lookEast(bool zero=false)
Look immediately towards East.
void lookTowardsSCP(void)
Look immediately towards South Celestial pole.
void panView(const double deltaAz, const double deltaAlt)
Move view in alt/az (or equatorial if in that mode) coordinates.
void setFlagLockEquPos(bool b)
Set whether sky position is to be locked.
MountMode getMountMode(void) const
Get current mount type defining the reference frame in which head movements occur.
Vec3d getViewUpVectorJ2000() const
Return the current up view vector in J2000 coordinates.
bool getFlagIndicationMountMode() const
Get the state of flag for indication of mount mode.
Main class for Stellarium core processing.
void lookNorth(bool zero=false)
Look immediately towards North.
virtual double getCallOrder(StelModuleActionName actionName) const
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
bool getFlagEnableMoveAtScreenEdge() const
Get whether being at the edge of the screen activates movement.
void moveToJ2000(const Vec3d &aim, const Vec3d &aimUp, float moveDuration=1., ZoomingMode zooming=ZoomNone)
Move the view to a specified J2000 position.
void setFlagTracking(bool b=true)
Set object tracking on/off and go to selected object.
void setMountMode(MountMode m)
Set current mount type defining the reference frame in which head movements occur.
float getAutoMoveDuration(void) const
Get automove duration in seconds.
void lookNadir(void)
Look immediately towards Nadir, turning southern horizon to screen top.
void autoZoomIn(float moveDuration=1.f, bool allowManualZoom=1)
Go and zoom to the selected object. A later call to autoZoomOut will come back to the previous zoom l...
double getCurrentFov() const
Get the current Field Of View in degrees.
const Vec3d getInitViewingDirection()
Return the inital viewing direction in altazimuthal coordinates.
void turnRight(bool)
Viewing direction function : true move, false stop.
void setFlagEnableMouseNavigation(bool b)
Set whether mouse can control movement.
Manages the head movements and zoom operations.
void setInitViewDirectionToCurrent()
Sets the initial direction of view to the current altitude and azimuth.
void toggleMountMode()
Toggle current mount mode between equatorial and altazimuthal.
void setFlagIndicationMountMode(bool b)
Set the state of flag for indication of mount mode.
Define the StelObjectP type.
double getAimFov(void) const
If currently zooming, return the target FOV, otherwise return current FOV in degree.
virtual void draw(StelCore *)
Implement required draw function. Does nothing.
virtual void handleKeys(QKeyEvent *event)
Handle keyboard events.
void lookWest(bool zero=false)
Look immediately towards West.
bool getFlagEnableMouseNavigation() const
Get whether mouse can control movement.
double getMaxFov(void) const
Get the maximum field of View in degrees.
virtual void init()
Initializes the object based on the application settings Includes:
double getZoomSpeed()
Get the zoom speed.
void lookTowardsNCP(void)
Look immediately towards North Celestial pole.
void setFlagEnableMoveAtScreenEdge(bool b)
Set whether being at the edge of the screen activates movement.
void lookSouth(bool zero=false)
Look immediately towards South.
Vec3d getViewDirectionJ2000() const
Return the current viewing direction in the equatorial J2000 frame.
void updateMotion(double deltaTime)
Increment/decrement smoothly the vision field and position. Called in StelCore.update().
Manage the selection and queries on one or more StelObjects.
StelModuleActionName
Define the possible action for which an order is defined.
MountMode
Possible mount modes defining the reference frame in which head movements occur.
bool getFlagTracking(void) const
Get current object tracking status.
void setFlagEnableMoveKeys(bool b)
Set whether keys can control movement.
void lookZenith(void)
Look immediately towards Zenith, turning southern horizon to screen bottom.
void zoomTo(double aimFov, float moveDuration=1.)
Change the zoom level.
void setAutoMoveDuration(float f)
Set automove duration in seconds.
virtual void update(double)
Update time-dependent things (triggers a time dragging record if required)
StelModuleSelectAction
Enum used when selecting objects to define whether to add to, replace, or remove from the existing se...
void moveViewport(float offsetX, float offsetY, const float duration=0.f)
start animated move of the viewport offset.
virtual void handleMouseWheel(class QWheelEvent *event)
Handle mouse wheel events.
void setFlagAutoZoomOutResetsDirection(bool b)
Set whether auto zoom out will reset the viewing direction to the inital value.
ZoomingMode
Named constants for zoom operations.
void setViewDirectionJ2000(const Vec3d &v)
Set the current viewing direction in the equatorial J2000 frame.
virtual bool handlePinch(qreal scale, bool started)
Handle pinch gesture.
void setEquatorialMount(bool b)
Define whether we should use equatorial mount or altazimuthal.
void autoZoomOut(float moveDuration=1.f, bool full=0)
Unzoom to the previous position.
Vec2f getViewportOffsetTarget() const
Returns the targetted value of the viewport offset.
This is the common base class for all the main components of stellarium.
virtual void handleMouseClicks(class QMouseEvent *event)
Handle mouse click events.
void moveToAltAzi(const Vec3d &aim, const Vec3d &aimUp, float moveDuration=1., ZoomingMode zooming=ZoomNone)
Move the view to a specified AltAzimuthal position.
bool getFlagEnableZoomKeys() const
Get whether keys can control zoom.
void setMaxFov(double max)
Set the maximum field of View in degrees.
double getInitFov() const
Return the initial default FOV in degree.