21 #ifndef _STELCORE_HPP_ 22 #define _STELCORE_HPP_ 24 #include "StelProjector.hpp" 26 #include "StelLocation.hpp" 27 #include "StelSkyDrawer.hpp" 29 #include <QStringList> 155 void update(
double deltaTime);
219 void j2000ToAltAzInPlaceNoRefraction(
Vec3f* v)
const {v->transfo4d(matJ2000ToAltAz);}
221 Vec3d supergalacticToJ2000(
const Vec3d& v)
const;
235 Vec3d j2000ToSupergalactic(
const Vec3d& v)
const;
292 QString getCurrentTimeZone()
const;
293 void setCurrentTimeZone(
const QString& tz);
295 const QSharedPointer<class Planet> getCurrentPlanet()
const;
308 static const double JD_SECOND;
309 static const double JD_MINUTE;
310 static const double JD_HOUR;
311 static const double JD_DAY;
312 static const double ONE_OVER_JD_SECOND;
313 static const double TZ_ERA_BEGINNING;
328 void setStartupTimeMode(
const QString& s);
364 QString getCurrentProjectionNameI18n()
const;
418 void setViewportOffset(
double newHorizontalOffsetPct,
double newVerticalOffsetPct);
444 void setJD(
double newJD);
448 void setJDE(
double newJDE);
450 double getJD()
const;
462 bool getUseDST()
const;
463 void setUseDST(
const bool b);
465 bool getUseCustomTimeZone(
void)
const;
466 void setUseCustomTimeZone(
const bool b);
513 void revertTimeDirection(
void);
744 void updateTransformMatrices();
745 void updateTime(
double deltaTime);
746 void updateMaximumFov();
749 void registerMathMetaTypes();
753 Mat4d matHeliocentricEclipticJ2000ToAltAz;
754 Mat4d matAltAzToHeliocentricEclipticJ2000;
755 Mat4d matAltAzToEquinoxEqu;
756 Mat4d matEquinoxEquToAltAz;
757 Mat4d matHeliocentricEclipticToEquinoxEqu;
758 Mat4d matEquinoxEquToJ2000;
759 Mat4d matJ2000ToEquinoxEqu;
760 static Mat4d matJ2000ToJ1875;
762 Mat4d matJ2000ToAltAz;
763 Mat4d matAltAzToJ2000;
765 Mat4d matAltAzModelView;
766 Mat4d invertMatAltAzModelView;
771 QString defaultLocationID;
774 bool flagUseNutation;
776 bool flagUseTopocentricCoordinates;
781 QPair<double,double> JD;
783 double presetSkyTime;
785 QString startupTimeMode;
786 double milliSecondsOfLastJDUpdate;
787 double jdOfLastJDUpdate;
789 QString currentTimeZone;
794 Vec3f deltaTCustomEquationCoeff;
795 float deltaTCustomNDot;
796 float deltaTCustomYear;
798 bool deltaTdontUseMoon;
799 double (*deltaTfunc)(
const double JD);
810 #endif // _STELCORE_HPP_ bool de430IsAvailable()
true if DE430 ephemeris file has been found
const StelGeodesicGrid * getGeodesicGrid(int maxLevel) const
Get an instance of StelGeodesicGrid which is garanteed to allow for at least maxLevel levels...
void subtractMeanTropicalYears(float n=100.f)
Subtract n mean tropical years to the simulation time.
Reingold & Dershowitz (2002, 2007) algorithm for DeltaT.
void addAnomalisticYears(float n=100.f)
Add n anomalistic years to the simulation time.
double computeDeltaT(const double JD)
Compute DeltaT estimation for a given date.
void setTimeRate(double ts)
Set time speed in JDay/sec.
Store the informations for a location on a planet.
void setPresetSkyTime(double d)
Set the preset sky time from a JD.
Stephenson & Morrison (1995) algorithm for DeltaT.
Never add refraction (i.e. geometric coordinates)
StelProjector::ModelViewTranformP getAltAzModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for observer-centric altazimuthal drawing.
Always add refraction (i.e. apparent coordinates)
Vec3d j2000ToJ1875(const Vec3d &v) const
Use fixed matrix to allow fast transformation of positions related to the IAU constellation borders...
void subtractSiderealYear()
Subtract one sidereal year to the simulation time.
void setCurrentProjectionType(ProjectionType type)
Set the current ProjectionType to use.
void subtractTropicalYear()
Subtract one tropical year to the simulation time.
void timeRateChanged(double rate)
This signal is emitted when the time rate has changed.
void addWeek()
Add one [Earth, solar] week to the current simulation time.
DeltaTAlgorithm getCurrentDeltaTAlgorithm() const
Get the current algorithm for time correction (DeltaT)
Provide a set of methods used to draw sky objects taking into account eyes adaptation, zoom level, instrument model and artificially set magnitude limits.
void addSiderealDay()
Add one sidereal day to the simulation time.
M. Khalid, Mariam Sultana and Faheem Zaidi polynomial approximation of time period 1620-2013 (2014) ...
QStringList getAllProjectionTypeKeys() const
Get the list of all the available projections.
Banjevic (2006) algorithm for DeltaT.
double getLocalSiderealTime() const
Get the sidereal time shifted by the observer longitude.
void returnToDefaultLocation()
Return to the default location.
StelProjectorMaskType
Define viewport mask types.
static const Mat4d matJ2000ToVsop87
Rotation matrix from equatorial J2000 to ecliptic (VSOP87A).
bool de431IsActive()
true if DE431 ephemeris is in use
bool getFlipHorz(void) const
Get the state of the horizontal flip.
void subtractJulianYears(float n=100.f)
Subtract n Julian years to the simulation time.
StelProjector::ModelViewTranformP getGalacticModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for observer-centric Galactic equatorial drawing.
Espenak & Meeus (2006) algorithm for DeltaT (Recommended, default)
Vec3f getDeltaTCustomEquationCoefficients() const
Get coefficients for custom equation for calculation of DeltaT.
void decreaseTimeSpeed()
Decrease the time speed.
Miller cylindrical projection.
bool getUseTopocentricCoordinates() const
void setObserver(StelObserver *obs)
Replaces the current observer. StelCore assumes ownership of the observer.
void subtractDraconicMonth()
Subtract one draconic month to the simulation time.
void update(double deltaTime)
Update all the objects with respect to the time.
void dateChanged()
This signal is emitted when the date has changed.
void subtractDay()
Subtract one [Earth, solar] day to the current simulation time.
Vec3d getObserverHeliocentricEclipticPos() const
Return the observer heliocentric ecliptic position (GZ: presumably J2000)
double getMJDay() const
Get the current date in Modified Julian Day (UT)
Astronomical Ephemeris (1960) algorithm for DeltaT.
Equatorial reference frame at the J2000 equinox centered on the observer. This is also the ICRS refer...
void subtractJulianYear()
Subtract one Julian year to the simulation time.
Morrison & Stephenson (2004, 2005) algorithm for DeltaT.
StelProjector::ModelViewTranformP getHeliocentricEclipticModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for heliocentric ecliptic (Vsop87) drawing.
void lookAtJ2000(const Vec3d &pos, const Vec3d &up)
Set vision direction.
void subtractAnomalisticYear()
Subtract one anomalistic year to the simulation time.
Reijs (2006) algorithm for DeltaT.
void currentProjectionTypeChanged(StelCore::ProjectionType newType)
Emitted whenever the projection type changes.
void setFlipVert(bool flip)
Set the vertical flip status.
StelProjector::ModelViewTranformP getObservercentricEclipticOfDateModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for observer-centric ecliptic of Date drawing.
Stereographic projection.
A SphericalCap is defined by a direction and an aperture.
IAU (1952) algorithm for DeltaT (based on observations by Spencer Jones (1939))
static const Mat4d matVsop87ToJ2000
Rotation matrix from ecliptic (VSOP87A) to equatorial J2000.
QString getCurrentDeltaTAlgorithmDescription(void) const
Get description of the current algorithm for time correction.
void setDe430Active(bool status)
switch DE430 use to
Stephenson (1978) algorithm for DeltaT.
void addDay()
Add one [Earth, solar] day to the current simulation time.
void subtractSiderealYears(float n=100.f)
Subtract n sidereal years to the simulation time.
void currentProjectionTypeKeyChanged(const QString &newValue)
Emitted whenever the projection type changes.
void setCurrentDeltaTAlgorithmKey(QString type)
Set the current algorithm to use from its key.
bool getUseNutation() const
void setCurrentDeltaTAlgorithm(DeltaTAlgorithm algorithm)
Set the current algorithm and nDot used therein for time correction (DeltaT)
void setRealTimeSpeed()
Set real time speed, i.e. 1 sec/sec.
double getLocalSiderealDayLength() const
Get the duration of a sidereal day for the current observer in day.
QString projectionNameI18nToTypeKey(const QString &nameI18n) const
Get the projection TypeKey from its translated name for the current locale.
Moving ecliptic reference frame centered on the Observer. GZ new for V0.14: Ecliptic of date...
Main class for Stellarium core processing.
static const Mat4d matSupergalacticToJ2000
Rotation matrix from Supergalactic to J2000 reference frame.
double getJD() const
Get the current date in Julian Day (UT).
float getUTCOffset(const double JD) const
Get the UTC offset on the current location (in hours)
void flagUseNutationChanged(bool b)
This signal indicates a switch in use of nutation.
void addGaussianYear()
Add one Gaussian year to the simulation time.
void setViewportStretch(float stretch)
Can be used in specialized setups, intended e.g.
QString getStartupTimeMode()
Return the startup mode, can be "actual" (i.e.
void addSynodicMonth()
Add one synodic month to the simulation time.
Reference frame is not set (FMajerech: Added to avoid condition on uninitialized value in StelSkyLaye...
void setCurrentStelProjectorParams(const StelProjector::StelProjectorParams &newParams)
Set the set of parameters to use when creating a new StelProjector.
Chapront-Touzé & Chapront (1991) algorithm for DeltaT.
static const Mat4d matJ2000ToSupergalactic
Rotation matrix from J2000 to Supergalactic reference frame.
Stephenson, Morrison, Hohenkerk (2016) RSPA paper provides spline fit to observations for -720...
Grid of triangles (zones) on the sphere with radius 1, generated by subdividing the icosahedron...
void addHour()
Add one [Earth, solar] hour to the current simulation time.
float getDeltaTCustomNDot() const
Get n-dot for custom equation for calculation of DeltaT.
QString getCurrentDeltaTAlgorithmValidRangeDescription(const double JD, QString *marker) const
Get info about valid range for current algorithm for calculation of Delta-T.
Schmadel & Zech (1979) algorithm for DeltaT.
DeltaTAlgorithm
Available DeltaT algorithms.
StelSkyDrawer * getSkyDrawer()
Get the current StelSkyDrawer used in the core.
Stephenson (1997) algorithm for DeltaT.
const StelLocation & getCurrentLocation() const
Get the informations on the current location.
qint64 getMilliSecondsOfLastJDUpdate() const
Returns the system date of the last time resetSync() was called.
Borkowski (1988) algorithm for DeltaT.
void addJulianYears(float n=100.f)
Add n Julian years to the simulation time.
Montenbruck & Pfleger (2000) algorithm for DeltaT.
bool de431IsAvailable()
true if DE431 ephemeris file has been found
void addTropicalYear()
Add one tropical year to the simulation time.
void addAnomalisticYear()
Add one anomalistic year to the simulation time.
bool de430IsActive()
true if DE430 ephemeris is in use
A templatized column-major 4x4 matrix compatible with openGL.
void setMilliSecondsOfLastJDUpdate(qint64 millis)
Sets the system date which corresponds to the jdOfLastJDUpdate.
void subtractGaussianYear()
Subtract one Gaussian year to the simulation time.
void init()
Init and load all main core components.
Espenak (1987, 1989) algorithm for DeltaT.
QSharedPointer< StelProjector > StelProjectorP
Shared pointer on a StelProjector instance (implement reference counting)
void setFlagGravityLabels(bool gravity)
Set the flag with decides whether to arrage labels so that they are aligned with the bottom of a 2d s...
Islam, Sadiq & Qureshi (2008 + revisited 2013) algorithm for DeltaT (6 polynomials) ...
void subtractSynodicMonth()
Subtract one synodic month to the simulation time.
QString getCurrentDeltaTAlgorithmKey(void) const
Get the current algorithm used by the DeltaT.
void setViewportVerticalOffset(double newOffsetPct)
Set vertical viewport offset.
double getDeltaT() const
Get current DeltaT.
QString currentProjectionNameI18n
Read-only property returning the localized projection name.
Vec3d heliocentricEclipticToEquinoxEqu(const Vec3d &v) const
Transform from heliocentric coordinate to equatorial at current equinox (for the planet where the obs...
void setJDE(double newJDE)
Set the current date in Julian Day (TT).
Manages the head movements and zoom operations.
Converts tones in function of the eye adaptation to luminance.
void setViewportHorizontalOffset(double newOffsetPct)
Set horizontal viewport offset.
void addMeanTropicalYears(float n=100.f)
Add n mean tropical years to the simulation time.
void addJulianYear()
Add one Julian year to the simulation time.
void getClippingPlanes(double *zn, double *zf) const
Get the near and far clipping planes.
FrameType
Supported reference frame types.
void flagUseTopocentricCoordinatesChanged(bool b)
This signal indicates a switch in use of topocentric coordinates.
void flipVertChanged(bool b)
This signal indicates a vertical display flip.
void addSiderealYear()
Add one sidereal year to the simulation time.
void subtractMinute()
Subtract one [Earth, solar] minute to the current simulation time.
void currentProjectionNameI18nChanged(const QString &newValue)
Emitted whenever the projection type changes.
Equatorial reference frame at the current equinox centered on the observer.
double getJDE() const
Get the current date in Julian Day (TT).
void decreaseTimeSpeedLess()
Decrease the time speed but not as much as with decreaseTimeSpeed()
float getDeltaTCustomYear() const
Get central year for custom equation for calculation of DeltaT.
void setJD(double newJD)
Set the current date in Julian Day (UT)
double getJDOfLastJDUpdate() const
Returns the JD of the last time resetSync() was called.
void addMinute()
Add one [Earth, solar] minute to the current simulation time.
void addDraconicYear()
Add one draconic year to the simulation time.
void toggleRealTimeSpeed()
Set real time speed or pause simulation if we are already in realtime speed.
void addSiderealYears(float n=100.f)
Add n sidereal years to the simulation time.
StelProjector::StelProjectorParams getCurrentStelProjectorParams() const
Get the current set of parameters to use when creating a new StelProjector.
void addMeanTropicalYear()
Add one mean tropical year to the simulation time.
Hammer-Aitoff projection.
void setDe431Active(bool status)
switch DE431 use to
void setTodayTime(const QTime &target)
Set the time to some value, leaving the day the same.
Should be renamed as PlanetBasedObserver and derive from a more generical StelObserver class...
bool getFlipVert(void) const
Get the state of the vertical flip.
ProjectionType
Available projection types.
void returnToHome()
Return to the default location and set default landscape with atmosphere and fog effects.
void subtractWeek()
Subtract one [Earth, solar] week to the current simulation time.
void moveObserverToSelected()
Move the observer to the selected object.
const StelObserver * getCurrentObserver() const
Unfortunately we also need this.
double getPresetSkyTime() const
Return the preset sky time in JD.
StelProjector::ModelViewTranformP getJ2000ModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for observer-centric J2000 equatorial drawing.
void setFlipHorz(bool flip)
Set the horizontal flip status.
double getSolutionEquationOfTime(const double JDE) const
Get solution of equation of time Source: J.
void setMaskType(StelProjector::StelProjectorMaskType m)
Set the mask type.
Morrison & Stephenson (1982) algorithm for DeltaT (used by RedShift)
void addSiderealDays(double d)
Add a number of sidereal days to the current simulation time, based on the observer body's rotational...
void setZeroTimeSpeed()
Set time speed to 0, i.e. freeze the passage of simulation time.
double getLocalSiderealYearLength() const
Get the duration of a sidereal year for the current observer in days.
void setDefaultAngleForGravityText(float a)
Set the offset rotation angle in degree to apply to gravity text (only if gravityLabels is set to fal...
bool getIsTimeNow() const
Get whether the current stellarium time is the real world time.
Without correction, DeltaT is Zero. Like Stellarium versions before 0.12.
double getViewportVerticalOffset(void)
Get current value for vertical viewport offset [-50...50] An offset of 50 percent means projective im...
static const Mat4d matJ2000ToGalactic
Rotation matrix from J2000 to Galactic reference frame, using FITS convention.
Stephenson & Houlden (1986) algorithm for DeltaT.
float getDeltaTnDot() const
Get n-dot for current DeltaT algorithm.
void setTimeNow()
Set stellarium time to current real world time.
void addAnomalisticMonth()
Add one anomalistic month to the simulation time.
Tuckerman (1962, 1964) & Goldstine (1973) algorithm for DeltaT.
void subtractAnomalisticMonth()
Subtract one anomalistic month to the simulation time.
void setDeltaTCustomEquationCoefficients(Vec3f c)
Set coefficients for custom equation for calculation of DeltaT.
void setInitTodayTime(const QTime &time)
set the initial "today time" from the config file
Muller & Stephenson (1975) algorithm for DeltaT.
Fixed-ecliptic reference frame centered on the Observer. GZ: was ObservercentricEcliptic, but renamed because it is Ecliptic of J2000!
void subtractMeanTropicalYear()
Subtract one mean tropical year to the simulation time.
QSharedPointer< ModelViewTranform > ModelViewTranformP
Shared pointer on a ModelViewTranform instance (implement reference counting)
QTime getInitTodayTime(void)
get the initial "today time" from the config file
QString getDefaultProjectionTypeKey(void) const
Get the default Mapping used by the Projection.
StelProjector::ModelViewTranformP getObservercentricEclipticJ2000ModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for observer-centric ecliptic (Vsop87) drawing.
void addDraconicMonth()
Add one draconic month to the simulation time.
void subtractAnomalisticYears(float n=100.f)
Subtract n anomalistic years to the simulation time.
Supergalactic reference frame centered on observer.
Vec3d heliocentricEclipticToAltAz(const Vec3d &v, RefractionMode refMode=RefractionAuto) const
Transform vector from heliocentric ecliptic coordinate to altazimuthal.
StelProjectorP getProjection(FrameType frameType, RefractionMode refractionMode=RefractionAuto) const
Get a new instance of projector using a modelview transformation corresponding to the given frame...
StelToneReproducer * getToneReproducer()
Get the current tone reproducer used in the core.
Galactic reference frame centered on observer.
void subtractDraconicYear()
Subtract one draconic year to the simulation time.
void setDeltaTCustomYear(float y)
Set central year for custom equation for calculation of DeltaT.
void flipHorzChanged(bool b)
This signal indicates a horizontal display flip.
void initEphemeridesFunctions()
initialize ephemerides calculation functions
double getTimeRate() const
Get time speed in JDay/sec.
Automatically decide to add refraction if atmosphere is activated.
void subtractMeanTropicalMonth()
Subtract one mean tropical month to the simulation time.
Meeus & Simons (2000) algorithm for DeltaT.
QString projectionTypeKeyToNameI18n(const QString &key) const
Get the translated projection name from its TypeKey for the current locale.
void timeSyncOccurred(double jDay)
This signal is emitted whenever the time is re-synced.
void setClippingPlanes(double znear, double zfar)
Set the near and far clipping planes.
bool isBrightDaylight() const
Checks for altitude of the Sun - is it night or day?
Define the StelProjectorP type.
void setUseTopocentricCoordinates(bool use)
Set whether you want computation and simulation of nutation (a slight wobble of Earth's axis...
Contains all the param needed to initialize a StelProjector.
Stephenson & Morrison (1984) algorithm for DeltaT.
QString getCurrentProjectionTypeKey(void) const
Get the current Mapping used by the Projection.
Clemence (1948) algorithm for DeltaT.
void addMeanTropicalMonth()
Add one mean tropical month to the simulation time.
Vec3d equinoxEquToJ2000(const Vec3d &v, RefractionMode refMode=RefractionAuto) const
Transform position vector v from equatorial coordinates of date (which may also include atmospheric r...
double getViewportHorizontalOffset(void)
Get current value for horizontal viewport offset [-50...50] An offset of 50 percent means projective ...
Fixed-ecliptic reference frame centered on the Sun. GZ: This is J2000 ecliptical / almost VSOP87...
Schoch (1931) algorithm for DeltaT.
Altazimuthal reference frame centered on observer.
void postDraw()
Update core state after drawing modules.
void increaseTimeSpeed()
Increase the time speed.
Schmadel & Zech (1988) algorithm for DeltaT.
void preDraw()
Update core state before drawing modules.
StelProjector::ModelViewTranformP getSupergalacticModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for observer-centric Supergalactic equatorial drawing.
JPL Horizons algorithm for DeltaT.
void addSolarDays(double d)
Add a number of Earth Solar days to the current simulation time.
Espenak & Meeus (2006) algorithm for DeltaT (but without additional Lunar acceleration. FOR TESTING ONLY, NONPUBLIC)
void setCurrentProjectionTypeKey(QString type)
Set the current ProjectionType to use from its key.
void setDefaultLocationID(const QString &id)
Set the location to use by default at startup.
Vec3d j2000ToEquinoxEqu(const Vec3d &v, RefractionMode refMode=RefractionAuto) const
Transform position vector v from equatorial coordinates J2000 to those of date (optionally corrected ...
void setMJDay(double MJD)
Set the current date in Modified Julian Day (UT).
void setDeltaTCustomNDot(float v)
Set n-dot for custom equation for calculation of DeltaT.
void increaseTimeSpeedLess()
Increase the time speed, but not as much as with increaseTimeSpeed()
QString getIAUConstellation(const Vec3d positionJ2000) const
Return 3-letter abbreviation of IAU constellation name for position in J2000 coordinates.
StelMovementMgr * getMovementMgr()
Get the instance of movement manager.
RefractionMode
Available refraction mode.
static const Mat4d matGalacticToJ2000
Rotation matrix from Galactic to J2000 reference frame, using FITS convention.
void setUseNutation(bool use)
Set whether you want computation and simulation of nutation (a slight wobble of Earth's axis...
void subtractSiderealDay()
Subtract one sidereal day to the simulation time.
QString currentProjectionTypeKey
This is just another way to access the projection type, by string instead of enum.
void moveObserverTo(const StelLocation &target, double duration=1., double durationIfPlanetChange=1.)
Smoothly move the observer to the given location.
void locationChanged(StelLocation)
This signal is emitted when the observer location has changed.
void subtractHour()
Subtract one [Earth, solar] hour to the current simulation time.
void windowHasBeenResized(float x, float y, float width, float height)
Handle the resizing of the window.
Chapront, Chapront-Touze & Francou (1997) & Meeus (1998) algorithm for DeltaT.
bool getRealTimeSpeed() const
Get whether it is real time speed, i.e. 1 sec/sec.
User defined coefficients for quadratic equation for DeltaT.
StelProjectorP getProjection2d() const
Get a new instance of a simple 2d projection.
StelProjector::ModelViewTranformP getEquinoxEquModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for observer-centric equatorial at equinox drawing.
QString getDefaultLocationID() const
Get the location used by default at startup.
double getCurrentEpoch() const
Get value of the current Julian epoch (i.e. current year with decimal fraction, e.g. 2012.34567)