![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
00001 /* 00002 * Stellarium 00003 * Copyright (C) 2002 Fabien Chereau 00004 * Copyright (c) 2010 Bogdan Marinov 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 */ 00020 00021 #ifndef _SOLARSYSTEM_HPP_ 00022 #define _SOLARSYSTEM_HPP_ 00023 //sun is already defined in Sun C/Solaris 00024 #if defined(sun) 00025 #undef sun 00026 #endif 00027 00028 #include <QFont> 00029 #include "StelObjectModule.hpp" 00030 #include "StelTextureTypes.hpp" 00031 #include "Planet.hpp" 00032 00033 class Orbit; 00034 class StelTranslator; 00035 class StelObject; 00036 class StelCore; 00037 class StelProjector; 00038 class StelNavigator; 00039 class QSettings; 00040 00041 typedef QSharedPointer<Planet> PlanetP; 00042 00046 class SolarSystem : public StelObjectModule 00047 { 00048 Q_OBJECT 00049 00050 public: 00051 SolarSystem(); 00052 virtual ~SolarSystem(); 00053 00055 // Methods defined in the StelModule class 00061 virtual void init(); 00062 00067 virtual void draw(StelCore *core); 00068 00071 virtual void update(double deltaTime); 00072 00074 virtual void updateI18n(); 00075 00077 virtual void selectedObjectChangeCallBack(StelModuleSelectAction action=StelModule::ReplaceSelection); 00078 00080 virtual void setStelStyle(const QString& section); 00081 00083 virtual double getCallOrder(StelModuleActionName actionName) const; 00084 00086 // Methods defined in StelObjectManager class 00095 virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const; 00096 00100 virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; 00101 00105 virtual StelObjectP searchByName(const QString& name) const; 00106 00113 virtual QStringList listMatchingObjectsI18n(const QString& objPrefix, int maxNbItem=5) const; 00114 00115 public slots: 00117 // Method callable from script and GUI 00118 // Properties setters and getters 00120 void setFlagPlanets(bool b); 00122 bool getFlagPlanets() const; 00123 00125 void setFlagTrails(bool b); 00127 bool getFlagTrails() const; 00128 00130 void setFlagHints(bool b); 00132 bool getFlagHints() const; 00133 00135 void setFlagLabels(bool b); 00137 bool getFlagLabels() const; 00138 00142 void setLabelsAmount(float a) {labelsAmount=a;} 00145 float getLabelsAmount(void) const {return labelsAmount;} 00146 00148 void setFlagOrbits(bool b); 00150 bool getFlagOrbits() const {return flagOrbits;} 00151 00153 void setFlagLightTravelTime(bool b); 00156 bool getFlagLightTravelTime(void) const {return flagLightTravelTime;} 00157 00159 void setFontSize(float newFontSize); 00160 00162 void setLabelsColor(const Vec3f& c); 00164 const Vec3f& getLabelsColor(void) const; 00165 00167 void setOrbitsColor(const Vec3f& c); 00169 Vec3f getOrbitsColor(void) const; 00170 00172 void setTrailsColor(const Vec3f& c) {trailColor=c;} 00174 Vec3f getTrailsColor() const {return trailColor;} 00175 00177 void setFlagMoonScale(bool b); 00179 bool getFlagMoonScale(void) const {return flagMoonScale;} 00180 00182 void setMoonScale(float f); 00184 float getMoonScale(void) const {return moonScale;} 00185 00186 public: 00188 // Other public methods 00192 PlanetP searchByEnglishName(QString planetEnglishName) const; 00193 00195 PlanetP getSun() const {return sun;} 00196 00198 PlanetP getEarth() const {return earth;} 00199 00201 PlanetP getMoon() const {return moon;} 00202 00204 bool nearLunarEclipse(); 00205 00207 QStringList getAllPlanetEnglishNames() const; 00208 00210 void reloadPlanets(); 00211 00213 // DEPRECATED 00219 QString getPlanetHashString(); 00220 00226 void computePositions(double date, const Vec3d& observerPos = Vec3d(0.)); 00227 00230 const QList<PlanetP>& getAllPlanets() const {return systemPlanets;} 00231 00232 private: 00238 StelObjectP search(Vec3d v, const StelCore* core) const; 00239 00242 void computeTransMatrices(double date, const Vec3d& observerPos = Vec3d(0.)); 00243 00245 void drawPointer(const StelCore* core); 00246 00251 void loadPlanets(); 00252 00254 bool loadPlanets(const QString& filePath); 00255 00256 void recreateTrails(); 00257 00258 PlanetP sun; 00259 PlanetP moon; 00260 PlanetP earth; 00261 00264 void setSelected(const QString& englishName); 00266 void setSelected(PlanetP obj); 00268 PlanetP getSelected(void) const {return selected;} 00270 PlanetP selected; 00271 00272 // Moon scale value 00273 bool flagMoonScale; 00274 float moonScale; 00275 00276 QFont planetNameFont; 00277 00279 float labelsAmount; 00280 00282 QList<PlanetP> systemPlanets; 00283 00284 // Master settings 00285 bool flagOrbits; 00286 bool flagLightTravelTime; 00287 00289 StelTextureSP texPointer; 00290 00291 bool flagShow; 00292 00293 class TrailGroup* allTrails; 00294 LinearFader trailFader; 00295 Vec3f trailColor; 00296 00298 // DEPRECATED 00300 QList<Orbit*> orbits; // Pointers on created elliptical orbits 00301 }; 00302 00303 00304 #endif // _SOLARSYSTEM_HPP_