21 #ifndef _STELMOVEMENTMGR_HPP_
22 #define _STELMOVEMENTMGR_HPP_
24 #include "StelModule.hpp"
25 #include "StelProjector.hpp"
33 Q_PROPERTY(
bool equatorialMount
34 READ getEquatorialMount
36 Q_PROPERTY(
bool tracking
44 enum MountMode { MountAltAzimuthal, MountEquinoxEquatorial, MountGalactic};
76 virtual bool handlePinch(qreal scale,
bool started);
85 bool getHasDragged()
const {
return hasDragged;}
93 void setViewUpVectorJ2000(
const Vec3d& up);
95 void setMovementSpeedFactor(
float s) {movementsSpeedFactor=s;}
96 float getMovementSpeedFactor()
const {
return movementsSpeedFactor;}
98 void setDragTriggerDistance(
float d) {dragTriggerDistance=d;}
120 void panView(
const double deltaAz,
const double deltaAlt);
158 void moveToJ2000(
const Vec3d& aim,
float moveDuration = 1.,
int zooming = 0);
159 void moveToObject(
const StelObjectP& target,
float moveDuration = 1.,
int zooming = 0);
164 void zoomTo(
double aimFov,
float moveDuration = 1.);
181 void setViewDirectionJ2000(
const Vec3d& v);
189 void autoZoomIn(
float moveDuration = 1.f,
bool allowManualZoom = 1);
191 void autoZoomOut(
float moveDuration = 1.f,
bool full = 0);
201 void moveSlow(
bool b) {flagMoveSlow=b;}
209 bool getEquatorialMount(
void)
const {
return mountMode == MountEquinoxEquatorial;}
211 void setDragTimeMode(
bool b) {dragTimeMode=b;}
212 bool getDragTimeMode()
const {
return dragTimeMode;}
219 double getInitConstellationIntensity()
const {
return initConstellationIntensity;}
221 void setInitConstellationIntensity(
double v) {initConstellationIntensity=v;}
224 Vec3d j2000ToMountFrame(
const Vec3d& v)
const;
225 Vec3d mountFrameToJ2000(
const Vec3d& v)
const;
231 double initConstellationIntensity;
233 void setFov(
double f)
241 changeConstellationArtIntensity();
243 void changeFov(
double deltaFov);
244 void changeConstellationArtIntensity();
246 void updateVisionVector(
double deltaTime);
247 void updateAutoZoom(
double deltaTime);
250 void dragView(
int x1,
int y1,
int x2,
int y2);
258 bool isMouseMovingHoriz;
259 bool isMouseMovingVert;
261 bool flagEnableMoveAtScreenEdge;
262 bool flagEnableMouseNavigation;
263 float mouseZoomSpeed;
265 bool flagEnableZoomKeys;
266 bool flagEnableMoveKeys;
272 float movementsSpeedFactor;
290 double deltaFov,deltaAlt,deltaAz;
293 float autoMoveDuration;
296 bool isDragging, hasDragged;
297 int previousX, previousY;
300 struct DragHistoryEntry
308 QList<DragHistoryEntry> timeDragHistory;
309 void addTimeDragPoint(
int x,
int y);
310 float beforeTimeDragTimeRate;
333 bool flagAutoZoomOutResetsDirection;
341 Vec3d viewDirectionJ2000;
343 Vec3d viewDirectionMountFrame;
345 Vec3d upVectorMountFrame;
347 float dragTriggerDistance;
350 #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.
A templatized 3d vector compatible with openGL.
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.
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...
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.