StelCore.hpp   StelCore.hpp 
skipping to change at line 51 skipping to change at line 51
//! various StelModules to update and display themself. //! various StelModules to update and display themself.
//! 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
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 flipVert READ getFlipVert WRITE setFlipVert)
public: public:
//! @enum FrameType //! @enum FrameType
//! Supported reference frame types //! Supported reference frame types
enum FrameType enum FrameType
{ {
FrameUninitialized, //!< Reference frame is not set (FMajerech: Added to avoid condition on uninitialized value in StelSkyL ayerMgr::draw()) FrameUninitialized, //!< Reference frame is not set (FMajerech: Added to avoid condition on uninitialized value in StelSkyL ayerMgr::draw())
FrameAltAz, //!< Altazimuthal reference frame centered on observer. FrameAltAz, //!< Altazimuthal reference frame centered on observer.
FrameHeliocentricEcliptic, //!< Ecliptic reference fram e centered on the Sun FrameHeliocentricEcliptic, //!< Ecliptic reference fram e centered on the Sun
FrameObservercentricEcliptic, //!< Ecliptic reference fram e centered on the Observer FrameObservercentricEcliptic, //!< Ecliptic reference fram e centered on the Observer
FrameEquinoxEqu, //!< Equatorial reference fr ame at the current equinox centered on the observer. FrameEquinoxEqu, //!< Equatorial reference fr ame at the current equinox centered on the observer.
//! The north pole follows t he precession of the planet on which the observer is located. //! The north pole follows t he precession of the planet on which the observer is located.
FrameJ2000, //!< Equatorial reference fr ame at the J2000 equinox centered on the observer. FrameJ2000, //!< Equatorial reference fr ame at the J2000 equinox centered on the observer.
//! This is also the ICRS re ference frame. //! This is also the ICRS re ference frame.
FrameGalactic //! Galactic reference frame centered on observer. FrameGalactic //! Galactic reference frame centered on observer.
}; };
//! @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
}; };
//! @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)
}; };
//! @enum DeltaTAlgorithm //! @enum DeltaTAlgorithm
//! Available DeltaT algorithms //! Available DeltaT algorithms
skipping to change at line 128 skipping to change at line 132
EspenakMeeus, //!< Espenak & Meeus (2006) algorithm for DeltaT (Recommended, default) EspenakMeeus, //!< Espenak & Meeus (2006) algorithm for DeltaT (Recommended, default)
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)
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.
void init(class StelRenderer* renderer); void init();
//! Update all the objects with respect to the time. //! Update all the objects with respect to the time.
//! @param deltaTime the time increment in sec. //! @param deltaTime the time increment in sec.
void update(double deltaTime); void update(double deltaTime);
//! Handle the resizing of the window //! Handle the resizing of the window
void windowHasBeenResized(float x, float y, float width, float heigh t); void windowHasBeenResized(float x, float y, float width, float heigh t);
//! 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(StelRenderer* renderer); 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 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 ormatione.
skipping to change at line 196 skipping to change at line 200
//! Set the set of parameters to use when creating a new StelProject or. //! Set the set of parameters to use when creating a new StelProject or.
void setCurrentStelProjectorParams(const StelProjector::StelProjecto rParams& newParams); void setCurrentStelProjectorParams(const StelProjector::StelProjecto rParams& newParams);
//! Set vision direction //! Set vision direction
void lookAtJ2000(const Vec3d& pos, const Vec3d& up); void lookAtJ2000(const Vec3d& pos, const Vec3d& up);
Vec3d altAzToEquinoxEqu(const Vec3d& v, RefractionMode refMode=Refra ctionAuto) const; Vec3d altAzToEquinoxEqu(const Vec3d& v, RefractionMode refMode=Refra ctionAuto) const;
Vec3d equinoxEquToAltAz(const Vec3d& v, RefractionMode refMode=Refra ctionAuto) const; Vec3d equinoxEquToAltAz(const Vec3d& v, RefractionMode refMode=Refra ctionAuto) const;
Vec3d altAzToJ2000(const Vec3d& v, RefractionMode refMode=Refraction Auto) const; Vec3d altAzToJ2000(const Vec3d& v, RefractionMode refMode=Refraction Auto) const;
Vec3d j2000ToAltAz(const Vec3d& v, RefractionMode refMode=Refraction Auto) const; Vec3d j2000ToAltAz(const Vec3d& v, RefractionMode refMode=Refraction Auto) const;
void j2000ToAltAzInPlaceNoRefraction(Vec3f* v) const {v->transfo4d(m atJ2000ToAltAz);}
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;
skipping to change at line 245 skipping to change at line 250
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;
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 standar 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;
//! 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 getLocalSideralTime() 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 getLocalSideralDayLength() 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 getLocalSideralYearLength() const; double getLocalSiderealYearLength() const;
//! Return the startup mode, can be preset|Preset or anything else //! Return the startup mode, can be preset|Preset or anything else
QString getStartupTimeMode(); QString getStartupTimeMode();
void setStartupTimeMode(const QString& s); void setStartupTimeMode(const QString& s);
//! Get Delta-T estimation for a given date. //! Get Delta-T estimation for a given date.
//! @param jDay the date and time expressed as a julian day //! @param jDay the date and time expressed as a julian day
//! @return Delta-T in seconds //! @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 //! @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; double getDeltaT(double jDay) const;
skipping to change at line 492 skipping to change at line 500
//! 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 year for custom equation for calculation of Delta-T
//! @param y the year, e.g. 1820 //! @param y the year, e.g. 1820
void setCustomYear(float y) { customYear=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 setCustomNDot(float v) { customNDot=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 setCustomEquationCoefficients(Vec3f c) { customEquationCoeff=c; } void setDeltaTCustomEquationCoefficients(Vec3f c) { deltaTCustomEqua tionCoeff=c; }
//! Get year for custom equation for calculation of Delta-T //! Get year for custom equation for calculation of Delta-T
float getCustomYear() const { return customYear; } 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 getCustomNDot() const { return customNDot; } 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 getCustomEquationCoefficients() const { return customEquationC oeff; } 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
void timeRateChanged(double rate); void timeRateChanged(double rate);
private: private:
StelToneReproducer* toneConverter; // Tones conversion between stellarium world and display device StelToneReproducer* toneConverter; // Tones conversion between stellarium world and display device
StelSkyDrawer* skyDrawer; StelSkyDrawer* skyDrawer;
skipping to change at line 532 skipping to change at line 540
ProjectionType currentProjectionType; ProjectionType currentProjectionType;
// The currentrly used time correction (DeltaT) // The currentrly used time correction (DeltaT)
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();
// Matrices used for every coordinate transfo // Matrices used for every coordinate transfo
Mat4d matHeliocentricEclipticToAltAz; // Transform from helioce ntric ecliptic (Vsop87) to observer-centric altazimuthal coordinate Mat4d matHeliocentricEclipticToAltAz; // Transform from helioce ntric ecliptic (Vsop87) to observer-centric altazimuthal coordinate
Mat4d matAltAzToHeliocentricEcliptic; // Transform from observe r-centric altazimuthal coordinate to heliocentric ecliptic (Vsop87) Mat4d matAltAzToHeliocentricEcliptic; // Transform from observe r-centric altazimuthal coordinate to heliocentric ecliptic (Vsop87)
Mat4d matAltAzToEquinoxEqu; // Transform from observe r-centric altazimuthal coordinate to Earth Equatorial Mat4d matAltAzToEquinoxEqu; // Transform from observe r-centric altazimuthal coordinate to Earth Equatorial
Mat4d matEquinoxEquToAltAz; // Transform from observe r-centric altazimuthal coordinate to Earth Equatorial Mat4d matEquinoxEquToAltAz; // Transform from observe r-centric altazimuthal coordinate to Earth Equatorial
Mat4d matHeliocentricEclipticToEquinoxEqu; // Transform from helioce ntric ecliptic (Vsop87) to earth equatorial coordinate Mat4d matHeliocentricEclipticToEquinoxEqu; // Transform from helioce ntric ecliptic (Vsop87) to earth equatorial coordinate
Mat4d matEquinoxEquToJ2000; Mat4d matEquinoxEquToJ2000;
Mat4d matJ2000ToEquinoxEqu; Mat4d matJ2000ToEquinoxEqu;
Mat4d matJ2000ToAltAz; Mat4d matJ2000ToAltAz;
skipping to change at line 557 skipping to change at line 566
StelObserver* position; StelObserver* position;
// The ID of the default startup location // The ID of the default startup location
QString defaultLocationID; QString defaultLocationID;
// 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; // Curent time in Julian day
double presetSkyTime; double presetSkyTime;
QTime initTodayTime; QTime initTodayTime;
QString startupTimeMode; QString startupTimeMode;
double secondsOfLastJDayUpdate; // Time in seconds when the
time rate or time last changed
double JDayOfLastJDayUpdate; // JDay when the time rate or t
ime last changed
// Variables for custom equation of Delta-T // Variables for custom equation of Delta-T
Vec3f customEquationCoeff; Vec3f deltaTCustomEquationCoeff;
float customNDot; float deltaTCustomNDot;
float customYear; float deltaTCustomYear;
}; };
#endif // _STELCORE_HPP_ #endif // _STELCORE_HPP_
 End of changes. 20 change blocks. 
14 lines changed or deleted 27 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/