StelCore.hpp   StelCore.hpp 
/* /*
* Copyright (C) 2003 Fabien Chereau * Copyright (C) 2003 Fabien Chereau
* Copyright (C) 2012 Matthew Gates * Copyright (C) 2012 Matthew Gates
* Copyright (C) 2015 Georg Zotti (Precession fixes)
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 30 skipping to change at line 31
#ifndef _STELCORE_HPP_ #ifndef _STELCORE_HPP_
#define _STELCORE_HPP_ #define _STELCORE_HPP_
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelProjectorType.hpp" #include "StelProjectorType.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QTime> #include <QTime>
#include <QPair>
class StelToneReproducer; class StelToneReproducer;
class StelSkyDrawer; class StelSkyDrawer;
class StelGeodesicGrid; class StelGeodesicGrid;
class StelMovementMgr; class StelMovementMgr;
class StelObserver; class StelObserver;
//! @class StelCore //! @class StelCore
//! Main class for Stellarium core processing. //! Main class for Stellarium core processing.
//! This class provides services like management of sky projections, //! This class provides services like management of sky projections,
//! tone conversion, or reference frame conversion. It is used by the //! tone conversion, or reference frame conversion. It is used by the
//! various StelModules to update and display themself. //! various StelModules to update and display themselves.
//! There is currently only one StelCore instance in Stellarium, but //! There is currently only one StelCore instance in Stellarium, but
//! in the future they may be more, allowing for example to display //! in the future they may be more, allowing for example to display
//! several independent views of the sky at the same time. //! several independent views of the sky at the same time.
//! @author Fabien Chereau //! @author Fabien Chereau, Matthew Gates, Georg Zotti
class StelCore : public QObject class StelCore : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_ENUMS(ProjectionType) Q_ENUMS(ProjectionType)
Q_ENUMS(DeltaTAlgorithm) Q_ENUMS(DeltaTAlgorithm)
Q_PROPERTY(bool flipHorz READ getFlipHorz WRITE setFlipHorz) Q_PROPERTY(bool flipHorz READ getFlipHorz WRITE setFlipHorz)
Q_PROPERTY(bool flipVert READ getFlipVert WRITE setFlipVert) Q_PROPERTY(bool flipVert READ getFlipVert WRITE setFlipVert)
Q_PROPERTY(bool flagUseNutation READ getUseNutation WRITE setUseNuta
tion)
Q_PROPERTY(bool flagUseTopocentricCoordinates READ getUseTopocentric
Coordinates WRITE setUseTopocentricCoordinates)
public: public:
//! @enum FrameType //! @enum FrameType
//! Supported reference frame types //! Supported reference frame types
enum FrameType enum FrameType
{ {
FrameUninitialized, //!< Reference frame is not FrameUninitialized, //!< Reference frame
set (FMajerech: Added to avoid condition on uninitialized value in StelSkyL is not set (FMajerech: Added to avoid condition on uninitialized value in
ayerMgr::draw()) StelSkyLayerMgr::draw())
FrameAltAz, //!< Altazimuthal reference FrameAltAz, //!< Altazimuthal re
frame centered on observer. ference frame centered on observer.
FrameHeliocentricEcliptic, //!< Ecliptic reference fram FrameHeliocentricEclipticJ2000, //!< Fixed-ecliptic
e centered on the Sun reference frame centered on the Sun. GZ: This is J2000 ecliptical / almost
FrameObservercentricEcliptic, //!< Ecliptic reference fram VSOP87.
e centered on the Observer FrameObservercentricEclipticJ2000, //!< Fixed-ecliptic
FrameEquinoxEqu, //!< Equatorial reference fr reference frame centered on the Observer. GZ: was ObservercentricEcliptic,
ame at the current equinox centered on the observer. but renamed because it is Ecliptic of J2000!
//! The north pole follows t FrameObservercentricEclipticOfDate, //!< Moving ecliptic
he precession of the planet on which the observer is located. reference frame centered on the Observer. GZ new for V0.14: Ecliptic of da
FrameJ2000, //!< Equatorial reference fr te, i.e. includes the precession of the ecliptic.
ame at the J2000 equinox centered on the observer. FrameEquinoxEqu, //!< Equatorial refe
//! This is also the ICRS re rence frame at the current equinox centered on the observer.
ference frame. //!< The north pole
FrameGalactic //! Galactic reference frame follows the precession of the planet on which the observer is located. On E
centered on observer. arth, this may include nutation if so configured.
//!< Has been correc
ted for V0.14 to really properly reflect ecliptical motion and precession (
Vondrak 2011 model) and nutation.
FrameJ2000, //!< Equatorial refe
rence frame at the J2000 equinox centered on the observer.
//!< This is also th
e ICRS reference frame.
FrameGalactic //!< Galactic refere
nce frame centered on observer.
}; };
//! @enum ProjectionType //! @enum ProjectionType
//! Available projection types. A value of 1000 indicate the default projection //! Available projection types. A value of 1000 indicate the default projection
enum ProjectionType enum ProjectionType
{ {
ProjectionPerspective, //!< Perspective projection ProjectionPerspective, //!< Perspective projection
ProjectionEqualArea, //!< Equal Area projection ProjectionEqualArea, //!< Equal Area projection
ProjectionStereographic, //!< Stereograhic projection ProjectionStereographic, //!< Stereograhic projection
ProjectionFisheye, //!< Fisheye projection ProjectionFisheye, //!< Fisheye projection
ProjectionHammer, //!< Hammer-Aitoff projectio n ProjectionHammer, //!< Hammer-Aitoff projectio n
ProjectionCylinder, //!< Cylinder projection ProjectionCylinder, //!< Cylinder projection
ProjectionMercator, //!< Mercator projection ProjectionMercator, //!< Mercator projection
ProjectionOrthographic //!< Orthographic projection ProjectionOrthographic, //!< Orthographic projection
ProjectionSinusoidal //!< Sinusoidal projection
}; };
//! @enum RefractionMode //! @enum RefractionMode
//! Available refraction mode. //! Available refraction mode.
enum RefractionMode enum RefractionMode
{ {
RefractionAuto, //!< Automatically decide to add refraction if atmosphere is activated RefractionAuto, //!< Automatically decide to add refraction if atmosphere is activated
RefractionOn, //!< Always add refraction ( i.e. apparent coordinates) RefractionOn, //!< Always add refraction ( i.e. apparent coordinates)
RefractionOff //!< Never add refraction (i .e. geometric coordinates) RefractionOff //!< Never add refraction (i .e. geometric coordinates)
}; };
skipping to change at line 123 skipping to change at line 130
StephensonMorrison1995, //!< Stephenson & Morrison ( 1995) algorithm for DeltaT StephensonMorrison1995, //!< Stephenson & Morrison ( 1995) algorithm for DeltaT
Stephenson1997, //!< Stephenson (1997) algor ithm for DeltaT Stephenson1997, //!< Stephenson (1997) algor ithm for DeltaT
ChaprontMeeus, //!< Chapront, Chapront-Touz e & Francou (1997) & Meeus (1998) algorithm for DeltaT ChaprontMeeus, //!< Chapront, Chapront-Touz e & Francou (1997) & Meeus (1998) algorithm for DeltaT
JPLHorizons, //!< JPL Horizons algorithm for DeltaT JPLHorizons, //!< JPL Horizons algorithm for DeltaT
MeeusSimons, //!< Meeus & Simons (2000) a lgorithm for DeltaT MeeusSimons, //!< Meeus & Simons (2000) a lgorithm for DeltaT
MontenbruckPfleger, //!< Montenbruck & Pfleger ( 2000) algorithm for DeltaT MontenbruckPfleger, //!< Montenbruck & Pfleger ( 2000) algorithm for DeltaT
ReingoldDershowitz, //!< Reingold & Dershowitz ( 2002, 2007) algorithm for DeltaT ReingoldDershowitz, //!< Reingold & Dershowitz ( 2002, 2007) algorithm for DeltaT
MorrisonStephenson2004, //!< Morrison & Stephenson ( 2004, 2005) algorithm for DeltaT MorrisonStephenson2004, //!< Morrison & Stephenson ( 2004, 2005) algorithm for DeltaT
Reijs, //!< Reijs (2006) algorithm for DeltaT Reijs, //!< Reijs (2006) algorithm for DeltaT
EspenakMeeus, //!< Espenak & Meeus (2006) algorithm for DeltaT (Recommended, default) EspenakMeeus, //!< Espenak & Meeus (2006) algorithm for DeltaT (Recommended, default)
EspenakMeeusZeroMoonAccel, // Espenak & Meeus (2006) algorithm for DeltaT (but without additional Lunar acceleration. FOR TESTIN G ONLY, NONPUBLIC)
Banjevic, //!< Banjevic (2006) algorit hm for DeltaT Banjevic, //!< Banjevic (2006) algorit hm for DeltaT
IslamSadiqQureshi, //!< Islam, Sadiq & Qureshi (2008 + revisited 2013) algorithm for DeltaT (6 polynomials) IslamSadiqQureshi, //!< Islam, Sadiq & Qureshi (2008 + revisited 2013) algorithm for DeltaT (6 polynomials)
KhalidSultanaZaidi, //!< M. Khalid, Mariam Sulta na and Faheem Zaidi polinomial approximation of time period 1620-2013 (2014 ) KhalidSultanaZaidi, //!< M. Khalid, Mariam Sulta na and Faheem Zaidi polinomial approximation of time period 1620-2013 (2014 )
Custom //!< User defined coefficien ts for quadratic equation for DeltaT Custom //!< User defined coefficien ts for quadratic equation for DeltaT
}; };
StelCore(); StelCore();
virtual ~StelCore(); virtual ~StelCore();
//! Init and load all main core components. //! Init and load all main core components.
skipping to change at line 152 skipping to change at line 160
//! Update core state before drawing modules. //! Update core state before drawing modules.
void preDraw(); void preDraw();
//! Update core state after drawing modules. //! Update core state after drawing modules.
void postDraw(); void postDraw();
//! Get a new instance of a simple 2d projection. This projection ca nnot be used to project or unproject but //! Get a new instance of a simple 2d projection. This projection ca nnot be used to project or unproject but
//! only for 2d painting //! only for 2d painting
StelProjectorP getProjection2d() const; StelProjectorP getProjection2d() const;
//! Get a new instance of projector using a modelview transformation corresponding to the the given frame. //! Get a new instance of projector using a modelview transformation corresponding to the given frame.
//! If not specified the refraction effect is included if atmosphere is on. //! If not specified the refraction effect is included if atmosphere is on.
StelProjectorP getProjection(FrameType frameType, RefractionMode ref ractionMode=RefractionAuto) const; StelProjectorP getProjection(FrameType frameType, RefractionMode ref ractionMode=RefractionAuto) const;
//! Get a new instance of projector using the given modelview transf ormatione. //! Get a new instance of projector using the given modelview transf ormation.
//! If not specified the projection used is the one currently used a s default. //! If not specified the projection used is the one currently used a s default.
StelProjectorP getProjection(StelProjector::ModelViewTranformP model ViewTransform, ProjectionType projType=(ProjectionType)1000) const; StelProjectorP getProjection(StelProjector::ModelViewTranformP model ViewTransform, ProjectionType projType=(ProjectionType)1000) const;
//! Get the current tone reproducer used in the core. //! Get the current tone reproducer used in the core.
StelToneReproducer* getToneReproducer(); StelToneReproducer* getToneReproducer();
//! Get the current tone reproducer used in the core. //! Get the current tone reproducer used in the core.
const StelToneReproducer* getToneReproducer() const; const StelToneReproducer* getToneReproducer() const;
//! Get the current StelSkyDrawer used in the core. //! Get the current StelSkyDrawer used in the core.
StelSkyDrawer* getSkyDrawer(); StelSkyDrawer* getSkyDrawer();
skipping to change at line 212 skipping to change at line 220
Vec3d galacticToJ2000(const Vec3d& v) const; Vec3d galacticToJ2000(const Vec3d& v) const;
Vec3d equinoxEquToJ2000(const Vec3d& v) const; Vec3d equinoxEquToJ2000(const Vec3d& v) const;
Vec3d j2000ToEquinoxEqu(const Vec3d& v) const; Vec3d j2000ToEquinoxEqu(const Vec3d& v) const;
Vec3d j2000ToGalactic(const Vec3d& v) const; Vec3d j2000ToGalactic(const Vec3d& v) const;
//! Transform vector from heliocentric ecliptic coordinate to altazi muthal //! Transform vector from heliocentric ecliptic coordinate to altazi muthal
Vec3d heliocentricEclipticToAltAz(const Vec3d& v, RefractionMode ref Mode=RefractionAuto) const; Vec3d heliocentricEclipticToAltAz(const Vec3d& v, RefractionMode ref Mode=RefractionAuto) const;
//! Transform from heliocentric coordinate to equatorial at current equinox (for the planet where the observer stands) //! Transform from heliocentric coordinate to equatorial at current equinox (for the planet where the observer stands)
Vec3d heliocentricEclipticToEquinoxEqu(const Vec3d& v) const; Vec3d heliocentricEclipticToEquinoxEqu(const Vec3d& v) const;
//! Transform vector from heliocentric coordinate to false equatoria // //! Transform vector from heliocentric coordinate to false equatoria
l : equatorial l : equatorial
//! coordinate but centered on the observer position (usefull for ob // //! coordinate but centered on the observer position (useful for obj
jects close to earth) ects close to earth)
Vec3d heliocentricEclipticToEarthPosEquinoxEqu(const Vec3d& v) const // //! Unused as of V0.13
; // Vec3d heliocentricEclipticToEarthPosEquinoxEqu(const Vec3d& v) const
;
//! Get the modelview matrix for heliocentric ecliptic (Vsop87) draw ing //! Get the modelview matrix for heliocentric ecliptic (Vsop87) draw ing.
StelProjector::ModelViewTranformP getHeliocentricEclipticModelViewTr ansform(RefractionMode refMode=RefractionAuto) const; StelProjector::ModelViewTranformP getHeliocentricEclipticModelViewTr ansform(RefractionMode refMode=RefractionAuto) const;
//! Get the modelview matrix for observer-centric ecliptic (Vsop87) //! Get the modelview matrix for observer-centric ecliptic (Vsop87)
drawing drawing.
StelProjector::ModelViewTranformP getObservercentricEclipticModelVie StelProjector::ModelViewTranformP getObservercentricEclipticJ2000Mod
wTransform(RefractionMode refMode=RefractionAuto) const; elViewTransform(RefractionMode refMode=RefractionAuto) const;
//! Get the modelview matrix for observer-centric equatorial at equi //! Get the modelview matrix for observer-centric ecliptic of Date d
nox drawing rawing.
StelProjector::ModelViewTranformP getObservercentricEclipticOfDateMo
delViewTransform(RefractionMode refMode=RefractionAuto) const;
//! Get the modelview matrix for observer-centric equatorial at equi
nox drawing.
StelProjector::ModelViewTranformP getEquinoxEquModelViewTransform(Re fractionMode refMode=RefractionAuto) const; StelProjector::ModelViewTranformP getEquinoxEquModelViewTransform(Re fractionMode refMode=RefractionAuto) const;
//! Get the modelview matrix for observer-centric altazimuthal drawi ng //! Get the modelview matrix for observer-centric altazimuthal drawi ng.
StelProjector::ModelViewTranformP getAltAzModelViewTransform(Refract ionMode refMode=RefractionAuto) const; StelProjector::ModelViewTranformP getAltAzModelViewTransform(Refract ionMode refMode=RefractionAuto) const;
//! Get the modelview matrix for observer-centric J2000 equatorial d rawing //! Get the modelview matrix for observer-centric J2000 equatorial d rawing.
StelProjector::ModelViewTranformP getJ2000ModelViewTransform(Refract ionMode refMode=RefractionAuto) const; StelProjector::ModelViewTranformP getJ2000ModelViewTransform(Refract ionMode refMode=RefractionAuto) const;
//! Get the modelview matrix for observer-centric Galactic equatoria l drawing //! Get the modelview matrix for observer-centric Galactic equatoria l drawing.
StelProjector::ModelViewTranformP getGalacticModelViewTransform(Refr actionMode refMode=RefractionAuto) const; StelProjector::ModelViewTranformP getGalacticModelViewTransform(Refr actionMode refMode=RefractionAuto) const;
//! Rotation matrix from equatorial J2000 to ecliptic (Vsop87) //! Rotation matrix from equatorial J2000 to ecliptic (VSOP87A).
static const Mat4d matJ2000ToVsop87; static const Mat4d matJ2000ToVsop87;
//! Rotation matrix from ecliptic (Vsop87) to equatorial J2000 //! Rotation matrix from ecliptic (VSOP87A) to equatorial J2000.
static const Mat4d matVsop87ToJ2000; static const Mat4d matVsop87ToJ2000;
//! Rotation matrix from J2000 to Galactic reference frame, using FI TS convention. //! Rotation matrix from J2000 to Galactic reference frame, using FI TS convention.
static const Mat4d matJ2000ToGalactic; static const Mat4d matJ2000ToGalactic;
//! Rotation matrix from J2000 to Galactic reference frame, using FI TS convention. //! Rotation matrix from J2000 to Galactic reference frame, using FI TS convention.
static const Mat4d matGalacticToJ2000; static const Mat4d matGalacticToJ2000;
//! Return the observer heliocentric ecliptic position //! Return the observer heliocentric ecliptic position
Vec3d getObserverHeliocentricEclipticPos() const; Vec3d getObserverHeliocentricEclipticPos() const;
//! Get the informations on the current location //! Get the informations on the current location
const StelLocation& getCurrentLocation() const; const StelLocation& getCurrentLocation() const;
const QSharedPointer<class Planet> getCurrentPlanet() const; const QSharedPointer<class Planet> getCurrentPlanet() const;
//! Unfortunately we also need this.
const StelObserver* getCurrentObserver() const;
SphericalCap getVisibleSkyArea() const; SphericalCap getVisibleSkyArea() const;
//! Smoothly move the observer to the given location //! Smoothly move the observer to the given location
//! @param target the target location //! @param target the target location
//! @param duration direction of view move duration in s //! @param duration direction of view move duration in s
//! @param durationIfPlanetChange direction of view + planet travel move duration in s. //! @param durationIfPlanetChange direction of view + planet travel move duration in s.
//! This is used only if the destination planet is different from th e starting one. //! This is used only if the destination planet is different from th e starting one.
void moveObserverTo(const StelLocation& target, double duration=1., double durationIfPlanetChange=1.); void moveObserverTo(const StelLocation& target, double duration=1., double durationIfPlanetChange=1.);
// Conversion in standar Julian time format // Conversion in standard Julian time format
static const double JD_SECOND; static const double JD_SECOND;
static const double JD_MINUTE; static const double JD_MINUTE;
static const double JD_HOUR; static const double JD_HOUR;
static const double JD_DAY; static const double JD_DAY;
static const double ONE_OVER_JD_SECOND; static const double ONE_OVER_JD_SECOND;
//! Get the sidereal time shifted by the observer longitude //! Get the sidereal time shifted by the observer longitude
//! @return the local sidereal time in radian //! @return the local sidereal time in radian
double getLocalSiderealTime() const; double getLocalSiderealTime() const;
//! Get the duration of a sidereal day for the current observer in d ay. //! Get the duration of a sidereal day for the current observer in d ay.
double getLocalSiderealDayLength() const; double getLocalSiderealDayLength() const;
//! Get the duration of a sidereal year for the current observer in days. //! Get the duration of a sidereal year for the current observer in days.
double getLocalSiderealYearLength() const; double getLocalSiderealYearLength() const;
//! Return the startup mode, can be preset|Preset or anything else //! Return the startup mode, can be "actual" (i.e. take current time
from system),
//! "today" (take some time e.g. on the evening of today) or "preset
" (completely preconfigured).
QString getStartupTimeMode(); QString getStartupTimeMode();
void setStartupTimeMode(const QString& s); void setStartupTimeMode(const QString& s);
//! Get Delta-T estimation for a given date.
//! @param jDay the date and time expressed as a julian day
//! @return Delta-T in seconds
//! @note Thanks to Rob van Gent which create a collection from many
formulas for calculation of Delta-T: http://www.staff.science.uu.nl/~gent0
113/deltat/deltat.htm
double getDeltaT(double jDay) const;
//! Get info about valid range for current algorithm for calculation of Delta-T //! Get info about valid range for current algorithm for calculation of Delta-T
//! @param jDay the JD //! @param JD the Julian Day number to test.
//! @param marker the marker for valid range //! @param marker receives a string: "*" if jDay is outside valid ra
//! @return valid range nge, or "?" if range unknown, else an empty string.
QString getCurrentDeltaTAlgorithmValidRange(double jDay, QString* ma //! @return valid range as explanatory string.
rker) const; QString getCurrentDeltaTAlgorithmValidRangeDescription(const double
JD, QString* marker) const;
//! Checks for current time of day - it's night or day?
bool isDay() const; //! Checks for altitude of the Sun - is it night or day?
//! @return true if sun higher than about -6 degrees, i.e. "day" inc
ludes civil twilight.
//! @note Useful mostly for brightness-controlled GUI decisions like
font colors.
bool isBrightDaylight() const;
//! Get value of the current Julian epoch //! Get value of the current Julian epoch (i.e. current year with de cimal fraction, e.g. 2012.34567)
double getCurrentEpoch() const; double getCurrentEpoch() const;
//! Get the default Mapping used by the Projection //! Get the default Mapping used by the Projection
QString getDefaultProjectionTypeKey(void) const; QString getDefaultProjectionTypeKey(void) const;
public slots: public slots:
//! Set the current ProjectionType to use //! Set the current ProjectionType to use
void setCurrentProjectionType(ProjectionType type); void setCurrentProjectionType(ProjectionType type);
ProjectionType getCurrentProjectionType() const; ProjectionType getCurrentProjectionType() const;
skipping to change at line 333 skipping to change at line 345
//! Set the current algorithm to use from its key //! Set the current algorithm to use from its key
void setCurrentDeltaTAlgorithmKey(QString type); void setCurrentDeltaTAlgorithmKey(QString type);
//! Set the mask type. //! Set the mask type.
void setMaskType(StelProjector::StelProjectorMaskType m); void setMaskType(StelProjector::StelProjectorMaskType m);
//! Set the flag with decides whether to arrage labels so that //! Set the flag with decides whether to arrage labels so that
//! they are aligned with the bottom of a 2d screen, or a 3d dome. //! they are aligned with the bottom of a 2d screen, or a 3d dome.
void setFlagGravityLabels(bool gravity); void setFlagGravityLabels(bool gravity);
//! Set the offset rotation angle in degree to apply to gravity text (only if gravityLabels is set to false). //! Set the offset rotation angle in degree to apply to gravity text (only if gravityLabels is set to false).
void setDefautAngleForGravityText(float a); void setDefaultAngleForGravityText(float a);
//! Set the horizontal flip status. //! Set the horizontal flip status.
//! @param flip The new value (true = flipped, false = unflipped). //! @param flip The new value (true = flipped, false = unflipped).
void setFlipHorz(bool flip); void setFlipHorz(bool flip);
//! Set the vertical flip status. //! Set the vertical flip status.
//! @param flip The new value (true = flipped, false = unflipped). //! @param flip The new value (true = flipped, false = unflipped).
void setFlipVert(bool flip); void setFlipVert(bool flip);
//! Get the state of the horizontal flip. //! Get the state of the horizontal flip.
//! @return True if flipped horizontally, else false. //! @return True if flipped horizontally, else false.
bool getFlipHorz(void) const; bool getFlipHorz(void) const;
//! Get the state of the vertical flip. //! Get the state of the vertical flip.
skipping to change at line 356 skipping to change at line 368
//! Get the location used by default at startup //! Get the location used by default at startup
QString getDefaultLocationID() const; QString getDefaultLocationID() const;
//! Set the location to use by default at startup //! Set the location to use by default at startup
void setDefaultLocationID(const QString& id); void setDefaultLocationID(const QString& id);
//! Return to the default location. //! Return to the default location.
void returnToDefaultLocation(); void returnToDefaultLocation();
//! Return to the default location and set default landscape with at mosphere and fog effects //! Return to the default location and set default landscape with at mosphere and fog effects
void returnToHome(); void returnToHome();
//! Set the current date in Julian Day //! Set the current date in Julian Day (UT)
void setJDay(double JD); void setJD(double newJD);
//! Get the current date in Julian Day //! Set the current date in Julian Day (TT).
double getJDay() const; //! The name is derived from the classical name "Ephemeris Time", of
which TT is the successor.
//! Set the current date in Modified Julian Day //! It is still frequently used in the literature.
void setJDE(double newJDE);
//! Get the current date in Julian Day (UT).
double getJD() const;
//! Get the current date in Julian Day (TT).
//! The name is derived from the classical name "Ephemeris Time", of
which TT is the successor.
//! It is still frequently used in the literature.
double getJDE() const;
//! Set the current date in Modified Julian Day (UT).
//! MJD is simply JD-2400000.5, getting rid of large numbers and sta
rting days at midnight.
//! It is mostly used in satellite contexts.
void setMJDay(double MJD); void setMJDay(double MJD);
//! Get the current date in Modified Julian Day //! Get the current date in Modified Julian Day (UT)
double getMJDay() const; double getMJDay() const;
//! Compute Delta-T estimation for a given date.
//! DeltaT is the accumulated effect of earth's rotation slowly gett
ing slower, mostly caused by tidal braking by the Moon.
//! For accurate positioning of objects in the sky, we must compute
earth-based clock-dependent things like earth rotation, hour angles etc.
//! using plain UT, but all orbital motions or rotation of the other
planets must be computed in TT, which is a regular time frame.
//! Also satellites are computed in the UT frame because (1) they ar
e short-lived and (2) must follow paths over earth ground.
//! (Note that we make no further difference between TT and DT, thos
e are regarded equivalent for our purpose.)
//!
//! @param JD the date and time expressed as a Julian Day
//! @return DeltaT in seconds
//! @note Thanks to Rob van Gent which create a collection from many
formulas for calculation of Delta-T: http://www.staff.science.uu.nl/~gent0
113/deltat/deltat.htm
//! @note Use this only if needed, prefer calling getDeltaT() for ac
cess to the current value.
double computeDeltaT(const double JD) const;
//! Get current DeltaT.
double getDeltaT() const;
//! @return whether nutation is currently used.
bool getUseNutation() const {return flagUseNutation;}
//! Set whether you want computation and simulation of nutation (a s
light wobble of Earth's axis, just a few arcseconds).
void setUseNutation(bool useNutation) { flagUseNutation=useNutation;
}
//! @return whether topocentric coordinates are currently used.
bool getUseTopocentricCoordinates() const {return flagUseTopocentric
Coordinates;}
//! Set whether you want computation and simulation of nutation (a s
light wobble of Earth's axis, just a few arcseconds).
void setUseTopocentricCoordinates(bool use) { flagUseTopocentricCoor
dinates=use;}
//! Return the preset sky time in JD //! Return the preset sky time in JD
double getPresetSkyTime() const; double getPresetSkyTime() const;
//! Set the preset sky time from a JD //! Set the preset sky time from a JD
void setPresetSkyTime(double d); void setPresetSkyTime(double d);
//! Set time speed in JDay/sec //! Set time speed in JDay/sec
void setTimeRate(double ts); void setTimeRate(double ts);
//! Get time speed in JDay/sec //! Get time speed in JDay/sec
double getTimeRate() const; double getTimeRate() const;
skipping to change at line 404 skipping to change at line 451
//! Set stellarium time to current real world time //! Set stellarium time to current real world time
void setTimeNow(); void setTimeNow();
//! Set the time to some value, leaving the day the same. //! Set the time to some value, leaving the day the same.
void setTodayTime(const QTime& target); void setTodayTime(const QTime& target);
//! Get whether the current stellarium time is the real world time //! Get whether the current stellarium time is the real world time
bool getIsTimeNow() const; bool getIsTimeNow() const;
//! get the initial "today time" from the config file //! get the initial "today time" from the config file
QTime getInitTodayTime(void); QTime getInitTodayTime(void);
//! set the initial "today time" from the config file //! set the initial "today time" from the config file
void setInitTodayTime(const QTime& t); void setInitTodayTime(const QTime& time);
//! Set the preset sky time from a QDateTime //! Set the preset sky time from a QDateTime
void setPresetSkyTime(QDateTime dt); void setPresetSkyTime(QDateTime dateTime);
//! Add one [Earth, solar] hour to the current simulation time. //! Add one [Earth, solar] hour to the current simulation time.
void addHour(); void addHour();
//! Add one [Earth, solar] day to the current simulation time. //! Add one [Earth, solar] day to the current simulation time.
void addDay(); void addDay();
//! Add one [Earth, solar] week to the current simulation time. //! Add one [Earth, solar] week to the current simulation time.
void addWeek(); void addWeek();
//! Add one sidereal day to the simulation time. The length of time depends //! Add one sidereal day to the simulation time. The length of time depends
//! on the current planetary body on which the observer is located. //! on the current planetary body on which the observer is located.
void addSiderealDay(); void addSiderealDay();
//! Add one sidereal week (7 sidereal days) to the simulation time.
The length
//! of time depends on the current planetary body on which the obser
ver is located.
void addSiderealWeek();
//! Add one sidereal month (1/12 of sidereal year) to the simulation
time. The length
//! of time depends on the current planetary body on which the obser
ver is located.
//! Sidereal year connected to orbital period of planets.
void addSiderealMonth();
//! Add one sidereal year to the simulation time. The length of time depends //! Add one sidereal year to the simulation time. The length of time depends
//! on the current planetary body on which the observer is located. Sidereal year //! on the current planetary body on which the observer is located. Sidereal year
//! connected to orbital period of planets. //! connected to orbital period of planets.
void addSiderealYear(); void addSiderealYear();
//! Add one sidereal century (100 sidereal years) to the simulation //! Add n sidereal years to the simulation time. The length of time
time. The length depends
//! of time depends on the current planetary body on which the obser //! on the current planetary body on which the observer is located.
ver is located. Sidereal year
//! Sidereal year connected to orbital period of planets. //! connected to orbital period of planets.
void addSiderealCentury(); void addSiderealYears(float n=100.f);
//! Subtract one [Earth, solar] hour to the current simulation time. //! Subtract one [Earth, solar] hour to the current simulation time.
void subtractHour(); void subtractHour();
//! Subtract one [Earth, solar] day to the current simulation time. //! Subtract one [Earth, solar] day to the current simulation time.
void subtractDay(); void subtractDay();
//! Subtract one [Earth, solar] week to the current simulation time. //! Subtract one [Earth, solar] week to the current simulation time.
void subtractWeek(); void subtractWeek();
//! Subtract one sidereal day to the simulation time. The length of time depends //! Subtract one sidereal day to the simulation time. The length of time depends
//! on the current planetary body on which the observer is located. //! on the current planetary body on which the observer is located.
void subtractSiderealDay(); void subtractSiderealDay();
//! Subtract one sidereal week (7 sidereal days) to the simulation t
ime. The length
//! of time depends on the current planetary body on which the obser
ver is located.
void subtractSiderealWeek();
//! Subtract one sidereal month (1/12 of sidereal year) to the simul
ation time. The length
//! of time depends on the current planetary body on which the obser
ver is located.
//! Sidereal year connected to orbital period of planets.
void subtractSiderealMonth();
//! Subtract one sidereal year to the simulation time. The length of time depends //! Subtract one sidereal year to the simulation time. The length of time depends
//! on the current planetary body on which the observer is located. Sidereal year //! on the current planetary body on which the observer is located. Sidereal year
//! connected to orbital period of planets. //! connected to orbital period of planets.
void subtractSiderealYear(); void subtractSiderealYear();
//! Subtract one sidereal century (100 sidereal years) to the simula //! Subtract n sidereal years to the simulation time. The length of
tion time. The length time depends
//! of time depends on the current planetary body on which the obser //! on the current planetary body on which the observer is located.
ver is located. Sidereal year
//! Sidereal year connected to orbital period of planets. //! connected to orbital period of planets.
void subtractSiderealCentury(); void subtractSiderealYears(float n=100.f);
//! Add one synodic month to the simulation time. //! Add one synodic month to the simulation time.
void addSynodicMonth(); void addSynodicMonth();
//! Add one draconic year to the simulation time. //! Add one draconic year to the simulation time.
void addDraconicYear(); void addDraconicYear();
//! Add one draconic month to the simulation time. //! Add one draconic month to the simulation time.
void addDraconicMonth(); void addDraconicMonth();
//! Add one anomalistic month to the simulation time. //! Add one anomalistic month to the simulation time.
void addAnomalisticMonth(); void addAnomalisticMonth();
//! Add one anomalistic year to the simulation time.
void addAnomalisticYear();
//! Add n anomalistic years to the simulation time.
void addAnomalisticYears(float n=100.f);
//! Add one mean tropical month to the simulation time. //! Add one mean tropical month to the simulation time.
void addTropicalMonth(); void addMeanTropicalMonth();
//! Add one mean tropical year to the simulation time. //! Add one mean tropical year to the simulation time.
void addMeanTropicalYear();
//! Add n mean tropical years to the simulation time.
void addMeanTropicalYears(float n=100.f);
//! Add one tropical year to the simulation time.
void addTropicalYear(); void addTropicalYear();
//! Add one mean tropical century to the simulation time.
void addTropicalCentury(); //! Add one Julian year to the simulation time.
void addJulianYear();
//! Add n Julian years to the simulation time.
void addJulianYears(float n=100.f);
//! Add one Gaussian year to the simulation time.
void addGaussianYear();
//! Subtract one synodic month to the simulation time. //! Subtract one synodic month to the simulation time.
void subtractSynodicMonth(); void subtractSynodicMonth();
//! Subtract one draconic year to the simulation time. //! Subtract one draconic year to the simulation time.
void subtractDraconicYear(); void subtractDraconicYear();
//! Subtract one draconic month to the simulation time. //! Subtract one draconic month to the simulation time.
void subtractDraconicMonth(); void subtractDraconicMonth();
//! Subtract one anomalistic month to the simulation time. //! Subtract one anomalistic month to the simulation time.
void subtractAnomalisticMonth(); void subtractAnomalisticMonth();
//! Subtract one anomalistic year to the simulation time.
void subtractAnomalisticYear();
//! Subtract n anomalistic years to the simulation time.
void subtractAnomalisticYears(float n=100.f);
//! Subtract one mean tropical month to the simulation time. //! Subtract one mean tropical month to the simulation time.
void subtractTropicalMonth(); void subtractMeanTropicalMonth();
//! Subtract one mean tropical year to the simulation time. //! Subtract one mean tropical year to the simulation time.
void subtractMeanTropicalYear();
//! Subtract n mean tropical years to the simulation time.
void subtractMeanTropicalYears(float n=100.f);
//! Subtract one tropical year to the simulation time.
void subtractTropicalYear(); void subtractTropicalYear();
//! Subtract one mean tropical century to the simulation time.
void subtractTropicalCentury(); //! Subtract one Julian year to the simulation time.
void subtractJulianYear();
//! Subtract n Julian years to the simulation time.
void subtractJulianYears(float n=100.f);
//! Subtract one Gaussian year to the simulation time.
void subtractGaussianYear();
//! Add a number of Earth Solar days to the current simulation time //! Add a number of Earth Solar days to the current simulation time
//! @param d the decimal number of days to add (use negative values to subtract) //! @param d the decimal number of days to add (use negative values to subtract)
void addSolarDays(double d); void addSolarDays(double d);
//! Add a number of sidereal days to the current simulation time, //! Add a number of sidereal days to the current simulation time,
//! based on the observer body's rotational period. //! based on the observer body's rotational period.
//! @param d the decimal number of sidereal days to add (use negativ e values to subtract) //! @param d the decimal number of sidereal days to add (use negativ e values to subtract)
void addSiderealDays(double d); void addSiderealDays(double d);
//! Move the observer to the selected object. This will only do some thing if //! Move the observer to the selected object. This will only do some thing if
//! the selected object is of the correct type - i.e. a planet. //! the selected object is of the correct type - i.e. a planet.
void moveObserverToSelected(); void moveObserverToSelected();
//! Set year for custom equation for calculation of Delta-T //! Set central year for custom equation for calculation of Delta-T
//! @param y the year, e.g. 1820 //! @param y the year, e.g. 1820
void setDeltaTCustomYear(float y) { deltaTCustomYear=y; } void setDeltaTCustomYear(float y) { deltaTCustomYear=y; }
//! Set n-dot for custom equation for calculation of Delta-T //! Set n-dot for custom equation for calculation of Delta-T
//! @param y the n-dot value, e.g. -26.0 //! @param y the n-dot value, e.g. -26.0
void setDeltaTCustomNDot(float v) { deltaTCustomNDot=v; } void setDeltaTCustomNDot(float v) { deltaTCustomNDot=v; }
//! Set coefficients for custom equation for calculation of Delta-T //! Set coefficients for custom equation for calculation of Delta-T
//! @param y the coefficients, e.g. -20,0,32 //! @param y the coefficients, e.g. -20,0,32
void setDeltaTCustomEquationCoefficients(Vec3f c) { deltaTCustomEqua tionCoeff=c; } void setDeltaTCustomEquationCoefficients(Vec3f c) { deltaTCustomEqua tionCoeff=c; }
//! Get year for custom equation for calculation of Delta-T //! Get central year for custom equation for calculation of Delta-T
float getDeltaTCustomYear() const { return deltaTCustomYear; } float getDeltaTCustomYear() const { return deltaTCustomYear; }
//! Get n-dot for custom equation for calculation of Delta-T //! Get n-dot for custom equation for calculation of Delta-T
float getDeltaTCustomNDot() const { return deltaTCustomNDot; } float getDeltaTCustomNDot() const { return deltaTCustomNDot; }
//! Get coefficients for custom equation for calculation of Delta-T //! Get coefficients for custom equation for calculation of Delta-T
Vec3f getDeltaTCustomEquationCoefficients() const { return deltaTCus tomEquationCoeff; } Vec3f getDeltaTCustomEquationCoefficients() const { return deltaTCus tomEquationCoeff; }
signals: signals:
//! This signal is emitted when the observer location has changed. //! This signal is emitted when the observer location has changed.
void locationChanged(StelLocation); void locationChanged(StelLocation);
//! This signal is emitted when the time rate has changed //! This signal is emitted when the time rate has changed
skipping to change at line 553 skipping to change at line 614
DeltaTAlgorithm currentDeltaTAlgorithm; DeltaTAlgorithm currentDeltaTAlgorithm;
// Parameters to use when creating new instances of StelProjector // Parameters to use when creating new instances of StelProjector
StelProjector::StelProjectorParams currentProjectorParams; StelProjector::StelProjectorParams currentProjectorParams;
void updateTransformMatrices(); void updateTransformMatrices();
void updateTime(double deltaTime); void updateTime(double deltaTime);
void resetSync(); void resetSync();
// Matrices used for every coordinate transfo // Matrices used for every coordinate transfo
Mat4d matHeliocentricEclipticToAltAz; // Transform from helioce Mat4d matHeliocentricEclipticJ2000ToAltAz; // Transform from helioce
ntric ecliptic (Vsop87) to observer-centric altazimuthal coordinate ntric ecliptic Cartesian (VSOP87A) to topocentric (StelObserver) altazimuth
Mat4d matAltAzToHeliocentricEcliptic; // Transform from observe al coordinate
r-centric altazimuthal coordinate to heliocentric ecliptic (Vsop87) Mat4d matAltAzToHeliocentricEclipticJ2000; // Transform from topocen
Mat4d matAltAzToEquinoxEqu; // Transform from observe tric (StelObserver) altazimuthal coordinate to heliocentric ecliptic Cartes
r-centric altazimuthal coordinate to Earth Equatorial ian (VSOP87A)
Mat4d matEquinoxEquToAltAz; // Transform from observe Mat4d matAltAzToEquinoxEqu; // Transform from topocen
r-centric altazimuthal coordinate to Earth Equatorial tric altazimuthal coordinate to Earth Equatorial
Mat4d matHeliocentricEclipticToEquinoxEqu; // Transform from helioce Mat4d matEquinoxEquToAltAz; // Transform from Earth E
ntric ecliptic (Vsop87) to earth equatorial coordinate quatorial to topocentric (StelObserver) altazimuthal coordinate
Mat4d matEquinoxEquToJ2000; Mat4d matHeliocentricEclipticToEquinoxEqu; // Transform from helioce
Mat4d matJ2000ToEquinoxEqu; ntric ecliptic Cartesian (VSOP87A) to earth equatorial coordinate
Mat4d matEquinoxEquToJ2000; // For Earth, this is alm
ost the inverse precession matrix, =Rz(VSOPbias)Rx(eps0)Rz(-psiA)Rx(-omA)Rz
(chiA)
Mat4d matJ2000ToEquinoxEqu; // precession matrix
Mat4d matJ2000ToAltAz; Mat4d matJ2000ToAltAz;
Mat4d matAltAzModelView; // Modelview matrix for observer- centric altazimuthal drawing Mat4d matAltAzModelView; // Modelview matrix for observer- centric altazimuthal drawing
Mat4d invertMatAltAzModelView; // Inverted modelview matrix for observer-centric altazimuthal drawing Mat4d invertMatAltAzModelView; // Inverted modelview matrix for observer-centric altazimuthal drawing
// Position variables // Position variables
StelObserver* position; StelObserver* position;
// The ID of the default startup location // The ID of the default startup location
QString defaultLocationID; QString defaultLocationID;
// flag to indicate we want to use nutation (the small-scale wobble
of earth's axis)
bool flagUseNutation;
// flag to indicate that we show topocentrically corrected coordinat
es. (Switching to false for planetocentric coordinates is new for 0.14)
bool flagUseTopocentricCoordinates;
// Time variables // Time variables
double timeSpeed; // Positive : forward, Negative : Backward, 1 = 1sec/sec double timeSpeed; // Positive : forward, Negative : Backward, 1 = 1sec/sec
double JDay; // Curent time in Julian day //double JDay; // Current time in Julian day. IN
V0.12 TO V0.14, this was JD in TT, and all places where UT was required ha
d to subtract getDeltaT() explicitly.
QPair<double,double> JD; // From 0.14 on: JD.first=JD_UT,
JD.second=DeltaT=TT-UT. To gain JD_TT, compute JDE=JD.first+JD.second or be
tter just call getJDE()
// Use is best with calls getJD()
/setJD() and getJDE()/setJDE() to explicitly state which flavour of JD you
need.
double presetSkyTime; double presetSkyTime;
QTime initTodayTime; QTime initTodayTime;
QString startupTimeMode; QString startupTimeMode;
double secondsOfLastJDayUpdate; // Time in seconds when the double secondsOfLastJDUpdate; // Time in seconds when the time ra
time rate or time last changed te or time last changed
double JDayOfLastJDayUpdate; // JDay when the time rate or t double jdOfLastJDUpdate; // JD when the time rate or time la
ime last changed st changed
// Variables for custom equation of Delta-T // Variables for custom equation of Delta-T
Vec3f deltaTCustomEquationCoeff; Vec3f deltaTCustomEquationCoeff;
float deltaTCustomNDot; float deltaTCustomNDot;
float deltaTCustomYear; float deltaTCustomYear;
}; };
#endif // _STELCORE_HPP_ #endif // _STELCORE_HPP_
 End of changes. 49 change blocks. 
130 lines changed or deleted 233 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/