20 #ifndef _STELMOVEMENTMGR_HPP_
21 #define _STELMOVEMENTMGR_HPP_
23 #include "StelModule.hpp"
24 #include "StelProjector.hpp"
32 Q_PROPERTY(
bool equatorialMount
33 READ getEquatorialMount
35 Q_PROPERTY(
bool tracking
41 enum MountMode { MountAltAzimuthal, MountEquinoxEquatorial, MountGalactic};
73 virtual bool handlePinch(qreal scale,
bool started);
82 bool getHasDragged()
const {
return hasDragged;}
90 void setViewUpVectorJ2000(
const Vec3d& up);
92 void setMovementSpeedFactor(
float s) {movementsSpeedFactor=s;}
93 float getMovementSpeedFactor()
const {
return movementsSpeedFactor;}
95 void setDragTriggerDistance(
float d) {dragTriggerDistance=d;}
117 void panView(
double deltaAz,
double deltaAlt);
155 void moveToJ2000(
const Vec3d& aim,
float moveDuration = 1.,
int zooming = 0);
156 void moveToObject(
const StelObjectP& target,
float moveDuration = 1.,
int zooming = 0);
161 void zoomTo(
double aimFov,
float moveDuration = 1.);
178 void setViewDirectionJ2000(
const Vec3d& v);
186 void autoZoomIn(
float moveDuration = 1.f,
bool allowManualZoom = 1);
188 void autoZoomOut(
float moveDuration = 1.f,
bool full = 0);
198 void moveSlow(
bool b) {flagMoveSlow=b;}
206 bool getEquatorialMount(
void)
const {
return mountMode == MountEquinoxEquatorial;}
208 void setDragTimeMode(
bool b) {dragTimeMode=b;}
209 bool getDragTimeMode()
const {
return dragTimeMode;}
216 double getInitConstellationIntensity()
const {
return initConstellationIntensity;}
218 void setInitConstellationIntensity(
double v) {initConstellationIntensity=v;}
221 Vec3d j2000ToMountFrame(
const Vec3d& v)
const;
222 Vec3d mountFrameToJ2000(
const Vec3d& v)
const;
228 double initConstellationIntensity;
230 void setFov(
double f)
238 changeConstellationArtIntensity();
240 void changeFov(
double deltaFov);
241 void changeConstellationArtIntensity();
243 void updateVisionVector(
double deltaTime);
244 void updateAutoZoom(
double deltaTime);
247 void dragView(
int x1,
int y1,
int x2,
int y2);
255 bool isMouseMovingHoriz;
256 bool isMouseMovingVert;
258 bool flagEnableMoveAtScreenEdge;
259 bool flagEnableMouseNavigation;
260 float mouseZoomSpeed;
262 bool flagEnableZoomKeys;
263 bool flagEnableMoveKeys;
269 float movementsSpeedFactor;
287 double deltaFov,deltaAlt,deltaAz;
290 float autoMoveDuration;
293 bool isDragging, hasDragged;
294 int previousX, previousY;
297 struct DragHistoryEntry
305 QList<DragHistoryEntry> timeDragHistory;
306 void addTimeDragPoint(
int x,
int y);
307 float beforeTimeDragTimeRate;
325 bool flagAutoZoomOutResetsDirection;
333 Vec3d viewDirectionJ2000;
335 Vec3d viewDirectionMountFrame;
337 Vec3d upVectorMountFrame;
339 float dragTriggerDistance;
342 #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.
virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b)
Handle mouse movement events.
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.
void setFlagLockEquPos(bool b)
Set whether sky position is to be locked.
void panView(double deltaAz, double deltaAlt)
Move view in alt/az (or equatorial if in that mode) coordinates.
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.
Main class for Stellarium core processing.
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 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 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.
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.
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 setFlagEnableMoveAtScreenEdge(bool b)
Set whether being at the edge of the screen activates movement.
Vec3d getViewDirectionJ2000() const
Return the current viewing direction in equatorial J2000 frame.
void updateMotion(double deltaTime)
Increment/decrement smoothly the vision field and position.
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 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 (does nothing).
StelModuleSelectAction
Enum used when selecting objects to define whether to add to, replace, or remove from the existing se...
A templatized 3d vector compatible with openGL.
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.
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.
const Vec3d & getInitViewingDirection()
Return the inital viewing direction in altazimuthal coordinates.
This is the common base class for all the main components of stellarium.
virtual void handleMouseClicks(class QMouseEvent *event)
Handle mouse click events.
void moveToJ2000(const Vec3d &aim, float moveDuration=1., int zooming=0)
Move the view to a specified J2000 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.