Planet.hpp   Planet.hpp 
skipping to change at line 36 skipping to change at line 36
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelTextureTypes.hpp" #include "StelTextureTypes.hpp"
#include "StelProjectorType.hpp" #include "StelProjectorType.hpp"
#include <QString> #include <QString>
// The callback type for the external position computation function // The callback type for the external position computation function
// The last variable is the userData pointer. // The last variable is the userData pointer.
typedef void (*posFuncType)(double, double*, void*); typedef void (*posFuncType)(double, double*, void*);
typedef void (OsculatingFunctType)(double jd0,double jd,double xyz[3]); typedef void (OsculatingFunctType)(double jde0,double jde,double xyz[3]);
// epoch J2000: 12 UT on 1 Jan 2000 // epoch J2000: 12 UT on 1 Jan 2000
#define J2000 2451545.0 #define J2000 2451545.0
#define ORBIT_SEGMENTS 360 #define ORBIT_SEGMENTS 360
class StelFont; class StelFont;
class StelPainter; class StelPainter;
class StelTranslator; class StelTranslator;
class QOpenGLShaderProgram; class QOpenGLShaderProgram;
// Class used to store rotational elements, i.e. axis orientation for the p lanetary body. // Class used to store rotational elements, i.e. axis orientation for the p lanetary body.
class RotationElements class RotationElements
{ {
public: public:
RotationElements(void) : period(1.), offset(0.), epoch(J2000), obliq uity(0.), ascendingNode(0.), precessionRate(0.), siderealPeriod(0.) {} RotationElements(void) : period(1.), offset(0.), epoch(J2000), obliq uity(0.), ascendingNode(0.), precessionRate(0.), siderealPeriod(0.) {}
float period; // (sidereal) rotation period [earth days] float period; // (sidereal) rotation period [earth days]
float offset; // rotation at epoch [degrees] float offset; // rotation at epoch [degrees]
double epoch; // JD (TD) of epoch for these elements double epoch; // JDE (JD TT) of epoch for these elements
float obliquity; // tilt of rotation axis w.r.t. ecliptic [rad ians] float obliquity; // tilt of rotation axis w.r.t. ecliptic [rad ians]
float ascendingNode; // long. of ascending node of equator on the ecliptic [radians] float ascendingNode; // long. of ascending node of equator on the ecliptic [radians]
float precessionRate; // rate of precession of rotation axis in [ra ds/JulianCentury(36525d)] float precessionRate; // rate of precession of rotation axis in [ra ds/JulianCentury(36525d)]
double siderealPeriod; // sidereal period (Planet year in earth days ) [earth days] double siderealPeriod; // sidereal period (Planet year in earth days ) [earth days]
}; };
// Class to manage rings for planets like saturn // Class to manage rings for planets like saturn
class Ring class Ring
{ {
public: public:
skipping to change at line 111 skipping to change at line 111
Mueller, // G. Mueller, based on visual observations 1877-91. [Expl.Suppl.1961] Mueller, // G. Mueller, based on visual observations 1877-91. [Expl.Suppl.1961]
Harris, // Astronomical Almanac 1984 and later. Thes e give V (instrumental) magnitudes (D.L. Harris) Harris, // Astronomical Almanac 1984 and later. Thes e give V (instrumental) magnitudes (D.L. Harris)
UndefinedAlgorithm, UndefinedAlgorithm,
Generic // Visual magnitude based on phase angle and albedo Generic // Visual magnitude based on phase angle and albedo
}; };
Planet(const QString& englishName, Planet(const QString& englishName,
int flagLighting, int flagLighting,
double radius, double radius,
double oblateness, double oblateness,
Vec3f color, Vec3f halocolor,
float albedo, float albedo,
const QString& texMapName, const QString& texMapName,
const QString& normalMapName, const QString& normalMapName,
posFuncType _coordFunc, posFuncType _coordFunc,
void* userDataPtr, void* userDataPtr,
OsculatingFunctType *osculatingFunc, OsculatingFunctType *osculatingFunc,
bool closeOrbit, bool closeOrbit,
bool hidden, bool hidden,
bool hasAtmosphere, bool hasAtmosphere,
bool hasHalo, bool hasHalo,
skipping to change at line 174 skipping to change at line 174
// Draw the Planet // Draw the Planet
// GZ Made that virtual to allow comets having their own draw(). // GZ Made that virtual to allow comets having their own draw().
virtual void draw(StelCore* core, float maxMagLabels, const QFont& p lanetNameFont); virtual void draw(StelCore* core, float maxMagLabels, const QFont& p lanetNameFont);
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods specific to Planet // Methods specific to Planet
//! Get the radius of the planet in AU. //! Get the radius of the planet in AU.
//! @return the radius of the planet in astronomical units. //! @return the radius of the planet in astronomical units.
double getRadius(void) const {return radius;} double getRadius(void) const {return radius;}
//! Get the value (1-f) for oblateness f.
double getOneMinusOblateness(void) const {return oneMinusOblateness;
}
//! Get duration of sidereal day //! Get duration of sidereal day
double getSiderealDay(void) const {return re.period;} double getSiderealDay(void) const {return re.period;}
//! Get duration of sidereal year //! Get duration of sidereal year
// GZ: made that virtual for Comets. // GZ: made that virtual for Comets.
virtual double getSiderealPeriod(void) const { return re.siderealPer iod; } virtual double getSiderealPeriod(void) const { return re.siderealPer iod; }
//! Get duration of mean solar day //! Get duration of mean solar day
double getMeanSolarDay(void) const; double getMeanSolarDay(void) const;
const QString& getTextMapName() const {return texMapName;} const QString& getTextMapName() const {return texMapName;}
const QString getPlanetTypeString() const {return pTypeMap.value(pTy pe);} const QString getPlanetTypeString() const {return pTypeMap.value(pTy pe);}
PlanetType getPlanetType() const {return pType;} PlanetType getPlanetType() const {return pType;}
void setNativeName(QString planet) { nativeName = planet; } void setNativeName(QString planet) { nativeName = planet; }
ApparentMagnitudeAlgorithm getApparentMagnitudeAlgorithm() const { r eturn vMagAlgorithm; } ApparentMagnitudeAlgorithm getApparentMagnitudeAlgorithm() const { r eturn vMagAlgorithm; }
const QString getApparentMagnitudeAlgorithmString() const { return v MagAlgorithmMap.value(vMagAlgorithm); } const QString getApparentMagnitudeAlgorithmString() const { return v MagAlgorithmMap.value(vMagAlgorithm); }
void setApparentMagnitudeAlgorithm(QString algorithm); void setApparentMagnitudeAlgorithm(QString algorithm);
// Compute the z rotation to use from equatorial to geographic coord //! Compute the z rotation to use from equatorial to geographic coor
inates dinates. For general applicability we need both time flavours:
double getSiderealTime(double jd) const; //! @param JD is JD(UT) for Earth
//! @param JDE is used for other locations
double getSiderealTime(double JD, double JDE) const;
Mat4d getRotEquatorialToVsop87(void) const; Mat4d getRotEquatorialToVsop87(void) const;
void setRotEquatorialToVsop87(const Mat4d &m); void setRotEquatorialToVsop87(const Mat4d &m);
const RotationElements &getRotationElements(void) const {return re;} const RotationElements &getRotationElements(void) const {return re;}
// Compute the position in the parent Planet coordinate system // Compute the position in the parent Planet coordinate system
void computePositionWithoutOrbits(const double dateJD); void computePositionWithoutOrbits(const double dateJDE);
//virtual void computePosition(const double dateJD);// GZ: gets over void computePosition(const double dateJDE);
ridden in Comet!
void computePosition(const double dateJD);// GZ: gets overridden in
Comet!
// Compute the transformation matrix from the local Planet coordinat // Compute the transformation matrix from the local Planet coordinat
e to the parent Planet coordinate e to the parent Planet coordinate.
void computeTransMatrix(double date); // This requires both flavours of JD in cases involving Earth.
void computeTransMatrix(double JD, double JDE);
// Get the phase angle (rad) for an observer at pos obsPos in helioc entric coordinates (in AU) // Get the phase angle (rad) for an observer at pos obsPos in helioc entric coordinates (in AU)
double getPhaseAngle(const Vec3d& obsPos) const; double getPhaseAngle(const Vec3d& obsPos) const;
// Get the elongation angle (rad) for an observer at pos obsPos in h eliocentric coordinates (in AU) // Get the elongation angle (rad) for an observer at pos obsPos in h eliocentric coordinates (in AU)
double getElongation(const Vec3d& obsPos) const; double getElongation(const Vec3d& obsPos) const;
// Get the angular size of the spheroid of the planet (i.e. without the rings) // Get the angular size of the spheroid of the planet (i.e. without the rings)
double getSpheroidAngularSize(const StelCore* core) const; double getSpheroidAngularSize(const StelCore* core) const;
// Get the planet phase for an observer at pos obsPos in heliocentri c coordinates (in AU) // Get the planet phase for an observer at pos obsPos in heliocentri c coordinates (in AU)
float getPhase(const Vec3d& obsPos) const; float getPhase(const Vec3d& obsPos) const;
// Set the orbital elements // Set the orbital elements
void setRotationElements(float _period, float _offset, double _epoch , void setRotationElements(float _period, float _offset, double _epoch ,
float _obliquity, float _ascendingNode, float _obliquity, float _ascendingNode,
float _precessionRate, double _siderealPeri od); float _precessionRate, double _siderealPeri od);
double getRotAscendingnode(void) const {return re.ascendingNode;} double getRotAscendingnode(void) const {return re.ascendingNode;}
double getRotObliquity(double JDay) const; // return angle between axis and normal of ecliptic plane (or, for a
moon, equatorial/reference plane defined by parent).
// TODO: decide if this is always angle between axis and J2000 eclip
tic, or should be axis//current ecliptic!
double getRotObliquity(double JDE) const;
//! Get the Planet position in the parent Planet ecliptic coordinate in AU //! Get the Planet position in the parent Planet ecliptic coordinate in AU
Vec3d getEclipticPos() const; Vec3d getEclipticPos() const;
// Return the heliocentric ecliptical position // Return the heliocentric ecliptical position
Vec3d getHeliocentricEclipticPos() const; Vec3d getHeliocentricEclipticPos() const;
// Return the heliocentric transformation for local coordinate // Return the heliocentric transformation for local coordinate
Vec3d getHeliocentricPos(Vec3d) const; Vec3d getHeliocentricPos(Vec3d) const;
void setHeliocentricEclipticPos(const Vec3d &pos); void setHeliocentricEclipticPos(const Vec3d &pos);
skipping to change at line 275 skipping to change at line 281
// DEPRECATED // DEPRECATED
///// Orbit related code ///// Orbit related code
// Should move to an OrbitPath class which works on a SolarSystemObj ect, not a Planet // Should move to an OrbitPath class which works on a SolarSystemObj ect, not a Planet
void setFlagOrbits(bool b){orbitFader = b;} void setFlagOrbits(bool b){orbitFader = b;}
bool getFlagOrbits(void) const {return orbitFader;} bool getFlagOrbits(void) const {return orbitFader;}
LinearFader orbitFader; LinearFader orbitFader;
// draw orbital path of Planet // draw orbital path of Planet
void drawOrbit(const StelCore*); void drawOrbit(const StelCore*);
Vec3d orbit[ORBIT_SEGMENTS+1]; // store heliocentric coordinates f or drawing the orbit Vec3d orbit[ORBIT_SEGMENTS+1]; // store heliocentric coordinates f or drawing the orbit
Vec3d orbitP[ORBIT_SEGMENTS+1]; // store local coordinate for orbit Vec3d orbitP[ORBIT_SEGMENTS+1]; // store local coordinate for orbit
double lastOrbitJD; double lastOrbitJDE;
double deltaJD; // time difference between position double deltaJDE; // time difference between position
al updates. al updates.
double deltaOrbitJD; double deltaOrbitJDE;
bool orbitCached; // whether orbit calculations are c ached for drawing orbit yet bool orbitCached; // whether orbit calculations are c ached for drawing orbit yet
bool closeOrbit; // whether to connect the beginning of the orbit line to bool closeOrbit; // whether to connect the beginning of the orbit line to
// the end: good for elliptical orb its, bad for parabolic // the end: good for elliptical orb its, bad for parabolic
// and hyperbolic orbits // and hyperbolic orbits
static Vec3f orbitColor; static Vec3f orbitColor;
static void setOrbitColor(const Vec3f& oc) {orbitColor = oc;} static void setOrbitColor(const Vec3f& oc) {orbitColor = oc;}
static const Vec3f& getOrbitColor() {return orbitColor;} static const Vec3f& getOrbitColor() {return orbitColor;}
//! Return the list of planets which project some shadow on this pla net //! Return the list of planets which project some shadow on this pla net
skipping to change at line 320 skipping to change at line 326
QString texMapName; // Texture file path QString texMapName; // Texture file path
QString normalMapName; // Texture file path QString normalMapName; // Texture file path
int flagLighting; // Set whether light computation ha s to be proceed int flagLighting; // Set whether light computation ha s to be proceed
RotationElements re; // Rotation param RotationElements re; // Rotation param
double radius; // Planet radius in AU double radius; // Planet radius in AU
double oneMinusOblateness; // (polar radius)/(equatorial radiu s) double oneMinusOblateness; // (polar radius)/(equatorial radiu s)
Vec3d eclipticPos; // Position in AU in the rectangula r ecliptic coordinate system Vec3d eclipticPos; // Position in AU in the rectangula r ecliptic coordinate system
// centered on the parent Planet // centered on the parent Planet
Vec3d screenPos; // Used to store temporarily the 2D position on screen Vec3d screenPos; // Used to store temporarily the 2D position on screen
Vec3d previousScreenPos; // The position of this planet in t he previous frame. Vec3d previousScreenPos; // The position of this planet in t he previous frame.
Vec3f color; // exclusively used for drawing the planet halo Vec3f haloColor; // exclusively used for drawing the planet halo
float albedo; // Planet albedo. Used for magnitud e computation (but formula dubious!) float albedo; // Planet albedo. Used for magnitud e computation (but formula dubious!)
Mat4d rotLocalToParent; Mat4d rotLocalToParent; // GZ2015: was undocumented.
float axisRotation; // Rotation angle of the Planet on // Apparently this is the axis orie
it's axis ntation with respect to the parent body. For planets, this is axis orientat
ion w.r.t. VSOP87A/J2000 ecliptical system.
float axisRotation; // Rotation angle of the Planet on
its axis.
// For Earth, this should be Greenw
ich Mean Sidereal Time GMST.
StelTextureSP texMap; // Planet map texture StelTextureSP texMap; // Planet map texture
StelTextureSP normalMap; // Planet normal map texture StelTextureSP normalMap; // Planet normal map texture
Ring* rings; // Planet rings Ring* rings; // Planet rings
double distance; // Temporary variable used to store the distance to a given point double distance; // Temporary variable used to store the distance to a given point
// it is used for sorting while dra wing // it is used for sorting while dra wing
float sphereScale; // Artificial scaling for better vi ewing float sphereScale; // Artificial scaling for better vi ewing
double lastJD; // caches JD of last positional com double lastJDE; // caches JDE of last positional co
putation mputation
// The callback for the calculation of the equatorial rect heliocent // The callback for the calculation of the equatorial rect heliocent
ric position at time JD. ric position at time JDE.
posFuncType coordFunc; posFuncType coordFunc;
void* userDataPtr; void* userDataPtr; // this is always used with an Orbi t object.
OsculatingFunctType *const osculatingFunc; OsculatingFunctType *const osculatingFunc;
QSharedPointer<Planet> parent; // Planet parent i.e. sun f or earth QSharedPointer<Planet> parent; // Planet parent i.e. sun f or earth
QList<QSharedPointer<Planet> > satellites; // satellites of the Planet QList<QSharedPointer<Planet> > satellites; // satellites of the Planet
LinearFader hintFader; LinearFader hintFader;
LinearFader labelsFader; // Store the current state of the l abel for this planet LinearFader labelsFader; // Store the current state of the l abel for this planet
bool flagLabels; // Define whether labels should be displayed bool flagLabels; // Define whether labels should be displayed
bool hidden; // useful for fake planets used as observation positions - not drawn or labeled bool hidden; // useful for fake planets used as observation positions - not drawn or labeled
bool atmosphere; // Does the planet have an atmosphe re? bool atmosphere; // Does the planet have an atmosphe re?
bool halo; // Does the planet have a halo? bool halo; // Does the planet have a halo?
 End of changes. 13 change blocks. 
28 lines changed or deleted 40 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/