Stellarium  0.16.1
StelCore.hpp
1 /*
2  * Copyright (C) 2003 Fabien Chereau
3  * Copyright (C) 2012 Matthew Gates
4  * Copyright (C) 2015 Georg Zotti (Precession fixes)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19  */
20 
21 #ifndef _STELCORE_HPP_
22 #define _STELCORE_HPP_
23 
24 #include "StelProjector.hpp"
25 #include "StelProjectorType.hpp"
26 #include "StelLocation.hpp"
27 #include "StelSkyDrawer.hpp"
28 #include <QString>
29 #include <QStringList>
30 #include <QTime>
31 #include <QPair>
32 
33 class StelToneReproducer;
34 class StelSkyDrawer;
35 class StelGeodesicGrid;
36 class StelMovementMgr;
37 class StelObserver;
38 
48 class StelCore : public QObject
49 {
50  Q_OBJECT
51  Q_ENUMS(FrameType)
52  Q_ENUMS(ProjectionType)
53  Q_ENUMS(RefractionMode)
54  Q_ENUMS(DeltaTAlgorithm)
55  Q_PROPERTY(bool flipHorz READ getFlipHorz WRITE setFlipHorz NOTIFY flipHorzChanged)
56  Q_PROPERTY(bool flipVert READ getFlipVert WRITE setFlipVert NOTIFY flipVertChanged)
57  Q_PROPERTY(bool flagUseNutation READ getUseNutation WRITE setUseNutation NOTIFY flagUseNutationChanged)
58  Q_PROPERTY(bool flagUseTopocentricCoordinates READ getUseTopocentricCoordinates WRITE setUseTopocentricCoordinates NOTIFY flagUseTopocentricCoordinatesChanged)
59  Q_PROPERTY(ProjectionType currentProjectionType READ getCurrentProjectionType WRITE setCurrentProjectionType NOTIFY currentProjectionTypeChanged)
63  Q_PROPERTY(QString currentProjectionNameI18n READ getCurrentProjectionNameI18n NOTIFY currentProjectionNameI18nChanged STORED false)
64 
65 public:
66 
69  enum FrameType
70  {
77  FrameJ2000,
82  };
83 
87  {
98  };
99 
103  {
107  };
108 
112  {
116  IAU,
145  };
146 
147  StelCore();
148  virtual ~StelCore();
149 
151  void init();
152 
155  void update(double deltaTime);
156 
158  void windowHasBeenResized(float x, float y, float width, float height);
159 
161  void preDraw();
162 
164  void postDraw();
165 
169 
172  StelProjectorP getProjection(FrameType frameType, RefractionMode refractionMode=RefractionAuto) const;
173 
177 
181  const StelToneReproducer* getToneReproducer() const;
182 
186  const StelSkyDrawer* getSkyDrawer() const;
187 
189  const StelGeodesicGrid* getGeodesicGrid(int maxLevel) const;
190 
194  const StelMovementMgr* getMovementMgr() const;
195 
197  void setClippingPlanes(double znear, double zfar);
199  void getClippingPlanes(double* zn, double* zf) const;
200 
202  QString projectionTypeKeyToNameI18n(const QString& key) const;
203 
205  QString projectionNameI18nToTypeKey(const QString& nameI18n) const;
206 
211 
213  void lookAtJ2000(const Vec3d& pos, const Vec3d& up);
214 
215  Vec3d altAzToEquinoxEqu(const Vec3d& v, RefractionMode refMode=RefractionAuto) const;
216  Vec3d equinoxEquToAltAz(const Vec3d& v, RefractionMode refMode=RefractionAuto) const;
217  Vec3d altAzToJ2000(const Vec3d& v, RefractionMode refMode=RefractionAuto) const;
218  Vec3d j2000ToAltAz(const Vec3d& v, RefractionMode refMode=RefractionAuto) const;
219  void j2000ToAltAzInPlaceNoRefraction(Vec3f* v) const {v->transfo4d(matJ2000ToAltAz);}
220  Vec3d galacticToJ2000(const Vec3d& v) const;
221  Vec3d supergalacticToJ2000(const Vec3d& v) const;
226  Vec3d equinoxEquToJ2000(const Vec3d& v, RefractionMode refMode=RefractionAuto) const;
228  Vec3d j2000ToJ1875(const Vec3d& v) const;
233  Vec3d j2000ToEquinoxEqu(const Vec3d& v, RefractionMode refMode=RefractionAuto) const;
234  Vec3d j2000ToGalactic(const Vec3d& v) const;
235  Vec3d j2000ToSupergalactic(const Vec3d& v) const;
236 
239 
242 // //! Transform vector from heliocentric coordinate to false equatorial : equatorial
243 // //! coordinate but centered on the observer position (useful for objects close to earth)
244 // //! Unused as of V0.13
245 // Vec3d heliocentricEclipticToEarthPosEquinoxEqu(const Vec3d& v) const;
246 
249 
252 
255 
258 
261 
264 
267 
270 
272  static const Mat4d matJ2000ToVsop87;
274  static const Mat4d matVsop87ToJ2000;
276  static const Mat4d matJ2000ToGalactic;
278  static const Mat4d matGalacticToJ2000;
283 
286 
288  const StelLocation& getCurrentLocation() const;
290  float getUTCOffset(const double JD) const;
291 
292  QString getCurrentTimeZone() const;
293  void setCurrentTimeZone(const QString& tz);
294 
295  const QSharedPointer<class Planet> getCurrentPlanet() const;
296 
300  const StelObserver* getCurrentObserver() const;
301 
303  void setObserver(StelObserver* obs);
304 
305  SphericalCap getVisibleSkyArea() const;
306 
307  // Conversion in standard Julian time format
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;
314 
317  double getLocalSiderealTime() const;
318 
320  double getLocalSiderealDayLength() const;
321 
323  double getLocalSiderealYearLength() const;
324 
327  QString getStartupTimeMode();
328  void setStartupTimeMode(const QString& s);
329 
334  QString getCurrentDeltaTAlgorithmValidRangeDescription(const double JD, QString* marker) const;
335 
339  bool isBrightDaylight() const;
340 
342  double getCurrentEpoch() const;
343 
345  QString getDefaultProjectionTypeKey(void) const;
346 
347  Vec3d getMouseJ2000Pos(void) const;
348 
349 public slots:
355  void moveObserverTo(const StelLocation& target, double duration=1., double durationIfPlanetChange=1.);
356 
359  ProjectionType getCurrentProjectionType() const;
360 
362  QString getCurrentProjectionTypeKey(void) const;
364  void setCurrentProjectionTypeKey(QString type);
365 
366  QString getCurrentProjectionNameI18n() const;
367 
369  QStringList getAllProjectionTypeKeys() const;
370 
374  DeltaTAlgorithm getCurrentDeltaTAlgorithm() const { return currentDeltaTAlgorithm; }
376  QString getCurrentDeltaTAlgorithmDescription(void) const;
378  QString getCurrentDeltaTAlgorithmKey(void) const;
380  void setCurrentDeltaTAlgorithmKey(QString type);
381 
384 
387  void setFlagGravityLabels(bool gravity);
389  void setDefaultAngleForGravityText(float a);
392  void setFlipHorz(bool flip);
395  void setFlipVert(bool flip);
398  bool getFlipHorz(void) const;
401  bool getFlipVert(void) const;
402 
403  //New for 0.15: Vertical offset should even be available for animation, so at last with property mechanism.
406  double getViewportHorizontalOffset(void) const;
410  void setViewportHorizontalOffset(double newOffsetPct);
413  double getViewportVerticalOffset(void) const;
418  void setViewportVerticalOffset(double newOffsetPct);
419  // Set both viewport offsets. Arguments will be clamped to be inside [-50...50]. I (GZ) hope this will avoid some of the shaking.
420  void setViewportOffset(double newHorizontalOffsetPct, double newVerticalOffsetPct);
421 
425  void setViewportStretch(float stretch);
426 
428  QString getDefaultLocationID() const;
430  void setDefaultLocationID(const QString& id);
434  void returnToHome();
435 
437  double getJDOfLastJDUpdate() const;
441  void setMilliSecondsOfLastJDUpdate(qint64 millis);
443  qint64 getMilliSecondsOfLastJDUpdate() const;
444 
446  void setJD(double newJD);
450  void setJDE(double newJDE);
452  double getJD() const;
456  double getJDE() const;
457 
462  double getSolutionEquationOfTime(const double JDE) const;
463 
464  bool getUseDST() const;
465  void setUseDST(const bool b);
466 
467  bool getUseCustomTimeZone(void) const;
468  void setUseCustomTimeZone(const bool b);
469 
473  void setMJDay(double MJD);
475  double getMJDay() const;
476 
490 
491  double computeDeltaT(const double JD);
493  double getDeltaT() const;
494 
496  bool getUseNutation() const {return flagUseNutation;}
498  void setUseNutation(bool use) { if (flagUseNutation != use) { flagUseNutation=use; emit flagUseNutationChanged(use); }}
499 
501  bool getUseTopocentricCoordinates() const {return flagUseTopocentricCoordinates;}
503  void setUseTopocentricCoordinates(bool use) { if (flagUseTopocentricCoordinates!= use) { flagUseTopocentricCoordinates=use; emit flagUseTopocentricCoordinatesChanged(use); }}
504 
506  double getPresetSkyTime() const;
508  void setPresetSkyTime(double d);
509 
511  void setTimeRate(double ts);
513  double getTimeRate() const;
514 
515  void revertTimeDirection(void);
516 
518  void increaseTimeSpeed();
520  void decreaseTimeSpeed();
522  void increaseTimeSpeedLess();
524  void decreaseTimeSpeedLess();
525 
527  void setZeroTimeSpeed();
529  void setRealTimeSpeed();
531  void toggleRealTimeSpeed();
533  bool getRealTimeSpeed() const;
534 
536  void setTimeNow();
538  void setTodayTime(const QTime& target);
540  bool getIsTimeNow() const;
541 
543  QTime getInitTodayTime(void);
545  void setInitTodayTime(const QTime& time);
547  void setPresetSkyTime(QDateTime dateTime);
548 
550  void addMinute();
552  void addHour();
554  void addDay();
556  void addWeek();
557 
560  void addSiderealDay();
563  void addSiderealWeek();
567  void addSiderealYear();
571  void addSiderealYears(float n=100.f);
572 
574  void subtractMinute();
576  void subtractHour();
578  void subtractDay();
580  void subtractWeek();
581 
584  void subtractSiderealDay();
587  void subtractSiderealWeek();
591  void subtractSiderealYear();
595  void subtractSiderealYears(float n=100.f);
596 
598  void addSynodicMonth();
599 
601  void addSaros();
602 
604  void addDraconicYear();
606  void addDraconicMonth();
607 
609  void addAnomalisticMonth();
611  void addAnomalisticYear();
613  void addAnomalisticYears(float n=100.f);
614 
616  void addMeanTropicalMonth();
618  void addMeanTropicalYear();
620  void addMeanTropicalYears(float n=100.f);
622  void addTropicalYear();
623 
625  void addJulianYear();
627  void addJulianYears(float n=100.f);
628 
631  void addGaussianYear();
632 
634  void subtractSynodicMonth();
635 
637  void subtractSaros();
638 
640  void subtractDraconicYear();
642  void subtractDraconicMonth();
643 
649  void subtractAnomalisticYears(float n=100.f);
650 
656  void subtractMeanTropicalYears(float n=100.f);
658  void subtractTropicalYear();
659 
661  void subtractJulianYear();
663  void subtractJulianYears(float n=100.f);
664 
666  void subtractGaussianYear();
667 
670  void addSolarDays(double d);
674  void addSiderealDays(double d);
675 
678  void moveObserverToSelected();
679 
682  void setDeltaTCustomYear(float y) { deltaTCustomYear=y; }
685  void setDeltaTCustomNDot(float v) { deltaTCustomNDot=v; }
688  void setDeltaTCustomEquationCoefficients(Vec3f c) { deltaTCustomEquationCoeff=c; }
689 
691  float getDeltaTCustomYear() const { return deltaTCustomYear; }
693  float getDeltaTCustomNDot() const { return deltaTCustomNDot; }
695  float getDeltaTnDot() const { return deltaTnDot; }
697  Vec3f getDeltaTCustomEquationCoefficients() const { return deltaTCustomEquationCoeff; }
698 
701 
702  bool de430IsAvailable();
703  bool de431IsAvailable();
704  bool de430IsActive();
705  bool de431IsActive();
706  void setDe430Active(bool status);
707  void setDe431Active(bool status);
708 
713  QString getIAUConstellation(const Vec3d positionEqJnow) const;
714 
715 
716 signals:
722  void timeRateChanged(double rate);
726  void timeSyncOccurred(double jDay);
728  void dateChanged();
730  void flipHorzChanged(bool b);
732  void flipVertChanged(bool b);
734  void flagUseNutationChanged(bool b);
740  void currentProjectionTypeKeyChanged(const QString& newValue);
742  void currentProjectionNameI18nChanged(const QString& newValue);
743 
744 private:
745  StelToneReproducer* toneReproducer; // Tones conversion between stellarium world and display device
746  StelSkyDrawer* skyDrawer;
747  StelMovementMgr* movementMgr; // Manage vision movements
748 
749  // Manage geodesic grid
750  mutable StelGeodesicGrid* geodesicGrid;
751 
752  // The currently used projection type
753  ProjectionType currentProjectionType;
754 
755  // The currentrly used time correction (DeltaT)
756  DeltaTAlgorithm currentDeltaTAlgorithm;
757 
758  // Parameters to use when creating new instances of StelProjector
759  StelProjector::StelProjectorParams currentProjectorParams;
760 
761  void updateTransformMatrices();
762  void updateTime(double deltaTime);
763  void updateMaximumFov();
764  void resetSync();
765 
766  void registerMathMetaTypes();
767 
768 
769  // Matrices used for every coordinate transfo
770  Mat4d matHeliocentricEclipticJ2000ToAltAz; // Transform from heliocentric ecliptic Cartesian (VSOP87A) to topocentric (StelObserver) altazimuthal coordinate
771  Mat4d matAltAzToHeliocentricEclipticJ2000; // Transform from topocentric (StelObserver) altazimuthal coordinate to heliocentric ecliptic Cartesian (VSOP87A)
772  Mat4d matAltAzToEquinoxEqu; // Transform from topocentric altazimuthal coordinate to Earth Equatorial
773  Mat4d matEquinoxEquToAltAz; // Transform from Earth Equatorial to topocentric (StelObserver) altazimuthal coordinate
774  Mat4d matHeliocentricEclipticToEquinoxEqu; // Transform from heliocentric ecliptic Cartesian (VSOP87A) to earth equatorial coordinate
775  Mat4d matEquinoxEquToJ2000; // For Earth, this is almost the inverse precession matrix, =Rz(VSOPbias)Rx(eps0)Rz(-psiA)Rx(-omA)Rz(chiA)
776  Mat4d matJ2000ToEquinoxEqu; // precession matrix
777  static Mat4d matJ2000ToJ1875; // Precession matrix for IAU constellation lookup.
778 
779  Mat4d matJ2000ToAltAz;
780  Mat4d matAltAzToJ2000;
781 
782  Mat4d matAltAzModelView; // Modelview matrix for observer-centric altazimuthal drawing
783  Mat4d invertMatAltAzModelView; // Inverted modelview matrix for observer-centric altazimuthal drawing
784 
785  // Position variables
786  StelObserver* position;
787  // The ID of the default startup location
788  QString defaultLocationID;
789 
790  // flag to indicate we want to use nutation (the small-scale wobble of earth's axis)
791  bool flagUseNutation;
792  // flag to indicate that we show topocentrically corrected coordinates. (Switching to false for planetocentric coordinates is new for 0.14)
793  bool flagUseTopocentricCoordinates;
794 
795  // Time variables
796  double timeSpeed; // Positive : forward, Negative : Backward, 1 = 1sec/sec
797  //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 had to subtract getDeltaT() explicitly.
798  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 better just call getJDE()
799  // Use is best with calls getJD()/setJD() and getJDE()/setJDE() to explicitly state which flavour of JD you need.
800  double presetSkyTime;
801  QTime initTodayTime;
802  QString startupTimeMode;
803  double milliSecondsOfLastJDUpdate; // Time in seconds when the time rate or time last changed
804  double jdOfLastJDUpdate; // JD when the time rate or time last changed
805 
806  QString currentTimeZone;
807  bool flagUseDST;
808  bool flagUseCTZ; // custom time zone
809 
810  // Variables for equations of DeltaT
811  Vec3f deltaTCustomEquationCoeff;
812  float deltaTCustomNDot;
813  float deltaTCustomYear;
814  float deltaTnDot; // The currently applied nDot correction. (different per algorithm, and displayed in status line.)
815  bool deltaTdontUseMoon; // true if the currenctly selected algorithm does not do a lunar correction (?????)
816  double (*deltaTfunc)(const double JD); // This is a function pointer which must be set to a function which computes DeltaT(JD).
817  int deltaTstart; // begin year of validity range for the selected DeltaT algorithm. (SET INT_MIN to mark infinite)
818  int deltaTfinish; // end year of validity range for the selected DeltaT algorithm. (Set INT_MAX to mark infinite)
819 
820  // Variables for DE430/431 ephem calculation
821  bool de430Available; // ephem file found
822  bool de431Available; // ephem file found
823  bool de430Active; // available and user-activated.
824  bool de431Active; // available and user-activated.
825 };
826 
827 #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.
Definition: StelCore.hpp:135
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.
double getViewportHorizontalOffset(void) const
Get current value for horizontal viewport offset [-50...50] An offset of 50 percent means projective ...
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.
Definition: StelCore.hpp:129
Never add refraction (i.e. geometric coordinates)
Definition: StelCore.hpp:106
StelProjector::ModelViewTranformP getAltAzModelViewTransform(RefractionMode refMode=RefractionAuto) const
Get the modelview matrix for observer-centric altazimuthal drawing.
Always add refraction (i.e. apparent coordinates)
Definition: StelCore.hpp:105
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 addSaros()
Add one saros (223 synodic months) 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)
Definition: StelCore.hpp:374
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) ...
Definition: StelCore.hpp:142
QStringList getAllProjectionTypeKeys() const
Get the list of all the available projections.
Banjevic (2006) algorithm for DeltaT.
Definition: StelCore.hpp:140
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).
Definition: StelCore.hpp:272
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)
Definition: StelCore.hpp:138
Vec3f getDeltaTCustomEquationCoefficients() const
Get coefficients for custom equation for calculation of DeltaT.
Definition: StelCore.hpp:697
void decreaseTimeSpeed()
Decrease the time speed.
Fisheye projection.
Definition: StelCore.hpp:90
void addSiderealWeek()
Add seven sidereal days to the simulation time.
Miller cylindrical projection.
Definition: StelCore.hpp:96
bool getUseTopocentricCoordinates() const
Definition: StelCore.hpp:501
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 subtractSaros()
Subtract one saros (223 synodic months) to the simulation time.
void subtractDay()
Subtract one [Earth, solar] day to the current simulation time.
Cylinder projection.
Definition: StelCore.hpp:97
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.
Definition: StelCore.hpp:117
Equatorial reference frame at the J2000 equinox centered on the observer. This is also the ICRS refer...
Definition: StelCore.hpp:79
void subtractJulianYear()
Subtract one Julian year to the simulation time.
Morrison & Stephenson (2004, 2005) algorithm for DeltaT.
Definition: StelCore.hpp:136
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.
Definition: StelCore.hpp:137
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.
Definition: StelCore.hpp:89
A SphericalCap is defined by a direction and an aperture.
IAU (1952) algorithm for DeltaT (based on observations by Spencer Jones (1939))
Definition: StelCore.hpp:116
static const Mat4d matVsop87ToJ2000
Rotation matrix from ecliptic (VSOP87A) to equatorial J2000.
Definition: StelCore.hpp:274
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.
Definition: StelCore.hpp:120
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
Definition: StelCore.hpp:496
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...
Definition: StelCore.hpp:75
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
static const Mat4d matSupergalacticToJ2000
Rotation matrix from Supergalactic to J2000 reference frame.
Definition: StelCore.hpp:282
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...
Definition: StelCore.hpp:71
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.
Definition: StelCore.hpp:128
static const Mat4d matJ2000ToSupergalactic
Rotation matrix from J2000 to Supergalactic reference frame.
Definition: StelCore.hpp:280
Stephenson, Morrison, Hohenkerk (2016) RSPA paper provides spline fit to observations for -720...
Definition: StelCore.hpp:143
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.
Definition: StelCore.hpp:693
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.
Definition: StelCore.hpp:121
DeltaTAlgorithm
Available DeltaT algorithms.
Definition: StelCore.hpp:111
StelSkyDrawer * getSkyDrawer()
Get the current StelSkyDrawer used in the core.
Stephenson (1997) algorithm for DeltaT.
Definition: StelCore.hpp:130
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.
Definition: StelCore.hpp:126
void addJulianYears(float n=100.f)
Add n Julian years to the simulation time.
Montenbruck & Pfleger (2000) algorithm for DeltaT.
Definition: StelCore.hpp:134
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.
Definition: VecMath.hpp:35
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.
Definition: StelCore.hpp:125
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) ...
Definition: StelCore.hpp:141
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.
Definition: StelCore.hpp:63
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.
Definition: StelCore.hpp:69
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.
Definition: StelCore.hpp:76
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.
Definition: StelCore.hpp:691
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.
Mercator projection.
Definition: StelCore.hpp:95
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.
Definition: StelCore.hpp:93
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.
Definition: StelCore.hpp:86
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.
Perspective projection.
Definition: StelCore.hpp:88
void setMaskType(StelProjector::StelProjectorMaskType m)
Set the mask type.
Morrison & Stephenson (1982) algorithm for DeltaT (used by RedShift)
Definition: StelCore.hpp:122
void addSiderealDays(double d)
Add a number of sidereal days to the current simulation time, based on the observer body&#39;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.
Definition: StelCore.hpp:113
static const Mat4d matJ2000ToGalactic
Rotation matrix from J2000 to Galactic reference frame, using FITS convention.
Definition: StelCore.hpp:276
Stephenson & Houlden (1986) algorithm for DeltaT.
Definition: StelCore.hpp:124
void targetLocationChanged(StelLocation)
This signal is emitted whenever the targetted location changes.
float getDeltaTnDot() const
Get n-dot for current DeltaT algorithm.
Definition: StelCore.hpp:695
QString getIAUConstellation(const Vec3d positionEqJnow) const
Return 3-letter abbreviation of IAU constellation name for position in equatorial coordinates on the ...
void setTimeNow()
Set stellarium time to current real world time.
void addAnomalisticMonth()
Add one anomalistic month to the simulation time.
void subtractSiderealWeek()
Subtract seven sidereal days to the simulation time.
Tuckerman (1962, 1964) & Goldstine (1973) algorithm for DeltaT.
Definition: StelCore.hpp:118
void subtractAnomalisticMonth()
Subtract one anomalistic month to the simulation time.
void setDeltaTCustomEquationCoefficients(Vec3f c)
Set coefficients for custom equation for calculation of DeltaT.
Definition: StelCore.hpp:688
void setInitTodayTime(const QTime &time)
set the initial "today time" from the config file
Muller & Stephenson (1975) algorithm for DeltaT.
Definition: StelCore.hpp:119
Fixed-ecliptic reference frame centered on the Observer. GZ: was ObservercentricEcliptic, but renamed because it is Ecliptic of J2000!
Definition: StelCore.hpp:74
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.
Definition: StelCore.hpp:81
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.
Definition: StelCore.hpp:80
void subtractDraconicYear()
Subtract one draconic year to the simulation time.
void setDeltaTCustomYear(float y)
Set central year for custom equation for calculation of DeltaT.
Definition: StelCore.hpp:682
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.
Definition: StelCore.hpp:104
void subtractMeanTropicalMonth()
Subtract one mean tropical month to the simulation time.
Meeus & Simons (2000) algorithm for DeltaT.
Definition: StelCore.hpp:133
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&#39;s axis...
Definition: StelCore.hpp:503
Contains all the param needed to initialize a StelProjector.
Stephenson & Morrison (1984) algorithm for DeltaT.
Definition: StelCore.hpp:123
QString getCurrentProjectionTypeKey(void) const
Get the current Mapping used by the Projection.
Clemence (1948) algorithm for DeltaT.
Definition: StelCore.hpp:115
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...
Fixed-ecliptic reference frame centered on the Sun. GZ: This is J2000 ecliptical / almost VSOP87...
Definition: StelCore.hpp:73
Schoch (1931) algorithm for DeltaT.
Definition: StelCore.hpp:114
Altazimuthal reference frame centered on observer.
Definition: StelCore.hpp:72
void postDraw()
Update core state after drawing modules.
void increaseTimeSpeed()
Increase the time speed.
Sinusoidal projection.
Definition: StelCore.hpp:94
Schmadel & Zech (1988) algorithm for DeltaT.
Definition: StelCore.hpp:127
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.
Definition: StelCore.hpp:132
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)
Definition: StelCore.hpp:139
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).
Equal Area projection.
Definition: StelCore.hpp:92
void setDeltaTCustomNDot(float v)
Set n-dot for custom equation for calculation of DeltaT.
Definition: StelCore.hpp:685
void increaseTimeSpeedLess()
Increase the time speed, but not as much as with increaseTimeSpeed()
StelMovementMgr * getMovementMgr()
Get the instance of movement manager.
RefractionMode
Available refraction mode.
Definition: StelCore.hpp:102
static const Mat4d matGalacticToJ2000
Rotation matrix from Galactic to J2000 reference frame, using FITS convention.
Definition: StelCore.hpp:278
void setUseNutation(bool use)
Set whether you want computation and simulation of nutation (a slight wobble of Earth&#39;s axis...
Definition: StelCore.hpp:498
void subtractSiderealDay()
Subtract one sidereal day to the simulation time.
double getViewportVerticalOffset(void) const
Get current value for vertical viewport offset [-50...50] An offset of 50 percent means projective im...
QString currentProjectionTypeKey
This is just another way to access the projection type, by string instead of enum.
Definition: StelCore.hpp:61
void moveObserverTo(const StelLocation &target, double duration=1., double durationIfPlanetChange=1.)
Smoothly move the observer to the given location.
Orthographic projection.
Definition: StelCore.hpp:91
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.
Definition: StelCore.hpp:131
bool getRealTimeSpeed() const
Get whether it is real time speed, i.e. 1 sec/sec.
User defined coefficients for quadratic equation for DeltaT.
Definition: StelCore.hpp:144
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)