21 #ifndef _STELMOVEMENTMGR_HPP_ 22 #define _STELMOVEMENTMGR_HPP_ 24 #include "StelModule.hpp" 25 #include "StelProjector.hpp" 35 Q_PROPERTY(
bool equatorialMount
36 READ getEquatorialMount
38 NOTIFY equatorialMountChanged)
39 Q_PROPERTY(
bool tracking
45 Q_PROPERTY(
float viewportHorizontalOffsetTarget
46 READ getViewportHorizontalOffsetTarget
47 WRITE setViewportHorizontalOffsetTarget
48 NOTIFY viewportHorizontalOffsetTargetChanged)
49 Q_PROPERTY(
float viewportVerticalOffsetTarget
50 READ getViewportVerticalOffsetTarget
51 WRITE setViewportVerticalOffsetTarget
52 NOTIFY viewportVerticalOffsetTargetChanged)
54 Q_PROPERTY(
bool flagAutoZoomOutResetsDirection
57 NOTIFY flagAutoZoomOutResetsDirectionChanged)
63 enum MountMode { MountAltAzimuthal, MountEquinoxEquatorial, MountGalactic, MountSupergalactic};
87 addTimeDragPoint(QCursor::pos().x(), QCursor::pos().y());
102 virtual bool handlePinch(qreal scale,
bool started);
117 void setViewUpVectorJ2000(
const Vec3d& up);
120 void setViewUpVector(
const Vec3d& up);
122 void setMovementSpeedFactor(
float s) {movementsSpeedFactor=s;}
123 float getMovementSpeedFactor()
const {
return movementsSpeedFactor;}
125 void setDragTriggerDistance(
float d) {dragTriggerDistance=d;}
147 void panView(
const double deltaAz,
const double deltaAlt);
211 void zoomTo(
double aimFov,
float moveDuration = 1.);
228 void setViewDirectionJ2000(
const Vec3d& v);
239 void autoZoomIn(
float moveDuration = 1.f,
bool allowManualZoom = 1);
241 void autoZoomOut(
float moveDuration = 1.f,
bool full = 0);
251 void moveSlow(
bool b) {flagMoveSlow=b;}
281 void moveViewport(
float offsetX,
float offsetY,
const float duration=0.f);
287 bool getEquatorialMount(
void)
const {
return mountMode == MountEquinoxEquatorial;}
295 float getViewportHorizontalOffsetTarget()
const {
return targetViewportOffset[0]; }
296 float getViewportVerticalOffsetTarget()
const {
return targetViewportOffset[1]; }
298 void setViewportHorizontalOffsetTarget(
float f) {
moveViewport(f,getViewportVerticalOffsetTarget()); }
299 void setViewportVerticalOffsetTarget(
float f) {
moveViewport(getViewportHorizontalOffsetTarget(),f); }
304 void equatorialMountChanged(
bool b);
306 void flagAutoZoomOutResetsDirectionChanged(
bool b);
308 void viewportHorizontalOffsetTargetChanged(
float f);
309 void viewportVerticalOffsetTargetChanged(
float f);
316 void handleViewportOffsetMovement(qreal value);
319 Vec3d j2000ToMountFrame(
const Vec3d& v)
const;
320 Vec3d mountFrameToJ2000(
const Vec3d& v)
const;
328 void setFov(
double f)
330 currentFov=qMax(minFov, qMin(f, maxFov));
333 void changeFov(
double deltaFov);
337 void updateVisionVector(
double deltaTime);
338 void updateAutoZoom(
double deltaTime);
341 void dragView(
int x1,
int y1,
int x2,
int y2);
347 bool flagInhibitAllAutomoves;
350 bool isMouseMovingHoriz;
351 bool isMouseMovingVert;
353 bool flagEnableMoveAtScreenEdge;
354 bool flagEnableMouseNavigation;
355 float mouseZoomSpeed;
357 bool flagEnableZoomKeys;
358 bool flagEnableMoveKeys;
364 float movementsSpeedFactor;
390 double deltaAlt,deltaAz;
393 float autoMoveDuration;
396 bool isDragging, hasDragged;
397 int previousX, previousY;
400 struct DragHistoryEntry
407 QList<DragHistoryEntry> timeDragHistory;
408 void addTimeDragPoint(
int x,
int y);
409 float beforeTimeDragTimeRate;
432 bool flagAutoZoomOutResetsDirection;
441 Vec3d viewDirectionJ2000;
443 Vec3d viewDirectionMountFrame;
447 Vec3d upVectorMountFrame;
450 float dragTriggerDistance;
453 QTimeLine *viewportOffsetTimeline;
455 Vec2f oldViewportOffset;
456 Vec2f targetViewportOffset;
460 #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.
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.
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 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.
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.