Planet.hpp   Planet.hpp 
skipping to change at line 78 skipping to change at line 78
const float radiusMax; const float radiusMax;
StelTextureSP tex; StelTextureSP tex;
}; };
class Planet : public StelObject class Planet : public StelObject
{ {
public: public:
friend class SolarSystem; friend class SolarSystem;
Q_ENUMS(PlanetType) Q_ENUMS(PlanetType)
Q_ENUMS(ApparentMagnitudeAlgorithm)
//! numeric typecodes for the type descriptions in ssystem.ini //! numeric typecodes for the type descriptions in ssystem.ini
// GZ: Until 0.13 QStrings were used for types. // GZ: Until 0.13 QStrings were used for types.
// GZ: Enums are slightly faster than string comparisons in time-cri tical comparisons. // GZ: Enums are slightly faster than string comparisons in time-cri tical comparisons.
// GZ: If other types are introduced, add here and the string in ini t(). // GZ: If other types are introduced, add here and the string in ini t().
enum PlanetType enum PlanetType
{ {
isStar, // ssystem.ini: type="star" isStar, // ssystem.ini: type="star"
isPlanet, // ssystem.ini: type="planet" isPlanet, // ssystem.ini: type="planet"
isMoon, // ssystem.ini: type="moon" isMoon, // ssystem.ini: type="moon"
isAsteroid, // ssystem.ini: type="asteroid" isAsteroid, // ssystem.ini: type="asteroid"
isPlutoid, // ssystem.ini: type="plutoid" isPlutino, // ssystem.ini: type="plutino"
isComet, // ssystem.ini: type="comet" isComet, // ssystem.ini: type="comet"
isDwarfPlanet, // ssystem.ini: type="dwarf planet
"
isCubewano, // ssystem.ini: type="cubewano"
isSDO, // ssystem.ini: type="sdo"
isOCO, // ssystem.ini: type="oco"
isUNDEFINED // ssystem.ini: type=<anything els e> isUNDEFINED // ssystem.ini: type=<anything els e>
}; };
enum ApparentMagnitudeAlgorithm
{
Planesas, // Algorithm provided by Pere Planesas (Obse
rvatorio Astronomico Nacional)
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)
UndefinedAlgorithm
};
Planet(const QString& englishName, Planet(const QString& englishName,
int flagLighting, int flagLighting,
double radius, double radius,
double oblateness, double oblateness,
Vec3f color, Vec3f color,
float albedo, float albedo,
const QString& texMapName, const QString& texMapName,
const QString& normalMapName, const QString& normalMapName,
posFuncType _coordFunc, posFuncType _coordFunc,
void* userDataPtr, void* userDataPtr,
skipping to change at line 140 skipping to change at line 153
//! @return a QString containing an HMTL encoded description of the Planet. //! @return a QString containing an HMTL encoded description of the Planet.
virtual QString getInfoString(const StelCore *core, const InfoString Group& flags) const; virtual QString getInfoString(const StelCore *core, const InfoString Group& flags) const;
virtual double getCloseViewFov(const StelCore* core) const; virtual double getCloseViewFov(const StelCore* core) const;
virtual double getSatellitesFov(const StelCore* core) const; virtual double getSatellitesFov(const StelCore* core) const;
virtual double getParentSatellitesFov(const StelCore* core) const; virtual double getParentSatellitesFov(const StelCore* core) const;
virtual float getVMagnitude(const StelCore* core) const; virtual float getVMagnitude(const StelCore* core) const;
virtual float getSelectPriority(const StelCore* core) const; virtual float getSelectPriority(const StelCore* core) const;
virtual Vec3f getInfoColor(void) const; virtual Vec3f getInfoColor(void) const;
virtual QString getType(void) const {return "Planet";} virtual QString getType(void) const {return "Planet";}
virtual Vec3d getJ2000EquatorialPos(const StelCore *core) const; virtual Vec3d getJ2000EquatorialPos(const StelCore *core) const;
virtual QString getEnglishName(void) const {return englishName;} virtual QString getEnglishName(void) const;
virtual QString getNameI18n(void) const {return nameI18;} virtual QString getNameI18n(void) const;
virtual double getAngularSize(const StelCore* core) const; virtual double getAngularSize(const StelCore* core) const;
virtual bool hasAtmosphere(void) {return atmosphere;} virtual bool hasAtmosphere(void) {return atmosphere;}
virtual bool hasHalo(void) {return halo;} virtual bool hasHalo(void) {return halo;}
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods of SolarSystem object // Methods of SolarSystem object
//! Translate planet name using the passed translator //! Translate planet name using the passed translator
virtual void translateName(const StelTranslator &trans); virtual void translateName(const StelTranslator &trans);
// Draw the Planet // Draw the Planet
skipping to change at line 172 skipping to change at line 185
//! 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; }
ApparentMagnitudeAlgorithm getApparentMagnitudeAlgorithm() const { r
eturn vMagAlgorithm; }
const QString getApparentMagnitudeAlgorithmString() const { return v
MagAlgorithmMap.value(vMagAlgorithm); }
void setApparentMagnitudeAlgorithm(QString algorithm);
// Compute the z rotation to use from equatorial to geographic coord inates // Compute the z rotation to use from equatorial to geographic coord inates
double getSiderealTime(double jd) const; double getSiderealTime(double jd) 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 dateJD);
virtual void computePosition(const double dateJD);// GZ: gets overri //virtual void computePosition(const double dateJD);// GZ: gets over
dden in Comet! ridden in Comet!
void computePosition(const double dateJD);// GZ: gets overridden in
Comet!
// Compute the transformation matrix from the local Planet coordinat e to the parent Planet coordinate // Compute the transformation matrix from the local Planet coordinat e to the parent Planet coordinate
void computeTransMatrix(double date); void computeTransMatrix(double date);
// 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;
skipping to change at line 226 skipping to change at line 246
void setRings(Ring* r) {rings = r;} void setRings(Ring* r) {rings = r;}
void setSphereScale(float s) {sphereScale = s;} void setSphereScale(float s) {sphereScale = s;}
float getSphereScale(void) const {return sphereScale;} float getSphereScale(void) const {return sphereScale;}
const QSharedPointer<Planet> getParent(void) const {return parent;} const QSharedPointer<Planet> getParent(void) const {return parent;}
static void setLabelColor(const Vec3f& lc) {labelColor = lc;} static void setLabelColor(const Vec3f& lc) {labelColor = lc;}
static const Vec3f& getLabelColor(void) {return labelColor;} static const Vec3f& getLabelColor(void) {return labelColor;}
// update displayed elements. @param deltaTime: ms (?) // update displayed elements. @param deltaTime: ms (since last call)
void update(int deltaTime); virtual void update(int deltaTime);
void setFlagHints(bool b){hintFader = b;} void setFlagHints(bool b){hintFader = b;}
bool getFlagHints(void) const {return hintFader;} bool getFlagHints(void) const {return hintFader;}
void setFlagLabels(bool b){flagLabels = b;} void setFlagLabels(bool b){flagLabels = b;}
bool getFlagLabels(void) const {return flagLabels;} bool getFlagLabels(void) const {return flagLabels;}
bool flagNativeName;
void setFlagNativeName(bool b) { flagNativeName = b; }
bool getFlagNativeName(void) { return flagNativeName; }
bool flagTranslatedName;
void setFlagTranslatedName(bool b) { flagTranslatedName = b; }
bool getFlagTranslatedName(void) { return flagTranslatedName; }
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// 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
skipping to change at line 280 skipping to change at line 308
void draw3dModel(StelCore* core, StelProjector::ModelViewTranformP t ransfo, float screenSz, bool drawOnlyRing=false); void draw3dModel(StelCore* core, StelProjector::ModelViewTranformP t ransfo, float screenSz, bool drawOnlyRing=false);
// Draw the 3D sphere // Draw the 3D sphere
void drawSphere(StelPainter* painter, float screenSz, bool drawOnlyR ing=false); void drawSphere(StelPainter* painter, float screenSz, bool drawOnlyR ing=false);
// Draw the circle and name of the Planet // Draw the circle and name of the Planet
void drawHints(const StelCore* core, const QFont& planetNameFont); void drawHints(const StelCore* core, const QFont& planetNameFont);
QString englishName; // english planet name QString englishName; // english planet name
QString nameI18; // International translated name QString nameI18; // International translated name
QString nativeName; // Can be used in a skyculture
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.
skipping to change at line 316 skipping to change at line 345
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?
// QString pTypeStr; // Type of body, old versio PlanetType pType; // Type of body
n just had a string here.
PlanetType pType; // GZ this is now a proper type... ApparentMagnitudeAlgorithm vMagAlgorithm;
static Vec3f labelColor; static Vec3f labelColor;
static StelTextureSP hintCircleTex; static StelTextureSP hintCircleTex;
static QMap<PlanetType, QString> pTypeMap; // GZ: maps fast type to static QMap<PlanetType, QString> pTypeMap; // Maps fast type to engl
english name. ish name.
static QMap<ApparentMagnitudeAlgorithm, QString> vMagAlgorithmMap;
// Shader-related variables // Shader-related variables
struct PlanetShaderVars { struct PlanetShaderVars {
int projectionMatrix; int projectionMatrix;
int texCoord; int texCoord;
int unprojectedVertex; int unprojectedVertex;
int vertex; int vertex;
int texture; int texture;
int lightDirection; int lightDirection;
int eyeDirection; int eyeDirection;
skipping to change at line 365 skipping to change at line 396
struct MoonShaderVars : public PlanetShaderVars { struct MoonShaderVars : public PlanetShaderVars {
// Moon-specific variables // Moon-specific variables
int earthShadow; int earthShadow;
int normalMap; int normalMap;
}; };
static MoonShaderVars moonShaderVars; static MoonShaderVars moonShaderVars;
static QOpenGLShaderProgram* moonShaderProgram; static QOpenGLShaderProgram* moonShaderProgram;
static void initShader(); static void initShader();
static void deinitShader(); static void deinitShader();
}; };
#endif // _PLANET_HPP_ #endif // _PLANET_HPP_
 End of changes. 13 change blocks. 
13 lines changed or deleted 49 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/