1 /*
2  * Stellarium
3  * Copyright (C) 2002 Fabien Chereau
4  * Copyright (c) 2010 Bogdan Marinov
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
19  */
20 
21 #ifndef SOLARSYSTEM_HPP
22 #define SOLARSYSTEM_HPP
23 //sun is already defined in Sun C/Solaris
24 #if defined(sun)
25 #undef sun
26 #endif
27 
28 #include "StelObjectModule.hpp"
29 #include "StelTextureTypes.hpp"
30 #include "Planet.hpp"
31 #include "StelGui.hpp"
32 #include "StelHips.hpp"
33 
34 #include <QFont>
35 
36 class Orbit;
37 class StelTranslator;
38 class StelObject;
39 class StelCore;
40 class StelProjector;
41 class QSettings;
42 
43 typedef QSharedPointer<Planet> PlanetP;
44 
45 //! @class SolarSystem
46 //! This StelObjectModule derivative is used to model SolarSystem bodies.
47 //! This includes the Major Planets (class Planet), Minor Planets (class MinorPlanet) and Comets (class Comet).
48 // GZ's documentation attempt, early 2017.
49 //! This class and the handling of solar system data has seen many changes, and unfortunately, not much has been consistently documented.
50 //! The following is a reverse-engineered analysis.
51 //!
52 class SolarSystem : public StelObjectModule
53 {
54 	Q_OBJECT
55 	// This is a "forwarding property" which sets labeling into all planets.
56 	Q_PROPERTY(bool labelsDisplayed			READ getFlagLabels			WRITE setFlagLabels			NOTIFY labelsDisplayedChanged)
57 	// was bool orbitsDisplayed
58 	Q_PROPERTY(bool flagOrbits			READ getFlagOrbits			WRITE setFlagOrbits			NOTIFY flagOrbitsChanged)
59 	Q_PROPERTY(bool trailsDisplayed			READ getFlagTrails			WRITE setFlagTrails			NOTIFY trailsDisplayedChanged)
60 	Q_PROPERTY(int maxTrailPoints			READ getMaxTrailPoints			WRITE setMaxTrailPoints			NOTIFY maxTrailPointsChanged)
61 	Q_PROPERTY(int maxTrailTimeExtent		READ getMaxTrailTimeExtent		WRITE setMaxTrailTimeExtent		NOTIFY maxTrailTimeExtentChanged)
62 	Q_PROPERTY(int trailsThickness			READ getTrailsThickness			WRITE setTrailsThickness		NOTIFY trailsThicknessChanged)
63 	// was bool hintsDisplayed. This is a "forwarding property" only, without own variable.
64 	Q_PROPERTY(bool flagHints			READ getFlagHints			WRITE setFlagHints			NOTIFY flagHintsChanged)
65 	// was bool pointersDisplayed
66 	Q_PROPERTY(bool flagPointer			READ getFlagPointer			WRITE setFlagPointer			NOTIFY flagPointerChanged)
67 	// was bool nativeNamesDisplayed
68 	Q_PROPERTY(bool flagNativePlanetNames		READ getFlagNativePlanetNames		WRITE setFlagNativePlanetNames		NOTIFY flagNativePlanetNamesChanged)
69 	Q_PROPERTY(bool planetsDisplayed		READ getFlagPlanets			WRITE setFlagPlanets			NOTIFY flagPlanetsDisplayedChanged)
70 	Q_PROPERTY(bool flagPlanetsOrbitsOnly		READ getFlagPlanetsOrbitsOnly		WRITE setFlagPlanetsOrbitsOnly		NOTIFY flagPlanetsOrbitsOnlyChanged)
71 	Q_PROPERTY(bool flagPermanentOrbits		READ getFlagPermanentOrbits		WRITE setFlagPermanentOrbits		NOTIFY flagPermanentOrbitsChanged)
72 	Q_PROPERTY(bool flagIsolatedOrbits		READ getFlagIsolatedOrbits		WRITE setFlagIsolatedOrbits		NOTIFY flagIsolatedOrbitsChanged)
73 	Q_PROPERTY(bool flagIsolatedTrails		READ getFlagIsolatedTrails		WRITE setFlagIsolatedTrails		NOTIFY flagIsolatedTrailsChanged)
74 	Q_PROPERTY(int numberIsolatedTrails		READ getNumberIsolatedTrails		WRITE setNumberIsolatedTrails		NOTIFY numberIsolatedTrailsChanged)
75 	Q_PROPERTY(bool flagLightTravelTime		READ getFlagLightTravelTime		WRITE setFlagLightTravelTime		NOTIFY flagLightTravelTimeChanged)
76 	Q_PROPERTY(bool flagUseObjModels		READ getFlagUseObjModels		WRITE setFlagUseObjModels		NOTIFY flagUseObjModelsChanged)
77 	Q_PROPERTY(bool flagShowObjSelfShadows		READ getFlagShowObjSelfShadows		WRITE setFlagShowObjSelfShadows		NOTIFY flagShowObjSelfShadowsChanged)
78 	Q_PROPERTY(bool flagMoonScale			READ getFlagMoonScale			WRITE setFlagMoonScale			NOTIFY flagMoonScaleChanged)
79 	Q_PROPERTY(double moonScale			READ getMoonScale			WRITE setMoonScale			NOTIFY moonScaleChanged)
80 	Q_PROPERTY(bool flagMinorBodyScale		READ getFlagMinorBodyScale		WRITE setFlagMinorBodyScale		NOTIFY flagMinorBodyScaleChanged)
81 	Q_PROPERTY(double minorBodyScale		READ getMinorBodyScale			WRITE setMinorBodyScale			NOTIFY minorBodyScaleChanged)
82 	Q_PROPERTY(bool flagPlanetScale			READ getFlagPlanetScale			WRITE setFlagPlanetScale		NOTIFY flagPlanetScaleChanged)
83 	Q_PROPERTY(double planetScale			READ getPlanetScale			WRITE setPlanetScale			NOTIFY planetScaleChanged)
84 	Q_PROPERTY(bool flagSunScale			READ getFlagSunScale			WRITE setFlagSunScale			NOTIFY flagSunScaleChanged)
85 	Q_PROPERTY(double sunScale			READ getSunScale			WRITE setSunScale			NOTIFY sunScaleChanged)
86 	Q_PROPERTY(double labelsAmount			READ getLabelsAmount			WRITE setLabelsAmount			NOTIFY labelsAmountChanged)
87 	Q_PROPERTY(bool flagPermanentSolarCorona	READ getFlagPermanentSolarCorona	WRITE setFlagPermanentSolarCorona	NOTIFY flagPermanentSolarCoronaChanged)
88 	// Ephemeris-related properties
89 	Q_PROPERTY(bool ephemerisMarkersDisplayed	READ getFlagEphemerisMarkers		WRITE setFlagEphemerisMarkers		NOTIFY ephemerisMarkersChanged)
90 	Q_PROPERTY(bool ephemerisHorizontalCoordinates	READ getFlagEphemerisHorizontalCoordinates	WRITE setFlagEphemerisHorizontalCoordinates	NOTIFY ephemerisHorizontalCoordinatesChanged)
91 	Q_PROPERTY(bool ephemerisDatesDisplayed		READ getFlagEphemerisDates		WRITE setFlagEphemerisDates		NOTIFY ephemerisDatesChanged)
92 	Q_PROPERTY(bool ephemerisMagnitudesDisplayed	READ getFlagEphemerisMagnitudes		WRITE setFlagEphemerisMagnitudes	NOTIFY ephemerisMagnitudesChanged)
93 	Q_PROPERTY(bool ephemerisLineDisplayed		READ getFlagEphemerisLine		WRITE setFlagEphemerisLine		NOTIFY ephemerisLineChanged)
94 	Q_PROPERTY(int ephemerisLineThickness		READ getEphemerisLineThickness		WRITE setEphemerisLineThickness		NOTIFY ephemerisLineThicknessChanged)
95 	Q_PROPERTY(bool ephemerisSkippedData		READ getFlagEphemerisSkipData		WRITE setFlagEphemerisSkipData		NOTIFY ephemerisSkipDataChanged)
96 	Q_PROPERTY(bool ephemerisSkippedMarkers		READ getFlagEphemerisSkipMarkers	WRITE setFlagEphemerisSkipMarkers	NOTIFY ephemerisSkipMarkersChanged)
97 	Q_PROPERTY(int ephemerisDataStep		READ getEphemerisDataStep		WRITE setEphemerisDataStep		NOTIFY ephemerisDataStepChanged)
98 	Q_PROPERTY(int ephemerisDataLimit		READ getEphemerisDataLimit		WRITE setEphemerisDataLimit		NOTIFY ephemerisDataLimitChanged)
99 	Q_PROPERTY(bool ephemerisSmartDates		READ getFlagEphemerisSmartDates		WRITE setFlagEphemerisSmartDates	NOTIFY ephemerisSmartDatesChanged)
100 	Q_PROPERTY(bool ephemerisScaleMarkersDisplayed	READ getFlagEphemerisScaleMarkers	WRITE setFlagEphemerisScaleMarkers	NOTIFY ephemerisScaleMarkersChanged)
101 	Q_PROPERTY(bool ephemerisAlwaysOn		READ getFlagEphemerisAlwaysOn		WRITE setFlagEphemerisAlwaysOn		NOTIFY ephemerisAlwaysOnChanged)
102 	// Great Red Spot (GRS) properties
103 	Q_PROPERTY(bool flagCustomGrsSettings		READ getFlagCustomGrsSettings		WRITE setFlagCustomGrsSettings		NOTIFY flagCustomGrsSettingsChanged)
104 	Q_PROPERTY(int customGrsLongitude		READ getCustomGrsLongitude		WRITE setCustomGrsLongitude		NOTIFY customGrsLongitudeChanged)
105 	Q_PROPERTY(double customGrsDrift		READ getCustomGrsDrift			WRITE setCustomGrsDrift			NOTIFY customGrsDriftChanged)
106 	Q_PROPERTY(double customGrsJD			READ getCustomGrsJD			WRITE setCustomGrsJD			NOTIFY customGrsJDChanged)
107 	// Eclipse algorithm properties
108 	Q_PROPERTY(bool earthShadowEnlargementDanjon    READ getFlagEarthShadowEnlargementDanjon    WRITE setFlagEarthShadowEnlargementDanjon   NOTIFY earthShadowEnlargementDanjonChanged)
109 	// Colors
110 	Q_PROPERTY(Vec3f labelsColor			READ getLabelsColor			WRITE setLabelsColor			NOTIFY labelsColorChanged)
111 	Q_PROPERTY(Vec3f pointerColor			READ getPointerColor			WRITE setPointerColor			NOTIFY pointerColorChanged)
112 	Q_PROPERTY(Vec3f trailsColor			READ getTrailsColor			WRITE setTrailsColor			NOTIFY trailsColorChanged)
113 	Q_PROPERTY(Vec3f orbitsColor			READ getOrbitsColor			WRITE setOrbitsColor			NOTIFY orbitsColorChanged)
114 	Q_PROPERTY(Vec3f majorPlanetsOrbitsColor	READ getMajorPlanetsOrbitsColor		WRITE setMajorPlanetsOrbitsColor	NOTIFY majorPlanetsOrbitsColorChanged)
115 	Q_PROPERTY(Vec3f minorPlanetsOrbitsColor	READ getMinorPlanetsOrbitsColor		WRITE setMinorPlanetsOrbitsColor	NOTIFY minorPlanetsOrbitsColorChanged)
116 	Q_PROPERTY(Vec3f dwarfPlanetsOrbitsColor	READ getDwarfPlanetsOrbitsColor		WRITE setDwarfPlanetsOrbitsColor	NOTIFY dwarfPlanetsOrbitsColorChanged)
117 	Q_PROPERTY(Vec3f moonsOrbitsColor		READ getMoonsOrbitsColor		WRITE setMoonsOrbitsColor		NOTIFY moonsOrbitsColorChanged)
118 	Q_PROPERTY(Vec3f cubewanosOrbitsColor		READ getCubewanosOrbitsColor		WRITE setCubewanosOrbitsColor		NOTIFY cubewanosOrbitsColorChanged)
119 	Q_PROPERTY(Vec3f plutinosOrbitsColor		READ getPlutinosOrbitsColor		WRITE setPlutinosOrbitsColor		NOTIFY plutinosOrbitsColorChanged)
120 	Q_PROPERTY(Vec3f scatteredDiskObjectsOrbitsColor	READ getScatteredDiskObjectsOrbitsColor		WRITE setScatteredDiskObjectsOrbitsColor	NOTIFY scatteredDiskObjectsOrbitsColorChanged)
121 	Q_PROPERTY(Vec3f oortCloudObjectsOrbitsColor	READ getOortCloudObjectsOrbitsColor	WRITE setOortCloudObjectsOrbitsColor		NOTIFY oortCloudObjectsOrbitsColorChanged)
122 	Q_PROPERTY(Vec3f cometsOrbitsColor		READ getCometsOrbitsColor		WRITE setCometsOrbitsColor		NOTIFY cometsOrbitsColorChanged)
123 	Q_PROPERTY(Vec3f sednoidsOrbitsColor		READ getSednoidsOrbitsColor		WRITE setSednoidsOrbitsColor		NOTIFY sednoidsOrbitsColorChanged)
124 	Q_PROPERTY(Vec3f interstellarOrbitsColor	READ getInterstellarOrbitsColor		WRITE setInterstellarOrbitsColor	NOTIFY interstellarOrbitsColorChanged)
125 	Q_PROPERTY(Vec3f mercuryOrbitColor		READ getMercuryOrbitColor		WRITE setMercuryOrbitColor		NOTIFY mercuryOrbitColorChanged)
126 	Q_PROPERTY(Vec3f venusOrbitColor		READ getVenusOrbitColor			WRITE setVenusOrbitColor		NOTIFY venusOrbitColorChanged)
127 	Q_PROPERTY(Vec3f earthOrbitColor		READ getEarthOrbitColor			WRITE setEarthOrbitColor		NOTIFY earthOrbitColorChanged)
128 	Q_PROPERTY(Vec3f marsOrbitColor			READ getMarsOrbitColor			WRITE setMarsOrbitColor			NOTIFY marsOrbitColorChanged)
129 	Q_PROPERTY(Vec3f jupiterOrbitColor		READ getJupiterOrbitColor		WRITE setJupiterOrbitColor		NOTIFY jupiterOrbitColorChanged)
130 	Q_PROPERTY(Vec3f saturnOrbitColor		READ getSaturnOrbitColor		WRITE setSaturnOrbitColor		NOTIFY saturnOrbitColorChanged)
131 	Q_PROPERTY(Vec3f uranusOrbitColor		READ getUranusOrbitColor		WRITE setUranusOrbitColor		NOTIFY uranusOrbitColorChanged)
132 	Q_PROPERTY(Vec3f neptuneOrbitColor		READ getNeptuneOrbitColor		WRITE setNeptuneOrbitColor		NOTIFY neptuneOrbitColorChanged)
133 	// Ephemeris-related properties
134 	Q_PROPERTY(Vec3f ephemerisGenericMarkerColor	READ getEphemerisGenericMarkerColor	WRITE setEphemerisGenericMarkerColor	NOTIFY ephemerisGenericMarkerColorChanged)
135 	Q_PROPERTY(Vec3f ephemerisSecondaryMarkerColor	READ getEphemerisSecondaryMarkerColor	WRITE setEphemerisSecondaryMarkerColor	NOTIFY ephemerisSecondaryMarkerColorChanged)
136 	Q_PROPERTY(Vec3f ephemerisSelectedMarkerColor	READ getEphemerisSelectedMarkerColor	WRITE setEphemerisSelectedMarkerColor	NOTIFY ephemerisSelectedMarkerColorChanged)
137 	Q_PROPERTY(Vec3f ephemerisMercuryMarkerColor	READ getEphemerisMercuryMarkerColor	WRITE setEphemerisMercuryMarkerColor	NOTIFY ephemerisMercuryMarkerColorChanged)
138 	Q_PROPERTY(Vec3f ephemerisVenusMarkerColor	READ getEphemerisVenusMarkerColor	WRITE setEphemerisVenusMarkerColor	NOTIFY ephemerisVenusMarkerColorChanged)
139 	Q_PROPERTY(Vec3f ephemerisMarsMarkerColor	READ getEphemerisMarsMarkerColor	WRITE setEphemerisMarsMarkerColor	NOTIFY ephemerisMarsMarkerColorChanged)
140 	Q_PROPERTY(Vec3f ephemerisJupiterMarkerColor	READ getEphemerisJupiterMarkerColor	WRITE setEphemerisJupiterMarkerColor	NOTIFY ephemerisJupiterMarkerColorChanged)
141 	Q_PROPERTY(Vec3f ephemerisSaturnMarkerColor	READ getEphemerisSaturnMarkerColor	WRITE setEphemerisSaturnMarkerColor	NOTIFY ephemerisSaturnMarkerColorChanged)
142 	// Color style
143 	Q_PROPERTY(QString orbitColorStyle		READ getOrbitColorStyle			WRITE setOrbitColorStyle		NOTIFY orbitColorStyleChanged)
144 	Q_PROPERTY(QString apparentMagnitudeAlgorithmOnEarth	READ getApparentMagnitudeAlgorithmOnEarth	WRITE setApparentMagnitudeAlgorithmOnEarth	NOTIFY apparentMagnitudeAlgorithmOnEarthChanged)
145 	Q_PROPERTY(int orbitsThickness			READ getOrbitsThickness			WRITE setOrbitsThickness		NOTIFY orbitsThicknessChanged)
146 	Q_PROPERTY(bool flagDrawMoonHalo		READ getFlagDrawMoonHalo		WRITE setFlagDrawMoonHalo		NOTIFY flagDrawMoonHaloChanged)
147 	Q_PROPERTY(bool flagDrawSunHalo			READ getFlagDrawSunHalo			WRITE setFlagDrawSunHalo		NOTIFY flagDrawSunHaloChanged)
148 
149 public:
150 	SolarSystem();
151 	virtual ~SolarSystem() Q_DECL_OVERRIDE;
152 
153 	///////////////////////////////////////////////////////////////////////////
154 	// Methods defined in the StelModule class
155 	//! Initialize the SolarSystem.
156 	//! Includes:
157 	//! - loading planetary body orbital and model data from data/ssystem.ini
158 	//! - perform initial planet position calculation
159 	//! - set display options from application settings
160 	virtual void init() Q_DECL_OVERRIDE;
161 
162 	virtual void deinit() Q_DECL_OVERRIDE;
163 
164 	//! Draw SolarSystem objects (planets).
165 	//! @param core The StelCore object.
166 	//! @return The maximum squared distance in pixels that any SolarSystem object
167 	//! has travelled since the last update.
168 	virtual void draw(StelCore *core) Q_DECL_OVERRIDE;
169 
170 	//! Update time-varying components.
171 	//! This includes planet motion trails.
172 	virtual void update(double deltaTime) Q_DECL_OVERRIDE;
173 
174 	//! Used to determine what order to draw the various StelModules.
175 	virtual double getCallOrder(StelModuleActionName actionName) const Q_DECL_OVERRIDE;
176 
177 	///////////////////////////////////////////////////////////////////////////
178 	// Methods defined in StelObjectModule class
179 	//! Search for SolarSystem objects in some area around a point.
180 	//! @param v A vector representing a point in the sky in equatorial J2000 coordinates (without aberration).
181 	//! @param limitFov The radius of the circle around the point v which
182 	//! defines the size of the area to search.
183 	//! @param core the core object
184 	//! @return QList of StelObjectP (pointers) containing all SolarSystem objects
185 	//! found in the specified area. This vector is not sorted by distance from v.
186 	virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const Q_DECL_OVERRIDE;
187 
188 	//! Search for a SolarSystem object based on the localised name.
189 	//! @param nameI18n the case in-sensitive translated planet name.
190 	//! @return a StelObjectP for the object if found, else Q_NULLPTR.
191 	virtual StelObjectP searchByNameI18n(const QString& nameI18n) const Q_DECL_OVERRIDE;
192 
193 	//! Search for a SolarSystem object based on the English name.
194 	//! @param name the case in-sensitive English planet name.
195 	//! @return a StelObjectP for the object if found, else Q_NULLPTR.
196 	virtual StelObjectP searchByName(const QString& name) const Q_DECL_OVERRIDE;
197 
searchByID(const QString & id) const198 	virtual StelObjectP searchByID(const QString &id) const Q_DECL_OVERRIDE
199 	{
200 		return searchByName(id);
201 	}
202 
203 	//! Find and return the list of at most maxNbItem objects auto-completing the passed object name.
204 	//! @param objPrefix the case insensitive first letters of the searched object
205 	//! @param maxNbItem the maximum number of returned object names
206 	//! @param useStartOfWords the autofill mode for returned objects names
207 	//! @return a list of matching object name by order of relevance, or an empty list if nothing match
208 	virtual QStringList listMatchingObjects(const QString& objPrefix, int maxNbItem=5, bool useStartOfWords=false) const Q_DECL_OVERRIDE;
209 	virtual QStringList listAllObjects(bool inEnglish) const Q_DECL_OVERRIDE;
210 	virtual QStringList listAllObjectsByType(const QString& objType, bool inEnglish) const Q_DECL_OVERRIDE;
getName() const211 	virtual QString getName() const Q_DECL_OVERRIDE { return "Solar System"; }
getStelObjectType() const212 	virtual QString getStelObjectType() const Q_DECL_OVERRIDE { return Planet::PLANET_TYPE; }
213 
214 public slots:
215 	///////////////////////////////////////////////////////////////////////////
216 	// Method callable from script and GUI
217 	// Properties setters and getters
218 	//! Set flag which determines if planets are drawn or hidden.
219 	void setFlagPlanets(bool b);
220 	//! Get the current value of the flag which determines if planet are drawn or hidden.
221 	bool getFlagPlanets() const;
222 
223 	//! Set flag which determines if planet trails are drawn or hidden.
224 	void setFlagTrails(bool b);
225 	//! Get the current value of the flag which determines if planet trails are drawn or hidden.
226 	bool getFlagTrails() const;
227 
228 	//! Set thickness of trails.
229 	void setTrailsThickness(int v);
230 	//! Get thickness of trail.
getTrailsThickness() const231 	int getTrailsThickness() const {return trailsThickness;}
232 
233 	//! Set maximum number of trail points. Too many points may slow down the application. 5000 seems to be a good balance.
234 	//! The trails are drawn for a maximum of 365 days and then fade out.
235 	//! If drawing many trails slows down the application, you can set a new maximum trail step length.
236 	//! Note that the fadeout may require more points or a decent simulation speed.
237 	void setMaxTrailPoints(int max);
238 	//! Get maximum number of trail points. Too many points may slow down the application. 5000 seems to be a good balance.
getMaxTrailPoints() const239 	int getMaxTrailPoints() const {return maxTrailPoints;}
240 
241 	//! Set maximum number of trail time extent in years.
242 	//! Too many points may slow down the application. One year (365 days) seems to be a good balance.
243 	//! If drawing many trails slows down the application, you can set a new maximum trail time extent or step length.
244 	//! Note that the fadeout may require more points or a decent simulation speed.
245 	void setMaxTrailTimeExtent(int max);
246 	//! Get maximum number of trail time extent in years. Too many points may slow down the application. One year (365 days) seems to be a good balance.
getMaxTrailTimeExtent() const247 	int getMaxTrailTimeExtent() const {return maxTrailTimeExtent;}
248 
249 	//! Set flag which determines if planet hints are drawn or hidden along labels
250 	void setFlagHints(bool b);
251 	//! Get the current value of the flag which determines if planet hints are drawn or hidden along labels
252 	bool getFlagHints() const;
253 
254 	//! Set flag which determines if planet labels are drawn or hidden.
255 	void setFlagLabels(bool b);
256 	//! Get the current value of the flag which determines if planet labels are drawn or hidden.
257 	bool getFlagLabels() const;
258 
259 	//! Set the amount of planet labels. The real amount is also proportional with FOV.
260 	//! The limit is set in function of the planets magnitude
261 	//! @param a the amount between 0 and 10. 0 is no labels, 10 is maximum of labels
setLabelsAmount(double a)262 	void setLabelsAmount(double a) {if(!fuzzyEquals(a, labelsAmount)) {labelsAmount=a; emit labelsAmountChanged(a);}}
263 	//! Get the amount of planet labels. The real amount is also proportional with FOV.
264 	//! @return the amount between 0 and 10. 0 is no labels, 10 is maximum of labels
getLabelsAmount(void) const265 	double getLabelsAmount(void) const {return labelsAmount;}
266 
267 	//! Set flag which determines if planet orbits are drawn or hidden.
268 	void setFlagOrbits(bool b);
269 	//! Get the current value of the flag which determines if planet orbits are drawn or hidden.
getFlagOrbits() const270 	bool getFlagOrbits() const {return flagOrbits;}
271 
272 	//! Set flag which determines if the planet pointer (red cross) is drawn or hidden on a selected planet.
setFlagPointer(bool b)273 	void setFlagPointer(bool b) { if (b!=flagPointer) { flagPointer=b; emit flagPointerChanged(b); }}
274 	//! Get the current value of the flag which determines if planet pointers are drawn or hidden.
getFlagPointer() const275 	bool getFlagPointer() const { return flagPointer;}
276 
277 	//! Set flag which determines if the light travel time calculation is used or not.
278 	void setFlagLightTravelTime(bool b);
279 	//! Get the current value of the flag which determines if light travel time
280 	//! calculation is used or not.
getFlagLightTravelTime(void) const281 	bool getFlagLightTravelTime(void) const {return flagLightTravelTime;}
282 
283 	//! Set flag whether to use OBJ models for rendering, where available
setFlagUseObjModels(bool b)284 	void setFlagUseObjModels(bool b) { if(b!=flagUseObjModels) { flagUseObjModels = b; emit flagUseObjModelsChanged(b); } }
285 	//! Get the current value of the flag which determines wether to use OBJ models for rendering, where available
getFlagUseObjModels(void) const286 	bool getFlagUseObjModels(void) const { return flagUseObjModels; }
287 
288 	//! Set flag whether OBJ models should render self-shadowing (using a shadow map)
289 	void setFlagShowObjSelfShadows(bool b);
290 	//! Get the current value of the flag which determines whether OBJ models should render self-shadowing (using a shadow map)
getFlagShowObjSelfShadows(void) const291 	bool getFlagShowObjSelfShadows(void) const { return flagShowObjSelfShadows; }
292 
293 	//! Set planet names font size.
294 	//! @return font size
295 	void setFontSize(int newFontSize);
296 
297 	//! Set the color used to draw planet labels.
298 	//! @param c The color of the planet labels (R,G,B)
299 	//! @code
300 	//! // example of usage in scripts
301 	//! SolarSystem.setLabelsColor(Vec3f(1.0,0.0,0.0));
302 	//! @endcode
303 	void setLabelsColor(const Vec3f& c);
304 	//! Get the current color used to draw planet labels.
305 	//! @return current color
306 	Vec3f getLabelsColor(void) const;
307 
308 	//! Set the color used to draw solar system object orbit lines.
309 	//! @param c The color of the solar system object orbit lines (R,G,B)
310 	//! @code
311 	//! // example of usage in scripts
312 	//! SolarSystem.setOrbitsColor(Vec3f(1.0,0.0,0.0));
313 	//! @endcode
314 	void setOrbitsColor(const Vec3f& c);
315 	//! Get the current color used to draw solar system object orbit lines.
316 	//! @return current color
317 	Vec3f getOrbitsColor(void) const;
318 
319 	//! Set the color used to draw orbits lines of the major planets.
320 	//! @param c The color of orbits lines of the major planets (R,G,B)
321 	//! @code
322 	//! // example of usage in scripts
323 	//! SolarSystem.setMajorPlanetsOrbitsColor(Vec3f(1.0,0.0,0.0));
324 	//! @endcode
325 	void setMajorPlanetsOrbitsColor(const Vec3f& c);
326 	//! Get the current color used to draw orbits lines of the major planets.
327 	//! @return current color
328 	Vec3f getMajorPlanetsOrbitsColor(void) const;
329 
330 	//! Set the color used to draw orbits lines of moons of planets.
331 	//! @param c The color of orbits lines of moons of planets lines (R,G,B)
332 	//! @code
333 	//! // example of usage in scripts
334 	//! SolarSystem.setMoonsOrbitsColor(Vec3f(1.0,0.0,0.0));
335 	//! @endcode
336 	void setMoonsOrbitsColor(const Vec3f& c);
337 	//! Get the current color used to draw orbits lines of moons of planets.
338 	//! @return current color
339 	Vec3f getMoonsOrbitsColor(void) const;
340 
341 	//! Set the color used to draw orbits lines of the minor planets.
342 	//! @param c The color of orbits lines of the minor planets (R,G,B)
343 	//! @code
344 	//! // example of usage in scripts
345 	//! SolarSystem.setMinorPlanetsOrbitsColor(Vec3f(1.0,0.0,0.0));
346 	//! @endcode
347 	void setMinorPlanetsOrbitsColor(const Vec3f& c);
348 	//! Get the current color used to draw orbits lines of the minor planets.
349 	//! @return current color
350 	Vec3f getMinorPlanetsOrbitsColor(void) const;
351 
352 	//! Set the color used to draw orbits lines of the dwarf planets.
353 	//! @param c The color of orbits lines of the dwarf planets (R,G,B)
354 	//! @code
355 	//! // example of usage in scripts
356 	//! SolarSystem.setDwarfPlanetsOrbitsColor(Vec3f(1.0,0.0,0.0));
357 	//! @endcode
358 	void setDwarfPlanetsOrbitsColor(const Vec3f& c);
359 	//! Get the current color used to draw orbits lines of the dwarf planets.
360 	//! @return current color
361 	Vec3f getDwarfPlanetsOrbitsColor(void) const;
362 
363 	//! Set the color used to draw orbits lines of cubewanos.
364 	//! @param c The color of orbits lines of cubewanos (R,G,B)
365 	//! @code
366 	//! // example of usage in scripts
367 	//! SolarSystem.setCubewanosOrbitsColor(Vec3f(1.0,0.0,0.0));
368 	//! @endcode
369 	void setCubewanosOrbitsColor(const Vec3f& c);
370 	//! Get the current color used to draw orbits lines of cubewanos.
371 	//! @return current color
372 	Vec3f getCubewanosOrbitsColor(void) const;
373 
374 	//! Set the color used to draw orbits lines of plutinos.
375 	//! @param c The color of orbits lines of plutinos (R,G,B)
376 	//! @code
377 	//! // example of usage in scripts
378 	//! SolarSystem.setPlutinosOrbitsColor(Vec3f(1.0,0.0,0.0));
379 	//! @endcode
380 	void setPlutinosOrbitsColor(const Vec3f& c);
381 	//! Get the current color used to draw orbits lines of plutinos.
382 	//! @return current color
383 	Vec3f getPlutinosOrbitsColor(void) const;
384 
385 	//! Set the color used to draw orbits lines of scattered disk objects.
386 	//! @param c The color of orbits lines of scattered disk objects (R,G,B)
387 	//! @code
388 	//! // example of usage in scripts
389 	//! SolarSystem.setScatteredDiskObjectsOrbitsColor(Vec3f(1.0,0.0,0.0));
390 	//! @endcode
391 	void setScatteredDiskObjectsOrbitsColor(const Vec3f& c);
392 	//! Get the current color used to draw orbits lines of scattered disk objects.
393 	//! @return current color
394 	Vec3f getScatteredDiskObjectsOrbitsColor(void) const;
395 
396 	//! Set the color used to draw orbits lines of Oort cloud objects.
397 	//! @param c The color of orbits lines of Oort cloud objects (R,G,B)
398 	//! @code
399 	//! // example of usage in scripts
400 	//! SolarSystem.setOortCloudObjectsOrbitsColor(Vec3f(1.0,0.0,0.0));
401 	//! @endcode
402 	void setOortCloudObjectsOrbitsColor(const Vec3f& c);
403 	//! Get the current color used to draw orbits lines of Oort cloud objects.
404 	//! @return current color
405 	Vec3f getOortCloudObjectsOrbitsColor(void) const;
406 
407 	//! Set the color used to draw comet orbit lines.
408 	//! @param c The color of the comet orbit lines (R,G,B)
409 	//! @code
410 	//! // example of usage in scripts
411 	//! SolarSystem.setCometsOrbitsColor(Vec3f(1.0,0.0,0.0));
412 	//! @endcode
413 	void setCometsOrbitsColor(const Vec3f& c);
414 	//! Get the current color used to draw comet orbit lines.
415 	//! @return current color
416 	Vec3f getCometsOrbitsColor(void) const;
417 
418 	//! Set the color used to draw sednoid orbit lines.
419 	//! @param c The color of the sednoid orbit lines (R,G,B)
420 	//! @code
421 	//! // example of usage in scripts
422 	//! SolarSystem.setSednoidsOrbitsColor(Vec3f(1.0,0.0,0.0));
423 	//! @endcode
424 	void setSednoidsOrbitsColor(const Vec3f& c);
425 	//! Get the current color used to draw sednoid orbit lines.
426 	//! @return current color
427 	Vec3f getSednoidsOrbitsColor(void) const;
428 
429 	//! Set the color used to draw interstellar orbit (hyperbolic trajectory) lines.
430 	//! @param c The color of the interstellar orbit lines (R,G,B)
431 	//! @code
432 	//! // example of usage in scripts
433 	//! SolarSystem.setInterstellarOrbitsColor(Vec3f(1.0,0.0,0.0));
434 	//! @endcode
435 	void setInterstellarOrbitsColor(const Vec3f& c);
436 	//! Get the current color used to draw interstellar orbit lines.
437 	//! @return current color
438 	Vec3f getInterstellarOrbitsColor(void) const;
439 
440 	//! Set the color used to draw Mercury orbit line.
441 	//! @param c The color of Mercury orbit line (R,G,B)
442 	//! @code
443 	//! // example of usage in scripts
444 	//! SolarSystem.setMercuryOrbitColor(Vec3f(1.0,0.0,0.0));
445 	//! @endcode
446 	void setMercuryOrbitColor(const Vec3f& c);
447 	//! Get the current color used to draw Mercury orbit line.
448 	//! @return current color
449 	Vec3f getMercuryOrbitColor(void) const;
450 
451 	//! Set the color used to draw Venus orbit line.
452 	//! @param c The color of Venus orbit line (R,G,B)
453 	//! @code
454 	//! // example of usage in scripts
455 	//! SolarSystem.setVenusOrbitColor(Vec3f(1.0,0.0,0.0));
456 	//! @endcode
457 	void setVenusOrbitColor(const Vec3f& c);
458 	//! Get the current color used to draw Venus orbit line.
459 	//! @return current color
460 	Vec3f getVenusOrbitColor(void) const;
461 
462 	//! Set the color used to draw Earth orbit line.
463 	//! @param c The color of Earth orbit line (R,G,B)
464 	//! @code
465 	//! // example of usage in scripts
466 	//! SolarSystem.setEarthOrbitColor(Vec3f(1.0,0.0,0.0));
467 	//! @endcode
468 	void setEarthOrbitColor(const Vec3f& c);
469 	//! Get the current color used to draw Earth orbit line.
470 	//! @return current color
471 	Vec3f getEarthOrbitColor(void) const;
472 
473 	//! Set the color used to draw Mars orbit line.
474 	//! @param c The color of Mars orbit line (R,G,B)
475 	//! @code
476 	//! // example of usage in scripts
477 	//! SolarSystem.setMarsOrbitColor(Vec3f(1.0,0.0,0.0));
478 	//! @endcode
479 	void setMarsOrbitColor(const Vec3f& c);
480 	//! Get the current color used to draw Mars orbit line.
481 	//! @return current color
482 	Vec3f getMarsOrbitColor(void) const;
483 
484 	//! Set the color used to draw Jupiter orbit line.
485 	//! @param c The color of Jupiter orbit line (R,G,B)
486 	//! @code
487 	//! // example of usage in scripts
488 	//! SolarSystem.setJupiterOrbitColor(Vec3f(1.0,0.0,0.0));
489 	//! @endcode
490 	void setJupiterOrbitColor(const Vec3f& c);
491 	//! Get the current color used to draw Jupiter orbit line.
492 	//! @return current color
493 	Vec3f getJupiterOrbitColor(void) const;
494 
495 	//! Set the color used to draw Saturn orbit line.
496 	//! @param c The color of Saturn orbit line (R,G,B)
497 	//! @code
498 	//! // example of usage in scripts
499 	//! SolarSystem.setSaturnOrbitColor(Vec3f(1.0,0.0,0.0));
500 	//! @endcode
501 	void setSaturnOrbitColor(const Vec3f& c);
502 	//! Get the current color used to draw Saturn orbit line.
503 	//! @return current color
504 	Vec3f getSaturnOrbitColor(void) const;
505 
506 	//! Set the color used to draw Uranus orbit line.
507 	//! @param c The color of Uranus orbit line (R,G,B)
508 	//! @code
509 	//! // example of usage in scripts
510 	//! SolarSystem.setUranusOrbitColor(Vec3f(1.0,0.0,0.0));
511 	//! @endcode
512 	void setUranusOrbitColor(const Vec3f& c);
513 	//! Get the current color used to draw Uranus orbit line.
514 	//! @return current color
515 	Vec3f getUranusOrbitColor(void) const;
516 
517 	//! Set the color used to draw Neptune orbit line.
518 	//! @param c The color of Neptune orbit line (R,G,B)
519 	//! @code
520 	//! // example of usage in scripts
521 	//! SolarSystem.setNeptuneOrbitColor(Vec3f(1.0,0.0,0.0));
522 	//! @endcode
523 	void setNeptuneOrbitColor(const Vec3f& c);
524 	//! Get the current color used to draw Neptune orbit line.
525 	//! @return current color
526 	Vec3f getNeptuneOrbitColor(void) const;
527 
528 	//! Set the color used to draw planet trails lines.
529 	//! @param c The color of the planet trails lines (R,G,B)
530 	//! @code
531 	//! // example of usage in scripts
532 	//! SolarSystem.setTrailsColor(Vec3f(1.0,0.0,0.0));
533 	//! @endcode
setTrailsColor(const Vec3f & c)534 	void setTrailsColor(const Vec3f& c) {if (c!=trailsColor) { trailsColor=c; emit trailsColorChanged(c);}}
535 	//! Get the current color used to draw planet trails lines.
536 	//! @return current color
getTrailsColor() const537 	Vec3f getTrailsColor() const {return trailsColor;}
538 
539 	//! Set the color used to draw planet pointers.
540 	//! @param c The color of the planet pointers
541 	//! @code
542 	//! // example of usage in scripts
543 	//! SolarSystem.setPointerColor(Vec3f(1.0,0.0,0.0));
544 	//! @endcode
setPointerColor(const Vec3f & c)545 	void setPointerColor(const Vec3f& c) {if (c!=pointerColor) {pointerColor=c; emit pointerColorChanged(c);}}
546 	//! Get the current color used to draw planet pointers.
547 	//! @return current color
getPointerColor() const548 	Vec3f getPointerColor() const {return pointerColor;}
549 
550 	//! Set flag which determines if Earth's moon is scaled or not.
551 	void setFlagMoonScale(bool b);
552 	//! Get the current value of the flag which determines if Earth's moon is scaled or not.
getFlagMoonScale(void) const553 	bool getFlagMoonScale(void) const {return flagMoonScale;}
554 
555 	//! Set the display scaling factor for Earth's moon.
556 	void setMoonScale(double f);
557 	//! Get the display scaling factor for Earth's moon.
getMoonScale(void) const558 	double getMoonScale(void) const {return moonScale;}
559 
560 	//! Set flag which determines if minor bodies (everything except the 8 planets) are drawn scaled or not.
561 	void setFlagMinorBodyScale(bool b);
562 	//! Get the current value of the flag which determines if minor bodies (everything except the 8 planets) are drawn scaled or not.
getFlagMinorBodyScale(void) const563 	bool getFlagMinorBodyScale(void) const {return flagMinorBodyScale;}
564 
565 	//! Set the display scaling factor for minor bodies.
566 	void setMinorBodyScale(double f);
567 	//! Get the display scaling factor for minor bodies.
getMinorBodyScale(void) const568 	double getMinorBodyScale(void) const {return minorBodyScale;}
569 
570 	//! Set flag which determines if planets are displayed scaled or not.
571 	void setFlagPlanetScale(bool b);
572 	//! Get the current value of the flag which determines if planets are displayed scaled or not.
getFlagPlanetScale(void) const573 	bool getFlagPlanetScale(void) const {return flagPlanetScale;}
574 
575 	//! Set the display scaling factor for planets.
576 	void setPlanetScale(double f);
577 	//! Get the display scaling factor for planets.
getPlanetScale(void) const578 	double getPlanetScale(void) const {return planetScale;}
579 
580 	//! Set flag which determines if Sun is scaled or not.
581 	void setFlagSunScale(bool b);
582 	//! Get the current value of the flag which determines if Sun is scaled or not.
getFlagSunScale(void) const583 	bool getFlagSunScale(void) const {return flagSunScale;}
584 
585 	//! Set the display scaling factor for Sun.
586 	void setSunScale(double f);
587 	//! Get the display scaling factor for Sun.
getSunScale(void) const588 	double getSunScale(void) const {return sunScale;}
589 
590 	//! Translate names. (public so that SolarSystemEditor can call it).
591 	void updateI18n();
592 
593 	//! Get the V magnitude for Solar system bodies for scripts
594 	//! @param planetName the case in-sensitive English planet name.
595 	//! @param withExtinction the flag for use extinction effect for magnitudes (default not use)
596 	//! @return a magnitude
597 	float getPlanetVMagnitude(QString planetName, bool withExtinction=false) const;
598 
599 	//! Get type for Solar system bodies for scripts
600 	//! @param planetName the case in-sensitive English planet name.
601 	//! @return a type of planet (star, planet, moon, observer, artificial, asteroid, plutino, comet, dwarf planet, cubewano, scattered disc object, Oort cloud object, sednoid, interstellar object)
602 	QString getPlanetType(QString planetName) const;
603 
604 	//! Get distance to Solar system bodies for scripts
605 	//! @param planetName the case in-sensitive English planet name.
606 	//! @return a distance (in AU)
607 	double getDistanceToPlanet(QString planetName) const;
608 
609 	//! Get elongation for Solar system bodies for scripts
610 	//! @param planetName the case in-sensitive English planet name.
611 	//! @return a elongation (in radians)
612 	double getElongationForPlanet(QString planetName) const;
613 
614 	//! Get phase angle for Solar system bodies for scripts
615 	//! @param planetName the case in-sensitive English planet name.
616 	//! @return a phase angle (in radians)
617 	double getPhaseAngleForPlanet(QString planetName) const;
618 
619 	//! Get phase for Solar system bodies for scripts
620 	//! @param planetName the case in-sensitive English planet name.
621 	//! @return phase, i.e. illuminated fraction [0..1]
622 	float getPhaseForPlanet(QString planetName) const;
623 
624 	//! Set the algorithm for computation of apparent magnitudes for planets in case observer on the Earth.
625 	//! Possible values:
626 	//! @li @c Mueller1893 [Explanatory Supplement to the Astronomical Ephemeris, 1961] (visual magnitudes, based on visual observations by G. Mueller, 1877-91)
627 	//! @li @c AstrAlm1984 [Astronomical Almanac 1984] and later. These give V (instrumental) magnitudes.
628 	//! @li @c ExpSup1992 [Explanatory Supplement to the Astronomical Almanac, 1992] (algorithm contributed by Pere Planesas, Observatorio Astronomico Nacional)
629 	//! @li @c ExpSup2013 [Explanatory Supplement to the Astronomical Almanac, 3rd edition, 2013]
630 	//! @li @c Generic Visual magnitude based on phase angle and albedo.
631 	//! Details:
632 	//! @li J. Meeus "Astronomical Algorithms" (2nd ed. 1998, with corrections as of August 10, 2009) p.283-286.
633 	//! @li O. Montenbruck, T. Pfleger "Astronomy on the Personal Computer" (4th ed.) p.143-145.
634 	//! @li Daniel L. Harris "Photometry and Colorimetry of Planets and Satellites" http://adsabs.harvard.edu/abs/1961plsa.book..272H
635 	//! @li Sean E. Urban and P. Kenneth Seidelmann "Explanatory Supplement to the Astronomical Almanac" (3rd edition, 2013)
636 	//! It is interesting to note that Meeus in his discussion of "Harris" states that Harris did not give new values.
637 	//! The book indeed mentions a few values for the inner planets citing Danjon, but different from those then listed by Meeus.
638 	//! Therefore it must be assumed that the "Harris" values are misnomed, and are the least certain set.
639 	//! Hint: Default option in config.ini: astro/apparent_magnitude_algorithm = ExpSup2013
640 	//! @param algorithm the case in-sensitive algorithm name
641 	//! @note: The structure of algorithms is almost identical, just the numbers are different!
642 	//!        You should activate Mueller's algorithm to simulate the eye's impression. (Esp. Venus!)
643 	void setApparentMagnitudeAlgorithmOnEarth(QString algorithm);
644 
645 	//! Get the algorithm used for computation of apparent magnitudes for planets in case observer on the Earth
646 	//! @see setApparentMagnitudeAlgorithmOnEarth()
647 	QString getApparentMagnitudeAlgorithmOnEarth() const;
648 
649 	//! Set flag which enable use native names for planets or not.
650 	void setFlagNativePlanetNames(bool b);
651 	//! Get the current value of the flag which enables showing native names for planets or not.
652 	bool getFlagNativePlanetNames(void) const;
653 
654 	//! Set flag which enabled the showing of isolated trails for selected objects only or not
655 	void setFlagIsolatedTrails(bool b);
656 	//! Get the current value of the flag which enables showing of isolated trails for selected objects only or not.
657 	bool getFlagIsolatedTrails(void) const;
658 
659 	//! Set number of displayed of isolated trails for latest selected objects
660 	void setNumberIsolatedTrails(int n);
661 	//! Get the number of displayed of isolated trails for latest selected objects
662 	int getNumberIsolatedTrails(void) const;
663 
664 	//! Set flag which enabled the showing of isolated orbits for selected objects only or not
665 	void setFlagIsolatedOrbits(bool b);
666 	//! Get the current value of the flag which enables showing of isolated orbits for selected objects only or not.
667 	bool getFlagIsolatedOrbits(void) const;
668 
669 	//! Set flag which enabled the showing of planets orbits only or not
670 	void setFlagPlanetsOrbitsOnly(bool b);
671 	//! Get the current value of the flag which enables showing of planets orbits only or not.
672 	bool getFlagPlanetsOrbitsOnly(void) const;
673 
674 	//! Set flag which enabled the showing of solar corona when atmosphere is disabled (true) of draw the corona when total solar eclipses is happened only (false)
setFlagPermanentSolarCorona(bool b)675 	void setFlagPermanentSolarCorona(bool b) {	if (flagPermanentSolarCorona!=b)	{ flagPermanentSolarCorona = b; emit flagPermanentSolarCoronaChanged(b); } }
676 	//! Get the current value of the flag which enables showing of solar corona when atmosphere is disabled or when total solar eclipses is happened only.
getFlagPermanentSolarCorona(void) const677 	bool getFlagPermanentSolarCorona(void) const { return flagPermanentSolarCorona; }
678 
679 	//! Set flag which determines if custom settings is using for Great Red Spot on Jupiter
680 	void setFlagCustomGrsSettings(bool b);
681 	//! Get the current value of the flag which determines if custom settings for Great Red Spot on Jupiter is used or not.
682 	bool getFlagCustomGrsSettings() const;
683 
684 	//! Set longitude of Great Red Spot (System II is used)
685 	//! @param longitude (degrees)
686 	void setCustomGrsLongitude(int longitude);
687 	//! Get longitude of Great Red Spot (System II is used)
688 	//! @return a longitude (degrees)
689 	int getCustomGrsLongitude() const;
690 
691 	//! Set speed of annual drift for Great Red Spot (System II is used)
692 	//! @param annual drift (degrees)
693 	void setCustomGrsDrift(double drift);
694 	//! Get speed of annual drift for Great Red Spot (System II is used)
695 	double getCustomGrsDrift() const;
696 
697 	//! Set initial JD for calculation of position of Great Red Spot
698 	//! @param JD
699 	// TODO (GZ): Clarify whether this is JD or rather JDE?
700 	void setCustomGrsJD(double JD);
701 	//! Get initial JD for calculation of position of Great Red Spot
702 	double getCustomGrsJD();
703 
704 	//! Set whether earth shadow should be enlarged following Danjon's method
705 	void setFlagEarthShadowEnlargementDanjon(bool b);
706 	//! Get whether earth shadow should be enlarged following Danjon's method
707 	bool getFlagEarthShadowEnlargementDanjon() const;
708 
709 	//! Set style of colors of orbits for Solar system bodies
710 	void setOrbitColorStyle(QString style);
711 	//! Get style of colors of orbits for Solar system bodies
712 	QString getOrbitColorStyle() const;
713 
714 	//! Get list of objects by type
715 	//! @param objType object type
716 	QStringList getObjectsList(QString objType="all") const;
717 
718 	//! Set flag which enables display of orbits for planets even if they are off screen
719 	void setFlagPermanentOrbits(bool b);
720 	bool getFlagPermanentOrbits() const;
721 
722 	void setOrbitsThickness(int v);
723 	int getOrbitsThickness() const;
724 
725 	void setFlagDrawMoonHalo(bool b);
726 	bool getFlagDrawMoonHalo() const;
727 
728 	void setFlagDrawSunHalo(bool b);
729 	bool getFlagDrawSunHalo() const;
730 
731 	//! Reset and recreate trails
732 	void recreateTrails();
733 
734 	//! Reset textures for planet @param planetName
735 	//! @note if @param planetName is empty then reset will happen for all solar system objects
736 	void resetTextures(const QString& planetName);
737 
738 	//! Replace the texture for the planet @param planetName
739 	//! @param planetName - English name of the planet
740 	//! @param texName - file path for texture
741 	//! The texture path starts in the scripts directory.
742 	void setTextureForPlanet(const QString &planetName, const QString &texName);
743 
744 signals:
745 	void labelsDisplayedChanged(bool b);
746 	void nomenclatureDisplayedChanged(bool b);
747 	void flagOrbitsChanged(bool b);
748 	void flagHintsChanged(bool b);
749 	void flagDrawMoonHaloChanged(bool b);
750 	void flagDrawSunHaloChanged(bool b);
751 	void trailsDisplayedChanged(bool b);
752 	void trailsThicknessChanged(int v);
753 	void orbitsThicknessChanged(int v);
754 	void maxTrailPointsChanged(int max);
755 	void maxTrailTimeExtentChanged(int max);
756 	void flagPointerChanged(bool b);
757 	void flagNativePlanetNamesChanged(bool b);
758 	void flagPlanetsDisplayedChanged(bool b);
759 	void flagPlanetsOrbitsOnlyChanged(bool b);
760 	void flagPermanentOrbitsChanged(bool b);
761 	void flagIsolatedOrbitsChanged(bool b);
762 	void flagIsolatedTrailsChanged(bool b);
763 	void numberIsolatedTrailsChanged(int n);
764 	void flagLightTravelTimeChanged(bool b);
765 	void flagUseObjModelsChanged(bool b);
766 	void flagShowObjSelfShadowsChanged(bool b);
767 	void flagMoonScaleChanged(bool b);
768 	void moonScaleChanged(double f);
769 	void flagMinorBodyScaleChanged(bool b);
770 	void minorBodyScaleChanged(double f);
771 	void flagPlanetScaleChanged(bool b);
772 	void planetScaleChanged(double f);
773 	void flagSunScaleChanged(bool b);
774 	void sunScaleChanged(double f);
775 	void labelsAmountChanged(double f);
776 	void ephemerisMarkersChanged(bool b);
777 	void ephemerisHorizontalCoordinatesChanged(bool b);
778 	void ephemerisDatesChanged(bool b);
779 	void ephemerisMagnitudesChanged(bool b);
780 	void ephemerisLineChanged(bool b);
781 	void ephemerisAlwaysOnChanged(bool b);
782 	void ephemerisLineThicknessChanged(int v);
783 	void ephemerisSkipDataChanged(bool b);
784 	void ephemerisSkipMarkersChanged(bool b);
785 	void ephemerisDataStepChanged(int s);
786 	void ephemerisDataLimitChanged(int s);
787 	void ephemerisSmartDatesChanged(bool b);
788 	void ephemerisScaleMarkersChanged(bool b);
789 	void flagCustomGrsSettingsChanged(bool b);
790 	void customGrsLongitudeChanged(int l);
791 	void customGrsDriftChanged(double drift);
792 	void customGrsJDChanged(double JD);
793 	void earthShadowEnlargementDanjonChanged(bool b);
794 	void flagPermanentSolarCoronaChanged(bool b);
795 
796 	void labelsColorChanged(const Vec3f & color) const;
797 	void pointerColorChanged(const Vec3f & color) const;
798 	void trailsColorChanged(const Vec3f & color) const;
799 	void orbitsColorChanged(const Vec3f & color) const;
800 	void nomenclatureColorChanged(const Vec3f & color) const;
801 	void majorPlanetsOrbitsColorChanged(const Vec3f & color) const;
802 	void minorPlanetsOrbitsColorChanged(const Vec3f & color) const;
803 	void dwarfPlanetsOrbitsColorChanged(const Vec3f & color) const;
804 	void moonsOrbitsColorChanged(const Vec3f & color) const;
805 	void cubewanosOrbitsColorChanged(const Vec3f & color) const;
806 	void plutinosOrbitsColorChanged(const Vec3f & color) const;
807 	void scatteredDiskObjectsOrbitsColorChanged(const Vec3f & color) const;
808 	void oortCloudObjectsOrbitsColorChanged(const Vec3f & color) const;
809 	void cometsOrbitsColorChanged(const Vec3f & color) const;
810 	void sednoidsOrbitsColorChanged(const Vec3f & color) const;
811 	void interstellarOrbitsColorChanged(const Vec3f & color) const;
812 	void mercuryOrbitColorChanged(const Vec3f & color) const;
813 	void venusOrbitColorChanged(const Vec3f & color) const;
814 	void earthOrbitColorChanged(const Vec3f & color) const;
815 	void marsOrbitColorChanged(const Vec3f & color) const;
816 	void jupiterOrbitColorChanged(const Vec3f & color) const;
817 	void saturnOrbitColorChanged(const Vec3f & color) const;
818 	void uranusOrbitColorChanged(const Vec3f & color) const;
819 	void neptuneOrbitColorChanged(const Vec3f & color) const;
820 	void ephemerisGenericMarkerColorChanged(const Vec3f & color) const;
821 	void ephemerisSecondaryMarkerColorChanged(const Vec3f & color) const;
822 	void ephemerisSelectedMarkerColorChanged(const Vec3f & color) const;
823 	void ephemerisMercuryMarkerColorChanged(const Vec3f & color) const;
824 	void ephemerisVenusMarkerColorChanged(const Vec3f & color) const;
825 	void ephemerisMarsMarkerColorChanged(const Vec3f & color) const;
826 	void ephemerisJupiterMarkerColorChanged(const Vec3f & color) const;
827 	void ephemerisSaturnMarkerColorChanged(const Vec3f & color) const;
828 
829 	void orbitColorStyleChanged(QString style) const;
830 	void apparentMagnitudeAlgorithmOnEarthChanged(QString algorithm) const;
831 
832 	void solarSystemDataReloaded();
833 	void requestEphemerisVisualization();
834 
835 public:
836 	///////////////////////////////////////////////////////////////////////////
837 	// Other public methods
838 	//! Get a pointer to a Planet object.
839 	//! @param planetEnglishName the English name of the desired planet.
840 	//! @return The matching planet pointer if exists or Q_NULLPTR.
841 	PlanetP searchByEnglishName(QString planetEnglishName) const;
842 
843 	PlanetP searchMinorPlanetByEnglishName(QString planetEnglishName) const;
844 
845 	//! Get the Planet object pointer for the Sun.
getSun() const846 	PlanetP getSun() const {return sun;}
847 
848 	//! Get the Planet object pointer for the Earth.
getEarth() const849 	PlanetP getEarth() const {return earth;}
850 
851 	//! Get the Planet object pointer for Earth's moon.
getMoon() const852 	PlanetP getMoon() const {return moon;}
853 
854 	//! Determine if a lunar eclipse is close at hand?
855 	bool nearLunarEclipse() const;
856 
857 	//! Get the list of all the planet english names
858 	QStringList getAllPlanetEnglishNames() const;
859 
860 	//! Get the list of all the planet localized names
861 	QStringList getAllPlanetLocalizedNames() const;
862 
863 	//! Get the list of all the minor planet common english names
864 	QStringList getAllMinorPlanetCommonEnglishNames() const;
865 
866 	//! Reload the planets
867 	void reloadPlanets();
868 
869 	//! New 0.16: delete a planet from the solar system. Writes a warning to log if this is not a minor object.
870 	bool removeMinorPlanet(QString name);
871 
872 	//! Determines relative amount of sun visible from the observer's position (first element) and the Planet object pointer for eclipsing celestial body (second element).
873 	//! In the unlikely event of multiple objects in front of the sun, only the largest will be reported.
874 	QPair<double, PlanetP> getSolarEclipseFactor(const StelCore *core) const;
875 
876 	//! Retrieve Radius of Umbra and Penumbra at the distance of the Moon.
877 	//! Returns a pair (umbra, penumbra) in (geocentric_arcseconds, AU, geometric_AU).
878 	//! * sizes in arcseconds are the usual result found as Bessel element in eclipse literature.
879 	//!   It includes scaling for effects of atmosphere either after Chauvenet (2%) or after Danjon. (see Espenak: 5000 Years Canon of Lunar Eclipses.)
880 	//! * sizes in AU are the same, converted back to AU in Lunar distance.
881 	//! * sizes in geometric_AU derived from pure geometrical evaluations without scalings applied.
882 	QPair<Vec3d,Vec3d> getEarthShadowRadiiAtLunarDistance() const;
883 
884 	//! Compute the position and transform matrix for every element of the solar system.
885 	//! @param dateJDE the Julian Day in JDE (Ephemeris Time or equivalent)
886 	//! @param observerPlanet planet of the observer (Required for light travel time or aberration computation).
887 	void computePositions(double dateJDE, PlanetP observerPlanet);
888 
889 	//! Get the list of all the bodies of the solar system.
getAllPlanets() const890 	const QList<PlanetP>& getAllPlanets() const {return systemPlanets;}
891 	//! Get the list of all the bodies of the solar system.
getAllMinorBodies() const892 	const QList<PlanetP>& getAllMinorBodies() const {return systemMinorBodies;}
893 	//! Get the list of all minor bodies names.
getMinorBodiesList() const894 	const QStringList getMinorBodiesList() const { return minorBodies; }
895 
896 private slots:
897 	//! Called when a new object is selected.
898 	void selectedObjectChange(StelModule::StelModuleSelectAction action);
899 
900 	//! Called when the sky culture is updated.
901 	//! Loads native names of planets for a given sky culture.
902 	//! @param skyCultureDir the name of the directory containing the sky culture to use.
903 	void updateSkyCulture(const QString& skyCultureDir);
904 
905 	//! Called following StelMainView::reloadShadersRequested
906 	void reloadShaders();
907 
908 	//! Set flag which enabled the showing of ephemeris markers or not
909 	void setFlagEphemerisMarkers(bool b);
910 	//! Get the current value of the flag which enabled the showing of ephemeris markers or not
911 	bool getFlagEphemerisMarkers() const;
912 
913 	//! Set flag which enabled the showing of ephemeris line between markers or not
914 	void setFlagEphemerisLine(bool b);
915 	//! Get the current value of the flag which enabled the showing of ephemeris line between markers or not
916 	bool getFlagEphemerisLine() const;
917 
918 	//! Set flag which enables ephemeris lines and marks always on
919 	void setFlagEphemerisAlwaysOn(bool b);
920 	//! Get the current value of the flag which makes ephemeris lines and marks always on
921 	bool getFlagEphemerisAlwaysOn() const;
922 
923 	//! Set the thickness of ephemeris line
924 	void setEphemerisLineThickness(int v);
925 	//! Get the thickness of ephemeris line
926 	int getEphemerisLineThickness() const;
927 
928 	//! Set flag which enabled the showing of ephemeris markers in horizontal coordinates or not
929 	void setFlagEphemerisHorizontalCoordinates(bool b);
930 	//! Get the current value of the flag which enabled the showing of ephemeris markers in horizontal coordinates or not
931 	bool getFlagEphemerisHorizontalCoordinates() const;
932 
933 	//! Set flag which enable the showing the date near ephemeris markers or not
934 	void setFlagEphemerisDates(bool b);
935 	//! Get the current value of the flag which enable the showing the date near ephemeris markers or not
936 	bool getFlagEphemerisDates() const;
937 
938 	//! Set flag which enable the showing the magnitude near ephemeris markers or not
939 	void setFlagEphemerisMagnitudes(bool b);
940 	//! Get the current value of the flag which enable the showing the magnitude near ephemeris markers or not
941 	bool getFlagEphemerisMagnitudes() const;
942 
943 	//! Set flag which allow skipping dates near ephemeris markers
944 	void setFlagEphemerisSkipData(bool b);
945 	//! Get the current value of the flag which allow skipping dates near ephemeris markers
946 	bool getFlagEphemerisSkipData() const;
947 
948 	//! Set flag which allow skipping the ephemeris markers without dates
949 	void setFlagEphemerisSkipMarkers(bool b);
950 	//! Get the current value of the flag which allow skipping the ephemeris markers without dates
951 	bool getFlagEphemerisSkipMarkers() const;
952 
953 	//! Set flag which allow using smart format for dates near ephemeris markers
954 	void setFlagEphemerisSmartDates(bool b);
955 	//! Get the current value of the flag which allow using smart format for dates near ephemeris markers
956 	bool getFlagEphemerisSmartDates() const;
957 
958 	//! Set flag which allow scaling the ephemeris markers
959 	void setFlagEphemerisScaleMarkers(bool b);
960 	//! Get the current value of the flag which allow scaling the ephemeris markers
961 	bool getFlagEphemerisScaleMarkers() const;
962 
963 	//! Set the step of skip for date of ephemeris markers (and markers if it enabled)
964 	void setEphemerisDataStep(int step);
965 	//! Get the step of skip for date of ephemeris markers
966 	int getEphemerisDataStep() const;
967 
968 	//! Set the limit for data: we computed ephemeris for 1, 2 or 5 celestial bodies
969 	void setEphemerisDataLimit(int limit);
970 	//! Get the limit of the data (how many celestial bodies was in computing of ephemeris)
971 	int getEphemerisDataLimit() const;
972 
973 	void setEphemerisGenericMarkerColor(const Vec3f& c);
974 	Vec3f getEphemerisGenericMarkerColor(void) const;
975 
976 	void setEphemerisSecondaryMarkerColor(const Vec3f& c);
977 	Vec3f getEphemerisSecondaryMarkerColor(void) const;
978 
979 	void setEphemerisSelectedMarkerColor(const Vec3f& c);
980 	Vec3f getEphemerisSelectedMarkerColor(void) const;
981 
982 	void setEphemerisMercuryMarkerColor(const Vec3f& c);
983 	Vec3f getEphemerisMercuryMarkerColor(void) const;
984 
985 	void setEphemerisVenusMarkerColor(const Vec3f& c);
986 	Vec3f getEphemerisVenusMarkerColor(void) const;
987 
988 	void setEphemerisMarsMarkerColor(const Vec3f& c);
989 	Vec3f getEphemerisMarsMarkerColor(void) const;
990 
991 	void setEphemerisJupiterMarkerColor(const Vec3f& c);
992 	Vec3f getEphemerisJupiterMarkerColor(void) const;
993 
994 	void setEphemerisSaturnMarkerColor(const Vec3f& c);
995 	Vec3f getEphemerisSaturnMarkerColor(void) const;
996 
997 	//! Called when a new Hips survey has been loaded by the hips mgr.
998 	void onNewSurvey(HipsSurveyP survey);
999 
1000 	//! Taking the JD dates for each ephemeride and preparation the human readable dates according to the settings for dates
1001 	void fillEphemerisDates();
1002 
1003 private:
1004 	//! Search for SolarSystem objects which are close to the position given
1005 	//! in earth equatorial position.
1006 	//! @param v A position in earth equatorial position.
1007 	//! @param core the StelCore object.
1008 	//! @return a pointer to a StelObject if found, else Q_NULLPTR
1009 	StelObjectP search(Vec3d v, const StelCore* core) const;
1010 
1011 	//! Compute the transformation matrix for every elements of the solar system.
1012 	//! observerPos is needed for light travel time computation.
1013 	void computeTransMatrices(double dateJDE, const Vec3d& observerPos = Vec3d(0.));
1014 
1015 	//! Draw a nice animated pointer around the object.
1016 	void drawPointer(const StelCore* core);
1017 
1018 	//! Draw ephemeris lines and markers
1019 	void drawEphemerisItems(const StelCore* core);
1020 
1021 	//! Draw a nice markers for ephemeris of objects.
1022 	void drawEphemerisMarkers(const StelCore* core);
1023 
1024 	//! Draw a line, who connected markers for ephemeris of objects.
1025 	void drawEphemerisLine(const StelCore* core);
1026 
1027 	//! Load planet data from the Solar System configuration files.
1028 	//! This function attempts to load every possible instance of the
1029 	//! Solar System configuration files in the file paths, falling back if a
1030 	//! given path can't be loaded.
1031 	void loadPlanets();
1032 
1033 	//! Load planet data from the given file
1034 	bool loadPlanets(const QString& filePath);
1035 
1036 	Vec3f getEphemerisMarkerColor(int index) const;
1037 
1038 	//! Calculate a color of Solar system bodies
1039 	//! @param bV value of B-V color index
1040 	static unsigned char BvToColorIndex(double bV);
1041 
1042 	//! Used to count how many planets actually need shadow information
1043 	int shadowPlanetCount;
1044 	//! Used to track whether earth shadow enlargement shall be computed after Danjon (1951)
1045 	bool earthShadowEnlargementDanjon;
1046 	PlanetP sun;
1047 	PlanetP moon;
1048 	PlanetP earth;
1049 
1050 	//! Set selected planets by englishName.
1051 	//! @param englishName The planet name or "" to select no planet
1052 	void setSelected(const QString& englishName);
1053 	//! Set selected object from its pointer.
1054 	void setSelected(PlanetP obj);
1055 	//! Get selected object's pointer.
getSelected(void) const1056 	PlanetP getSelected(void) const {return selected;}
1057 	//! The currently selected planet.
1058 	PlanetP selected;
1059 	std::vector<PlanetP> selectedSSO; // More than one can be selected at a time
1060 
1061 	// Allow enlargements of the planets. May be useful to highlight the planets in in overview plots
1062 	// Separate Moon and minor body scale values. The latter make sense to zoom up and observe irregularly formed 3D objects like minor moons of the outer planets.
1063 	bool flagMoonScale;
1064 	double moonScale;
1065 	bool flagMinorBodyScale;
1066 	double minorBodyScale;
1067 	bool flagPlanetScale;
1068 	double planetScale;
1069 	bool flagSunScale;
1070 	double sunScale;
1071 
1072 	QFont planetNameFont;
1073 
1074 	//! The amount of planet labels (between 0 and 10).
1075 	double labelsAmount;
1076 
1077 	// Flag to follow the state of drawing of solar corona
1078 	bool flagPermanentSolarCorona;
1079 
1080 	//! List of all the bodies of the solar system.
1081 	QList<PlanetP> systemPlanets;
1082 	//! List of all the minor bodies of the solar system.
1083 	QList<PlanetP> systemMinorBodies;
1084 
1085 	// Master settings
1086 	bool flagOrbits;
1087 	bool flagLightTravelTime;
1088 	bool flagUseObjModels;
1089 	bool flagShowObjSelfShadows;
1090 
1091 	//! The selection pointer texture.
1092 	StelTextureSP texPointer;
1093 	StelTextureSP texEphemerisMarker;
1094 	StelTextureSP texEphemerisCometMarker;
1095 
1096 	bool flagShow;
1097 	bool flagPointer;                           // show red cross selection pointer?
1098 	bool flagNativePlanetNames;                 // show native names for planets?
1099 	bool flagIsolatedTrails;
1100 	int numberIsolatedTrails;
1101 	int maxTrailPoints;                         // limit trails to a manageable size.
1102 	int maxTrailTimeExtent;
1103 	int trailsThickness;
1104 	bool flagIsolatedOrbits;
1105 	bool flagPlanetsOrbitsOnly;
1106 	bool ephemerisMarkersDisplayed;
1107 	bool ephemerisDatesDisplayed;
1108 	bool ephemerisMagnitudesDisplayed;
1109 	bool ephemerisHorizontalCoordinates;
1110 	bool ephemerisLineDisplayed;
1111 	bool ephemerisAlwaysOn;
1112 	int ephemerisLineThickness;
1113 	bool ephemerisSkipDataDisplayed;
1114 	bool ephemerisSkipMarkersDisplayed;
1115 	int ephemerisDataStep;				// How many days skip for dates near ephemeris markers (and the markers if it enabled)
1116 	int ephemerisDataLimit;				// Number of celestial bodies in ephemeris data (how many celestial bodies was in computing of ephemeris)
1117 	bool ephemerisSmartDatesDisplayed;
1118 	bool ephemerisScaleMarkersDisplayed;
1119 	Vec3f ephemerisGenericMarkerColor;
1120 	Vec3f ephemerisSecondaryMarkerColor;
1121 	Vec3f ephemerisSelectedMarkerColor;
1122 	Vec3f ephemerisMercuryMarkerColor;
1123 	Vec3f ephemerisVenusMarkerColor;
1124 	Vec3f ephemerisMarsMarkerColor;
1125 	Vec3f ephemerisJupiterMarkerColor;
1126 	Vec3f ephemerisSaturnMarkerColor;
1127 
1128 	class TrailGroup* allTrails;
1129 	QSettings* conf;
1130 	LinearFader trailFader;
1131 	Vec3f trailsColor;
1132 	Vec3f pointerColor;
1133 
1134 	QHash<QString, QString> planetNativeNamesMap, planetNativeNamesMeaningMap;
1135 	QStringList minorBodies;
1136 
1137 	// 0.16pre observation GZ: this list contains pointers to all orbit objects,
1138 	// while the planets don't own their orbit objects.
1139 	// Would it not be better to hand over the orbit object ownership to the Planet object?
1140 	// This list could then be removed.
1141 	// In case this was originally intended to provide some fast access for time-dependent computation with the same JD,
1142 	// note that we must also always compensate to light time travel, so likely each computation has to be done twice,
1143 	// with current JDE and JDE-lightTime(distance).
1144 	QList<Orbit*> orbits;           // Pointers on created elliptical orbits. 0.16pre: WHY DO WE NEED THIS???
1145 };
1146 
1147 
1148 #endif // SOLARSYSTEM_HPP
1149