SolarSystem.hpp   SolarSystem.hpp 
skipping to change at line 28 skipping to change at line 28
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _SOLARSYSTEM_HPP_ #ifndef _SOLARSYSTEM_HPP_
#define _SOLARSYSTEM_HPP_ #define _SOLARSYSTEM_HPP_
//sun is already defined in Sun C/Solaris //sun is already defined in Sun C/Solaris
#if defined(sun) #if defined(sun)
#undef sun #undef sun
#endif #endif
#include <QFont>
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "StelTextureTypes.hpp"
#include "Planet.hpp" #include "Planet.hpp"
#include <QFont>
class Orbit; class Orbit;
class StelTranslator; class StelTranslator;
class StelObject; class StelObject;
class StelCore; class StelCore;
class StelProjector; class StelProjector;
class QSettings; class QSettings;
typedef QSharedPointer<Planet> PlanetP; typedef QSharedPointer<Planet> PlanetP;
//! @class SolarSystem //! @class SolarSystem
//! This StelObjectModule derivative is used to model SolarSystem bodies. //! This StelObjectModule derivative is used to model SolarSystem bodies.
//! This includes the Major Planets, Minor Planets and Comets. //! This includes the Major Planets, Minor Planets and Comets.
class SolarSystem : public StelObjectModule class SolarSystem : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool labelsDisplayed
READ getFlagLabels
WRITE setFlagLabels)
Q_PROPERTY(bool orbitsDisplayed
READ getFlagOrbits
WRITE setFlagOrbits)
Q_PROPERTY(bool trailsDisplayed
READ getFlagTrails
WRITE setFlagTrails)
public: public:
SolarSystem(); SolarSystem();
virtual ~SolarSystem(); virtual ~SolarSystem();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
//! Initialize the SolarSystem. //! Initialize the SolarSystem.
//! Includes: //! Includes:
//! - loading planetary body orbital and model data from data/ssyste m.ini //! - loading planetary body orbital and model data from data/ssyste m.ini
//! - perform initial planet position calculation //! - perform initial planet position calculation
//! - set display options from application settings //! - set display options from application settings
virtual void init(); virtual void init();
virtual void deinit();
//! Draw SolarSystem objects (planets). //! Draw SolarSystem objects (planets).
//! @param core The StelCore object. //! @param core The StelCore object.
//! @param renderer Renderer to use for drawing.
//! @return The maximum squared distance in pixels that any SolarSys tem object //! @return The maximum squared distance in pixels that any SolarSys tem object
//! has travelled since the last update. //! has travelled since the last update.
virtual void draw(StelCore *core, class StelRenderer* renderer); virtual void draw(StelCore *core);
//! Update time-varying components. //! Update time-varying components.
//! This includes planet motion trails. //! This includes planet motion trails.
virtual void update(double deltaTime); virtual void update(double deltaTime);
//! Used to determine what order to draw the various StelModules. //! Used to determine what order to draw the various StelModules.
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in StelObjectManager class // Methods defined in StelObjectManager class
skipping to change at line 153 skipping to change at line 165
void setLabelsAmount(float a) {labelsAmount=a;} void setLabelsAmount(float a) {labelsAmount=a;}
//! Get the amount of planet labels. The real amount is also proport ional with FOV. //! Get the amount of planet labels. The real amount is also proport ional with FOV.
//! @return the amount between 0 and 10. 0 is no labels, 10 is maxim um of labels //! @return the amount between 0 and 10. 0 is no labels, 10 is maxim um of labels
float getLabelsAmount(void) const {return labelsAmount;} float getLabelsAmount(void) const {return labelsAmount;}
//! Set flag which determines if planet orbits are drawn or hidden. //! Set flag which determines if planet orbits are drawn or hidden.
void setFlagOrbits(bool b); void setFlagOrbits(bool b);
//! Get the current value of the flag which determines if planet orb its are drawn or hidden. //! Get the current value of the flag which determines if planet orb its are drawn or hidden.
bool getFlagOrbits() const {return flagOrbits;} bool getFlagOrbits() const {return flagOrbits;}
//! Set flag which determines if planet markers are drawn or hidden.
void setFlagMarkers(bool b) { flagMarker=b; }
//! Get the current value of the flag which determines if planet mar
kers are drawn or hidden.
bool getFlagMarkers() const {return flagMarker;}
//! Set flag which determines if the light travel time calculation i s used or not. //! Set flag which determines if the light travel time calculation i s used or not.
void setFlagLightTravelTime(bool b); void setFlagLightTravelTime(bool b);
//! Get the current value of the flag which determines if light trav el time //! Get the current value of the flag which determines if light trav el time
//! calculation is used or not. //! calculation is used or not.
bool getFlagLightTravelTime(void) const {return flagLightTravelTime; } bool getFlagLightTravelTime(void) const {return flagLightTravelTime; }
//! Set planet names font size. //! Set planet names font size.
void setFontSize(float newFontSize); void setFontSize(float newFontSize);
//! Set the color used to draw planet labels. //! Set the color used to draw planet labels.
//! @param c The color of the planet labels
//! @code
//! // example of usage in scripts
//! SolarSystem.setLabelsColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setLabelsColor(const Vec3f& c); void setLabelsColor(const Vec3f& c);
//! Get the current color used to draw planet labels. //! Get the current color used to draw planet labels.
const Vec3f& getLabelsColor(void) const; const Vec3f& getLabelsColor(void) const;
//! Set the color used to draw planet orbit lines. //! Set the color used to draw planet orbit lines.
//! @param c The color of the planet orbit lines
//! @code
//! // example of usage in scripts
//! SolarSystem.setOrbitsColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setOrbitsColor(const Vec3f& c); void setOrbitsColor(const Vec3f& c);
//! Get the current color used to draw planet orbit lines. //! Get the current color used to draw planet orbit lines.
Vec3f getOrbitsColor(void) const; Vec3f getOrbitsColor(void) const;
//! Set the color used to draw planet trails lines. //! Set the color used to draw planet trails lines.
//! @param c The color of the planet trails lines
//! @code
//! // example of usage in scripts
//! SolarSystem.setTrailsColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setTrailsColor(const Vec3f& c) {trailColor=c;} void setTrailsColor(const Vec3f& c) {trailColor=c;}
//! Get the current color used to draw planet trails lines. //! Get the current color used to draw planet trails lines.
Vec3f getTrailsColor() const {return trailColor;} Vec3f getTrailsColor() const {return trailColor;}
//! Set the color used to draw planet pointers.
//! @param c The color of the planet pointers
//! @code
//! // example of usage in scripts
//! SolarSystem.setPointersColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setPointersColor(const Vec3f& c) {pointerColor=c;}
//! Get the current color used to draw planet pointers.
Vec3f getPointersColor() const {return pointerColor;}
//! Set flag which determines if Earth's moon is scaled or not. //! Set flag which determines if Earth's moon is scaled or not.
void setFlagMoonScale(bool b); void setFlagMoonScale(bool b);
//! Get the current value of the flag which determines if Earth's mo on is scaled or not. //! Get the current value of the flag which determines if Earth's mo on is scaled or not.
bool getFlagMoonScale(void) const {return flagMoonScale;} bool getFlagMoonScale(void) const {return flagMoonScale;}
//! Set the display scaling factor for Earth's moon. //! Set the display scaling factor for Earth's moon.
void setMoonScale(float f); void setMoonScale(double f);
//! Get the display scaling factor for Earth's oon. //! Get the display scaling factor for Earth's oon.
float getMoonScale(void) const {return moonScale;} float getMoonScale(void) const {return moonScale;}
//! Translate names. (public so that SolarSystemEditor can call it). //! Translate names. (public so that SolarSystemEditor can call it).
void updateI18n(); void updateI18n();
//! Get the V magnitude for Solar system bodies from scripts //! Get the V magnitude for Solar system bodies from scripts
//! @param planetName the case in-sensistive English planet name. //! @param planetName the case in-sensistive English planet name.
//! @param withExtinction the flag for use extinction effect for mag nitudes (default not use) //! @param withExtinction the flag for use extinction effect for mag nitudes (default not use)
//! @return a magnitude //! @return a magnitude
float getPlanetVMagnitude(QString planetName, bool withExtinction=fa lse) const; float getPlanetVMagnitude(QString planetName) const;
//! Get distance to Solar system bodies from scripts //! Get distance to Solar system bodies from scripts
//! @param planetName the case in-sensistive English planet name. //! @param planetName the case in-sensistive English planet name.
//! @return a distance (in AU) //! @return a distance (in AU)
double getDistanceToPlanet(QString planetName) const; double getDistanceToPlanet(QString planetName) const;
//! Get elongation for Solar system bodies from scripts //! Get elongation for Solar system bodies from scripts
//! @param planetName the case in-sensistive English planet name. //! @param planetName the case in-sensistive English planet name.
//! @return a elongation (in radians) //! @return a elongation (in radians)
double getElongationForPlanet(QString planetName) const; double getElongationForPlanet(QString planetName) const;
skipping to change at line 245 skipping to change at line 287
//! Get the list of all the planet english names //! Get the list of all the planet english names
QStringList getAllPlanetEnglishNames() const; QStringList getAllPlanetEnglishNames() const;
//! Get the list of all the planet localized names //! Get the list of all the planet localized names
QStringList getAllPlanetLocalizedNames() const; QStringList getAllPlanetLocalizedNames() const;
//! Reload the planets //! Reload the planets
void reloadPlanets(); void reloadPlanets();
//! Determines relative amount of sun visible from the observer's po
sition.
double getEclipseFactor(const StelCore *core) const;
//////////////////////////////////////////////////////////////////// /////////////////// //////////////////////////////////////////////////////////////////// ///////////////////
// DEPRECATED // DEPRECATED
//////////////////////////////////////////////////////////////////// /////////////////// //////////////////////////////////////////////////////////////////// ///////////////////
//! Get a hash of locale and ssystem.ini names for use with the TUI. //! Get a hash of locale and ssystem.ini names for use with the TUI.
//! @return A newline delimited hash of localized:standard planet na mes. //! @return A newline delimited hash of localized:standard planet na mes.
//! Planet translated name is PARENT : NAME //! Planet translated name is PARENT : NAME
//! \deprecated ??? //! \deprecated ???
QString getPlanetHashString(); QString getPlanetHashString();
//! Compute the position and transform matrix for every element of t he solar system. //! Compute the position and transform matrix for every element of t he solar system.
skipping to change at line 287 skipping to change at line 326
//! @param v A position in earth equatorial position. //! @param v A position in earth equatorial position.
//! @param core the StelCore object. //! @param core the StelCore object.
//! @return a pointer to a StelObject if found, else NULL //! @return a pointer to a StelObject if found, else NULL
StelObjectP search(Vec3d v, const StelCore* core) const; StelObjectP search(Vec3d v, const StelCore* core) const;
//! Compute the transformation matrix for every elements of the sola r system. //! Compute the transformation matrix for every elements of the sola r system.
//! observerPos is needed for light travel time computation. //! observerPos is needed for light travel time computation.
void computeTransMatrices(double date, const Vec3d& observerPos = Ve c3d(0.)); void computeTransMatrices(double date, const Vec3d& observerPos = Ve c3d(0.));
//! Draw a nice animated pointer around the object. //! Draw a nice animated pointer around the object.
//! void drawPointer(const StelCore* core);
//! @param core The StelCore object.
//! @param renderer Renderer to draw with.
void drawPointer(const StelCore* core, class StelRenderer* renderer)
;
//! Load planet data from the Solar System configuration file. //! Load planet data from the Solar System configuration file.
//! This function attempts to load every possible instance of the //! This function attempts to load every possible instance of the
//! Solar System configuration file in the file paths, falling back if a //! Solar System configuration file in the file paths, falling back if a
//! given path can't be loaded. //! given path can't be loaded.
void loadPlanets(); void loadPlanets();
//! Load planet data from the given file //! Load planet data from the given file
bool loadPlanets(const QString& filePath); bool loadPlanets(const QString& filePath);
void recreateTrails(); void recreateTrails();
//! Calculates the shadow information for the shadow planet shader.
class StelTextureNew* computeShadowInfo(StelRenderer* renderer);
//! Used by computeShadowInfo to generate shadow info texture before
uploading it.
QVector<Vec4f> shadowInfoBuffer;
//! Used by computeShadowInfo to store computed planet model matrice
s used to generate the
//! shadow info texture.
QVector<Mat4d> shadowModelMatricesBuffer;
//! Used to count how many planets actually need shadow information //! Used to count how many planets actually need shadow information
int shadowPlanetCount; int shadowPlanetCount;
PlanetP sun; PlanetP sun;
PlanetP moon; PlanetP moon;
PlanetP earth; PlanetP earth;
//! Set selected planets by englishName. //! Set selected planets by englishName.
//! @param englishName The planet name or "" to select no planet //! @param englishName The planet name or "" to select no planet
void setSelected(const QString& englishName); void setSelected(const QString& englishName);
//! Set selected object from its pointer. //! Set selected object from its pointer.
void setSelected(PlanetP obj); void setSelected(PlanetP obj);
//! Get selected object's pointer. //! Get selected object's pointer.
skipping to change at line 347 skipping to change at line 372
float labelsAmount; float labelsAmount;
//! List of all the bodies of the solar system. //! List of all the bodies of the solar system.
QList<PlanetP> systemPlanets; QList<PlanetP> systemPlanets;
// Master settings // Master settings
bool flagOrbits; bool flagOrbits;
bool flagLightTravelTime; bool flagLightTravelTime;
//! The selection pointer texture. //! The selection pointer texture.
class StelTextureNew* texPointer; StelTextureSP texPointer;
bool flagShow; bool flagShow;
bool flagMarker;
class TrailGroup* allTrails; class TrailGroup* allTrails;
LinearFader trailFader; LinearFader trailFader;
Vec3f trailColor; Vec3f trailColor;
Vec3f pointerColor;
Planet::SharedPlanetGraphics sharedPlanetGraphics;
//////////////////////////////////////////////////////////////////// ////////////// //////////////////////////////////////////////////////////////////// //////////////
// DEPRECATED // DEPRECATED
//////////////////////////////////////////////////////////////////// ////////////// //////////////////////////////////////////////////////////////////// //////////////
QList<Orbit*> orbits; // Pointers on created elliptical or bits QList<Orbit*> orbits; // Pointers on created elliptical or bits
}; };
#endif // _SOLARSYSTEM_HPP_ #endif // _SOLARSYSTEM_HPP_
 End of changes. 21 change blocks. 
31 lines changed or deleted 53 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/