• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Stellarium / stellarium / 13260145531

11 Feb 2025 09:41AM UTC coverage: 12.127% (+0.03%) from 12.101%
13260145531

Pull #3751

github

10110111
Restore deleted additional SC files
Pull Request #3751: Switch skycultures to the new format

14613 of 120497 relevant lines covered (12.13%)

18620.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/core/modules/SolarSystem.hpp
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 "StelHips.hpp"
32

33
#include <QFont>
34

35
class Orbit;
36
class StelSkyCulture;
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, protected QOpenGLFunctions
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
        Q_PROPERTY(bool trailsDisplayed                        READ getFlagTrails                        WRITE setFlagTrails                        NOTIFY trailsDisplayedChanged)
58
        Q_PROPERTY(int maxTrailPoints                        READ getMaxTrailPoints                        WRITE setMaxTrailPoints                        NOTIFY maxTrailPointsChanged)
59
        Q_PROPERTY(int maxTrailTimeExtent                READ getMaxTrailTimeExtent                WRITE setMaxTrailTimeExtent                NOTIFY maxTrailTimeExtentChanged)
60
        Q_PROPERTY(int trailsThickness                        READ getTrailsThickness                        WRITE setTrailsThickness                NOTIFY trailsThicknessChanged)
61
        // This is a "forwarding property" only, without own variable.
62
        Q_PROPERTY(bool flagHints                        READ getFlagHints                        WRITE setFlagHints                        NOTIFY flagHintsChanged)
63
        Q_PROPERTY(bool flagMarkers                        READ getFlagMarkers                        WRITE setFlagMarkers                        NOTIFY markersDisplayedChanged)
64
        Q_PROPERTY(bool flagPointer                        READ getFlagPointer                        WRITE setFlagPointer                        NOTIFY flagPointerChanged)
65
        Q_PROPERTY(bool flagNativePlanetNames                READ getFlagNativePlanetNames                WRITE setFlagNativePlanetNames                NOTIFY flagNativePlanetNamesChanged)
66
        Q_PROPERTY(bool planetsDisplayed                READ getFlagPlanets                        WRITE setFlagPlanets                        NOTIFY flagPlanetsDisplayedChanged)
67
        Q_PROPERTY(bool flagOrbits                        READ getFlagOrbits                        WRITE setFlagOrbits                        NOTIFY flagOrbitsChanged)
68
        Q_PROPERTY(bool flagPlanetsOrbits                READ getFlagPlanetsOrbits                WRITE setFlagPlanetsOrbits                NOTIFY flagPlanetsOrbitsChanged)
69
        Q_PROPERTY(bool flagPlanetsOrbitsOnly                READ getFlagPlanetsOrbitsOnly                WRITE setFlagPlanetsOrbitsOnly                NOTIFY flagPlanetsOrbitsOnlyChanged)
70
        Q_PROPERTY(bool flagPermanentOrbits                READ getFlagPermanentOrbits                WRITE setFlagPermanentOrbits                NOTIFY flagPermanentOrbitsChanged)
71
        Q_PROPERTY(bool flagIsolatedOrbits                READ getFlagIsolatedOrbits                WRITE setFlagIsolatedOrbits                NOTIFY flagIsolatedOrbitsChanged)
72
        Q_PROPERTY(bool flagOrbitsWithMoons                READ getFlagOrbitsWithMoons                WRITE setFlagOrbitsWithMoons                NOTIFY flagOrbitsWithMoonsChanged)
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
        Q_PROPERTY(bool ephemerisNow                        READ getFlagEphemerisNow                WRITE setFlagEphemerisNow                NOTIFY ephemerisNowChanged)
103
        // Great Red Spot (GRS) properties
104
        Q_PROPERTY(int grsLongitude                        READ getGrsLongitude                        WRITE setGrsLongitude                        NOTIFY grsLongitudeChanged)
105
        Q_PROPERTY(double grsDrift                        READ getGrsDrift                        WRITE setGrsDrift                        NOTIFY grsDriftChanged)
106
        Q_PROPERTY(double grsJD                                READ getGrsJD                                WRITE setGrsJD                                NOTIFY grsJDChanged)
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
        Q_PROPERTY(int extraThreads                     READ getExtraThreads                    WRITE setExtraThreads                   NOTIFY extraThreadsChanged)
149
        Q_PROPERTY(double markerMagThreshold            READ getMarkerMagThreshold              WRITE setMarkerMagThreshold             NOTIFY markerMagThresholdChanged)
150

151
public:
152
        SolarSystem();
153
        ~SolarSystem() override;
154

155
        ///////////////////////////////////////////////////////////////////////////
156
        // Methods defined in the StelModule class
157
        //! Initialize the SolarSystem.
158
        //! Includes:
159
        //! - loading planetary body orbital and model data from data/ssystem.ini
160
        //! - perform initial planet position calculation
161
        //! - set display options from application settings
162
        void init() override;
163

164
        void deinit() override;
165
        
166
        //! Draw SolarSystem objects (planets).
167
        //! @param core The StelCore object.
168
        //! @return The maximum squared distance in pixels that any SolarSystem object
169
        //! has travelled since the last update.
170
        void draw(StelCore *core) override;
171

172
        //! Update time-varying components.
173
        //! This includes planet motion trails.
174
        void update(double deltaTime) override;
175

176
        //! Used to determine what order to draw the various StelModules.
177
        double getCallOrder(StelModuleActionName actionName) const override;
178

179
        ///////////////////////////////////////////////////////////////////////////
180
        // Methods defined in StelObjectModule class
181
        //! Search for SolarSystem objects in some area around a point.
182
        //! @param v A vector representing a point in the sky in equatorial J2000 coordinates (without aberration).
183
        //! @param limitFov The radius of the circle around the point v which
184
        //! defines the size of the area to search.
185
        //! @param core the core object
186
        //! @return QList of StelObjectP (pointers) containing all SolarSystem objects
187
        //! found in the specified area. This vector is not sorted by distance from v.
188
        QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const override;
189

190
        //! Search for a SolarSystem object based on the localised name.
191
        //! @param nameI18n the case in-sensitive translated planet name.
192
        //! @return a StelObjectP for the object if found, else Q_NULLPTR.
193
        StelObjectP searchByNameI18n(const QString& nameI18n) const override;
194

195
        //! Search for a SolarSystem object based on the English name.
196
        //! @param name the case in-sensitive English planet name.
197
        //! @return a StelObjectP for the object if found, else Q_NULLPTR.
198
        StelObjectP searchByName(const QString& name) const override;
199

200
        StelObjectP searchByID(const QString &id) const override
×
201
        {
202
                return searchByName(id);
×
203
        }
204

205
        //! Find and return the list of at most maxNbItem objects auto-completing the passed object name.
206
        //! @param objPrefix the case insensitive first letters of the searched object
207
        //! @param maxNbItem the maximum number of returned object names
208
        //! @param useStartOfWords the autofill mode for returned objects names
209
        //! @return a list of matching object name by order of relevance, or an empty list if nothing match
210
        QStringList listMatchingObjects(const QString& objPrefix, int maxNbItem=5, bool useStartOfWords=false) const override;
211
        QStringList listAllObjects(bool inEnglish) const override;
212
        QStringList listAllObjectsByType(const QString& objType, bool inEnglish) const override;
213
        QString getName() const override { return "Solar System"; }
×
214
        QString getStelObjectType() const override { return Planet::PLANET_TYPE; }
×
215

216
public slots:
217
        ///////////////////////////////////////////////////////////////////////////
218
        // Method callable from script and GUI
219
        // Properties setters and getters
220
        //! Set flag which determines if planets are drawn or hidden.
221
        void setFlagPlanets(bool b);
222
        //! Get the current value of the flag which determines if planet are drawn or hidden.
223
        bool getFlagPlanets() const;
224

225
        //! Set flag which determines if planet trails are drawn or hidden.
226
        void setFlagTrails(bool b);
227
        //! Get the current value of the flag which determines if planet trails are drawn or hidden.
228
        bool getFlagTrails() const;
229

230
        //! Set thickness of trails.
231
        void setTrailsThickness(int v);
232
        //! Get thickness of trail.
233
        int getTrailsThickness() const {return trailsThickness;}
×
234

235
        //! Set maximum number of trail points. Too many points may slow down the application. 5000 seems to be a good balance.
236
        //! The trails are drawn for a maximum of 365 days and then fade out.
237
        //! If drawing many trails slows down the application, you can set a new maximum trail step length.
238
        //! Note that the fadeout may require more points or a decent simulation speed.
239
        void setMaxTrailPoints(int max);
240
        //! Get maximum number of trail points. Too many points may slow down the application. 5000 seems to be a good balance.
241
        int getMaxTrailPoints() const {return maxTrailPoints;}
×
242

243
        //! Set maximum number of trail time extent in years.
244
        //! Too many points may slow down the application. One year (365 days) seems to be a good balance.
245
        //! If drawing many trails slows down the application, you can set a new maximum trail time extent or step length.
246
        //! Note that the fadeout may require more points or a decent simulation speed.
247
        void setMaxTrailTimeExtent(int max);
248
        //! 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.
249
        int getMaxTrailTimeExtent() const {return maxTrailTimeExtent;}
×
250

251
        //! Set flag which determines if planet hints are drawn or hidden along labels
252
        void setFlagHints(bool b);
253
        //! Get the current value of the flag which determines if planet hints are drawn or hidden along labels
254
        bool getFlagHints() const;
255

256
        //! Set flag which determines if planet markers are drawn for minor bodies
257
        void setFlagMarkers(bool b);
258
        //! Get the current value of the flag which determines if planet markers are drawn for minor bodies
259
        bool getFlagMarkers() const;
260

261
        //! Set flag which determines if planet labels are drawn or hidden.
262
        void setFlagLabels(bool b);
263
        //! Get the current value of the flag which determines if planet labels are drawn or hidden.
264
        bool getFlagLabels() const;
265

266
        //! Set the amount of planet labels. The real amount is also proportional with FOV.
267
        //! The limit is set in function of the planets magnitude
268
        //! @param a the amount between 0 and 10. 0 is no labels, 10 is maximum of labels
269
        void setLabelsAmount(double a) {if(!fuzzyEquals(a, labelsAmount)) {labelsAmount=a; StelApp::immediateSave("astro/labels_amount", a); emit labelsAmountChanged(a);}}
×
270
        //! Get the amount of planet labels. The real amount is also proportional with FOV.
271
        //! @return the amount between 0 and 10. 0 is no labels, 10 is maximum of labels
272
        double getLabelsAmount(void) const {return labelsAmount;}
×
273

274
        //! Set flag which determines if planet orbits are drawn or hidden.
275
        void setFlagOrbits(bool b);
276
        //! Get the current value of the flag which determines if planet orbits are drawn or hidden.
277
        bool getFlagOrbits() const {return flagOrbits;}
×
278

279
        //! Set flag which determines if the planet pointer (red cross) is drawn or hidden on a selected planet.
280
        void setFlagPointer(bool b) { if (b!=flagPointer) { flagPointer=b; StelApp::immediateSave("astro/flag_planets_pointers", b); emit flagPointerChanged(b); }}
×
281
        //! Get the current value of the flag which determines if planet pointers are drawn or hidden.
282
        bool getFlagPointer() const { return flagPointer;}
×
283

284
        //! Set flag which determines if the light travel time calculation is used or not.
285
        void setFlagLightTravelTime(bool b);
286
        //! Get the current value of the flag which determines if light travel time
287
        //! calculation is used or not.
288
        bool getFlagLightTravelTime(void) const {return flagLightTravelTime;}
×
289

290
        //! Set flag whether to use OBJ models for rendering, where available
291
        void setFlagUseObjModels(bool b) { if(b!=flagUseObjModels) { flagUseObjModels = b; StelApp::immediateSave("astro/flag_use_obj_models", b); emit flagUseObjModelsChanged(b); } }
×
292
        //! Get the current value of the flag which determines whether to use OBJ models for rendering, where available
293
        bool getFlagUseObjModels(void) const { return flagUseObjModels; }
×
294

295
        //! Set flag whether OBJ models should render self-shadowing (using a shadow map)
296
        void setFlagShowObjSelfShadows(bool b);
297
        //! Get the current value of the flag which determines whether OBJ models should render self-shadowing (using a shadow map)
298
        bool getFlagShowObjSelfShadows(void) const { return flagShowObjSelfShadows; }
×
299

300
        //! Set planet names font size.
301
        //! @return font size
302
        void setFontSize(int newFontSize);
303

304
        //! Set the color used to draw planet labels.
305
        //! @param c The color of the planet labels (R,G,B)
306
        //! @code
307
        //! // example of usage in scripts
308
        //! SolarSystem.setLabelsColor(Vec3f(1.0,0.0,0.0));
309
        //! @endcode
310
        void setLabelsColor(const Vec3f& c);
311
        //! Get the current color used to draw planet labels.
312
        //! @return current color
313
        Vec3f getLabelsColor(void) const;
314

315
        //! Set the color used to draw solar system object orbit lines.
316
        //! @param c The color of the solar system object orbit lines (R,G,B)
317
        //! @code
318
        //! // example of usage in scripts
319
        //! SolarSystem.setOrbitsColor(Vec3f(1.0,0.0,0.0));
320
        //! @endcode
321
        void setOrbitsColor(const Vec3f& c);
322
        //! Get the current color used to draw solar system object orbit lines.
323
        //! @return current color
324
        Vec3f getOrbitsColor(void) const;
325

326
        //! Set the color used to draw orbits lines of the major planets.
327
        //! @param c The color of orbits lines of the major planets (R,G,B)
328
        //! @code
329
        //! // example of usage in scripts
330
        //! SolarSystem.setMajorPlanetsOrbitsColor(Vec3f(1.0,0.0,0.0));
331
        //! @endcode
332
        void setMajorPlanetsOrbitsColor(const Vec3f& c);
333
        //! Get the current color used to draw orbits lines of the major planets.
334
        //! @return current color
335
        Vec3f getMajorPlanetsOrbitsColor(void) const;
336

337
        //! Set the color used to draw orbits lines of moons of planets.
338
        //! @param c The color of orbits lines of moons of planets lines (R,G,B)
339
        //! @code
340
        //! // example of usage in scripts
341
        //! SolarSystem.setMoonsOrbitsColor(Vec3f(1.0,0.0,0.0));
342
        //! @endcode
343
        void setMoonsOrbitsColor(const Vec3f& c);
344
        //! Get the current color used to draw orbits lines of moons of planets.
345
        //! @return current color
346
        Vec3f getMoonsOrbitsColor(void) const;
347

348
        //! Set the color used to draw orbits lines of the minor planets.
349
        //! @param c The color of orbits lines of the minor planets (R,G,B)
350
        //! @code
351
        //! // example of usage in scripts
352
        //! SolarSystem.setMinorPlanetsOrbitsColor(Vec3f(1.0,0.0,0.0));
353
        //! @endcode
354
        void setMinorPlanetsOrbitsColor(const Vec3f& c);
355
        //! Get the current color used to draw orbits lines of the minor planets.
356
        //! @return current color
357
        Vec3f getMinorPlanetsOrbitsColor(void) const;
358

359
        //! Set the color used to draw orbits lines of the dwarf planets.
360
        //! @param c The color of orbits lines of the dwarf planets (R,G,B)
361
        //! @code
362
        //! // example of usage in scripts
363
        //! SolarSystem.setDwarfPlanetsOrbitsColor(Vec3f(1.0,0.0,0.0));
364
        //! @endcode
365
        void setDwarfPlanetsOrbitsColor(const Vec3f& c);
366
        //! Get the current color used to draw orbits lines of the dwarf planets.
367
        //! @return current color
368
        Vec3f getDwarfPlanetsOrbitsColor(void) const;
369

370
        //! Set the color used to draw orbits lines of cubewanos.
371
        //! @param c The color of orbits lines of cubewanos (R,G,B)
372
        //! @code
373
        //! // example of usage in scripts
374
        //! SolarSystem.setCubewanosOrbitsColor(Vec3f(1.0,0.0,0.0));
375
        //! @endcode
376
        void setCubewanosOrbitsColor(const Vec3f& c);
377
        //! Get the current color used to draw orbits lines of cubewanos.
378
        //! @return current color
379
        Vec3f getCubewanosOrbitsColor(void) const;
380

381
        //! Set the color used to draw orbits lines of plutinos.
382
        //! @param c The color of orbits lines of plutinos (R,G,B)
383
        //! @code
384
        //! // example of usage in scripts
385
        //! SolarSystem.setPlutinosOrbitsColor(Vec3f(1.0,0.0,0.0));
386
        //! @endcode
387
        void setPlutinosOrbitsColor(const Vec3f& c);
388
        //! Get the current color used to draw orbits lines of plutinos.
389
        //! @return current color
390
        Vec3f getPlutinosOrbitsColor(void) const;
391

392
        //! Set the color used to draw orbits lines of scattered disk objects.
393
        //! @param c The color of orbits lines of scattered disk objects (R,G,B)
394
        //! @code
395
        //! // example of usage in scripts
396
        //! SolarSystem.setScatteredDiskObjectsOrbitsColor(Vec3f(1.0,0.0,0.0));
397
        //! @endcode
398
        void setScatteredDiskObjectsOrbitsColor(const Vec3f& c);
399
        //! Get the current color used to draw orbits lines of scattered disk objects.
400
        //! @return current color
401
        Vec3f getScatteredDiskObjectsOrbitsColor(void) const;
402

403
        //! Set the color used to draw orbits lines of Oort cloud objects.
404
        //! @param c The color of orbits lines of Oort cloud objects (R,G,B)
405
        //! @code
406
        //! // example of usage in scripts
407
        //! SolarSystem.setOortCloudObjectsOrbitsColor(Vec3f(1.0,0.0,0.0));
408
        //! @endcode
409
        void setOortCloudObjectsOrbitsColor(const Vec3f& c);
410
        //! Get the current color used to draw orbits lines of Oort cloud objects.
411
        //! @return current color
412
        Vec3f getOortCloudObjectsOrbitsColor(void) const;
413

414
        //! Set the color used to draw comet orbit lines.
415
        //! @param c The color of the comet orbit lines (R,G,B)
416
        //! @code
417
        //! // example of usage in scripts
418
        //! SolarSystem.setCometsOrbitsColor(Vec3f(1.0,0.0,0.0));
419
        //! @endcode
420
        void setCometsOrbitsColor(const Vec3f& c);
421
        //! Get the current color used to draw comet orbit lines.
422
        //! @return current color
423
        Vec3f getCometsOrbitsColor(void) const;
424

425
        //! Set the color used to draw sednoid orbit lines.
426
        //! @param c The color of the sednoid orbit lines (R,G,B)
427
        //! @code
428
        //! // example of usage in scripts
429
        //! SolarSystem.setSednoidsOrbitsColor(Vec3f(1.0,0.0,0.0));
430
        //! @endcode
431
        void setSednoidsOrbitsColor(const Vec3f& c);
432
        //! Get the current color used to draw sednoid orbit lines.
433
        //! @return current color
434
        Vec3f getSednoidsOrbitsColor(void) const;
435

436
        //! Set the color used to draw interstellar orbit (hyperbolic trajectory) lines.
437
        //! @param c The color of the interstellar orbit lines (R,G,B)
438
        //! @code
439
        //! // example of usage in scripts
440
        //! SolarSystem.setInterstellarOrbitsColor(Vec3f(1.0,0.0,0.0));
441
        //! @endcode
442
        void setInterstellarOrbitsColor(const Vec3f& c);
443
        //! Get the current color used to draw interstellar orbit lines.
444
        //! @return current color
445
        Vec3f getInterstellarOrbitsColor(void) const;
446

447
        //! Set the color used to draw Mercury orbit line.
448
        //! @param c The color of Mercury orbit line (R,G,B)
449
        //! @code
450
        //! // example of usage in scripts
451
        //! SolarSystem.setMercuryOrbitColor(Vec3f(1.0,0.0,0.0));
452
        //! @endcode
453
        void setMercuryOrbitColor(const Vec3f& c);
454
        //! Get the current color used to draw Mercury orbit line.
455
        //! @return current color
456
        Vec3f getMercuryOrbitColor(void) const;
457

458
        //! Set the color used to draw Venus orbit line.
459
        //! @param c The color of Venus orbit line (R,G,B)
460
        //! @code
461
        //! // example of usage in scripts
462
        //! SolarSystem.setVenusOrbitColor(Vec3f(1.0,0.0,0.0));
463
        //! @endcode
464
        void setVenusOrbitColor(const Vec3f& c);
465
        //! Get the current color used to draw Venus orbit line.
466
        //! @return current color
467
        Vec3f getVenusOrbitColor(void) const;
468

469
        //! Set the color used to draw Earth orbit line.
470
        //! @param c The color of Earth orbit line (R,G,B)
471
        //! @code
472
        //! // example of usage in scripts
473
        //! SolarSystem.setEarthOrbitColor(Vec3f(1.0,0.0,0.0));
474
        //! @endcode
475
        void setEarthOrbitColor(const Vec3f& c);
476
        //! Get the current color used to draw Earth orbit line.
477
        //! @return current color
478
        Vec3f getEarthOrbitColor(void) const;
479

480
        //! Set the color used to draw Mars orbit line.
481
        //! @param c The color of Mars orbit line (R,G,B)
482
        //! @code
483
        //! // example of usage in scripts
484
        //! SolarSystem.setMarsOrbitColor(Vec3f(1.0,0.0,0.0));
485
        //! @endcode
486
        void setMarsOrbitColor(const Vec3f& c);
487
        //! Get the current color used to draw Mars orbit line.
488
        //! @return current color
489
        Vec3f getMarsOrbitColor(void) const;
490

491
        //! Set the color used to draw Jupiter orbit line.
492
        //! @param c The color of Jupiter orbit line (R,G,B)
493
        //! @code
494
        //! // example of usage in scripts
495
        //! SolarSystem.setJupiterOrbitColor(Vec3f(1.0,0.0,0.0));
496
        //! @endcode
497
        void setJupiterOrbitColor(const Vec3f& c);
498
        //! Get the current color used to draw Jupiter orbit line.
499
        //! @return current color
500
        Vec3f getJupiterOrbitColor(void) const;
501

502
        //! Set the color used to draw Saturn orbit line.
503
        //! @param c The color of Saturn orbit line (R,G,B)
504
        //! @code
505
        //! // example of usage in scripts
506
        //! SolarSystem.setSaturnOrbitColor(Vec3f(1.0,0.0,0.0));
507
        //! @endcode
508
        void setSaturnOrbitColor(const Vec3f& c);
509
        //! Get the current color used to draw Saturn orbit line.
510
        //! @return current color
511
        Vec3f getSaturnOrbitColor(void) const;
512

513
        //! Set the color used to draw Uranus orbit line.
514
        //! @param c The color of Uranus orbit line (R,G,B)
515
        //! @code
516
        //! // example of usage in scripts
517
        //! SolarSystem.setUranusOrbitColor(Vec3f(1.0,0.0,0.0));
518
        //! @endcode
519
        void setUranusOrbitColor(const Vec3f& c);
520
        //! Get the current color used to draw Uranus orbit line.
521
        //! @return current color
522
        Vec3f getUranusOrbitColor(void) const;
523

524
        //! Set the color used to draw Neptune orbit line.
525
        //! @param c The color of Neptune orbit line (R,G,B)
526
        //! @code
527
        //! // example of usage in scripts
528
        //! SolarSystem.setNeptuneOrbitColor(Vec3f(1.0,0.0,0.0));
529
        //! @endcode
530
        void setNeptuneOrbitColor(const Vec3f& c);
531
        //! Get the current color used to draw Neptune orbit line.
532
        //! @return current color
533
        Vec3f getNeptuneOrbitColor(void) const;
534

535
        //! Set the color used to draw planet trails lines.
536
        //! @param c The color of the planet trails lines (R,G,B)
537
        //! @code
538
        //! // example of usage in scripts
539
        //! SolarSystem.setTrailsColor(Vec3f(1.0,0.0,0.0));
540
        //! @endcode
541
        void setTrailsColor(const Vec3f& c) {if (c!=trailsColor) { trailsColor=c; emit trailsColorChanged(c);}}
×
542
        //! Get the current color used to draw planet trails lines.
543
        //! @return current color
544
        Vec3f getTrailsColor() const {return trailsColor;}
×
545

546
        //! Set the color used to draw planet pointers.
547
        //! @param c The color of the planet pointers
548
        //! @code
549
        //! // example of usage in scripts
550
        //! SolarSystem.setPointerColor(Vec3f(1.0,0.0,0.0));
551
        //! @endcode
552
        void setPointerColor(const Vec3f& c) {if (c!=pointerColor) {pointerColor=c; emit pointerColorChanged(c);}}
×
553
        //! Get the current color used to draw planet pointers.
554
        //! @return current color
555
        Vec3f getPointerColor() const {return pointerColor;}
×
556

557
        //! Set flag which determines if Earth's moon is scaled or not.
558
        void setFlagMoonScale(bool b);
559
        //! Get the current value of the flag which determines if Earth's moon is scaled or not.
560
        bool getFlagMoonScale(void) const {return flagMoonScale;}
×
561

562
        //! Set the display scaling factor for Earth's moon.
563
        void setMoonScale(double f);
564
        //! Get the display scaling factor for Earth's moon.
565
        double getMoonScale(void) const {return moonScale;}
×
566

567
        //! Set flag which determines if minor bodies (everything except the 8 planets) are drawn scaled or not.
568
        void setFlagMinorBodyScale(bool b);
569
        //! Get the current value of the flag which determines if minor bodies (everything except the 8 planets) are drawn scaled or not.
570
        bool getFlagMinorBodyScale(void) const {return flagMinorBodyScale;}
×
571

572
        //! Set the display scaling factor for minor bodies.
573
        void setMinorBodyScale(double f);
574
        //! Get the display scaling factor for minor bodies.
575
        double getMinorBodyScale(void) const {return minorBodyScale;}
×
576

577
        //! Set flag which determines if planets are displayed scaled or not.
578
        void setFlagPlanetScale(bool b);
579
        //! Get the current value of the flag which determines if planets are displayed scaled or not.
580
        bool getFlagPlanetScale(void) const {return flagPlanetScale;}
×
581

582
        //! Set the display scaling factor for planets.
583
        void setPlanetScale(double f);
584
        //! Get the display scaling factor for planets.
585
        double getPlanetScale(void) const {return planetScale;}
×
586

587
        //! Set flag which determines if Sun is scaled or not.
588
        void setFlagSunScale(bool b);
589
        //! Get the current value of the flag which determines if Sun is scaled or not.
590
        bool getFlagSunScale(void) const {return flagSunScale;}
×
591

592
        //! Set the display scaling factor for Sun.
593
        void setSunScale(double f);
594
        //! Get the display scaling factor for Sun.
595
        double getSunScale(void) const {return sunScale;}
×
596

597
        //! Translate names. (public so that SolarSystemEditor can call it).
598
        void updateI18n();
599

600
        //! Get the V magnitude for Solar system bodies for scripts
601
        //! @param planetName the case in-sensitive English planet name.
602
        //! @param withExtinction the flag for use extinction effect for magnitudes (default not use)
603
        //! @return a magnitude
604
        float getPlanetVMagnitude(const QString &planetName, bool withExtinction=false) const;
605

606
        //! Get type for Solar system bodies for scripts
607
        //! @param planetName the case in-sensitive English planet name.
608
        //! @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)
609
        QString getPlanetType(const QString &planetName) const;
610

611
        //! Get distance to Solar system bodies for scripts
612
        //! @param planetName the case in-sensitive English planet name.
613
        //! @return a distance (in AU)
614
        double getDistanceToPlanet(const QString &planetName) const;
615

616
        //! Get elongation for Solar system bodies for scripts
617
        //! @param planetName the case in-sensitive English planet name.
618
        //! @return a elongation (in radians)
619
        double getElongationForPlanet(const QString &planetName) const;
620

621
        //! Get phase angle for Solar system bodies for scripts
622
        //! @param planetName the case in-sensitive English planet name.
623
        //! @return a phase angle (in radians)
624
        double getPhaseAngleForPlanet(const QString &planetName) const;
625

626
        //! Get phase for Solar system bodies for scripts
627
        //! @param planetName the case in-sensitive English planet name.
628
        //! @return phase, i.e. illuminated fraction [0..1]
629
        float getPhaseForPlanet(const QString &planetName) const;
630

631
        //! Set the algorithm for computation of apparent magnitudes for planets in case observer on the Earth.
632
        //! Possible values:
633
        //! @li @c Mueller1893 [Explanatory Supplement to the Astronomical Ephemeris, 1961] (visual magnitudes, based on visual observations by G. Mueller, 1877-91)
634
        //! @li @c AstrAlm1984 [Astronomical Almanac 1984] and later. These give V (instrumental) magnitudes.
635
        //! @li @c ExpSup1992 [Explanatory Supplement to the Astronomical Almanac, 1992] (algorithm contributed by Pere Planesas, Observatorio Astronomico Nacional)
636
        //! @li @c ExpSup2013 [Explanatory Supplement to the Astronomical Almanac, 3rd edition, 2013]
637
        //! @li @c Generic Visual magnitude based on phase angle and albedo.
638
        //! Details:
639
        //! @li J. Meeus "Astronomical Algorithms" (2nd ed. 1998, with corrections as of August 10, 2009) p.283-286.
640
        //! @li O. Montenbruck, T. Pfleger "Astronomy on the Personal Computer" (4th ed.) p.143-145.
641
        //! @li Daniel L. Harris "Photometry and Colorimetry of Planets and Satellites" http://adsabs.harvard.edu/abs/1961plsa.book..272H
642
        //! @li Sean E. Urban and P. Kenneth Seidelmann "Explanatory Supplement to the Astronomical Almanac" (3rd edition, 2013)
643
        //! It is interesting to note that Meeus in his discussion of "Harris" states that Harris did not give new values.
644
        //! The book indeed mentions a few values for the inner planets citing Danjon, but different from those then listed by Meeus.
645
        //! Therefore it must be assumed that the "Harris" values are misnomed, and are the least certain set.
646
        //! Hint: Default option in config.ini: astro/apparent_magnitude_algorithm = ExpSup2013
647
        //! @param algorithm the case in-sensitive algorithm name
648
        //! @note: The structure of algorithms is almost identical, just the numbers are different!
649
        //!        You should activate Mueller's algorithm to simulate the eye's impression. (Esp. Venus!)
650
        void setApparentMagnitudeAlgorithmOnEarth(const QString &algorithm);
651
        //! overload with numeric ID
652
        void setApparentMagnitudeAlgorithmOnEarth(const Planet::ApparentMagnitudeAlgorithm id);
653
        //! Get the algorithm used for computation of apparent magnitudes for planets in case observer on the Earth
654
        //! @see setApparentMagnitudeAlgorithmOnEarth()
655
        QString getApparentMagnitudeAlgorithmOnEarth() const;
656

657
        //! Set flag which enable use native names for planets or not.
658
        void setFlagNativePlanetNames(bool b);
659
        //! Get the current value of the flag which enables showing native names for planets or not.
660
        bool getFlagNativePlanetNames(void) const;
661

662
        //! Set flag which enabled the showing of isolated trails for selected objects only or not
663
        void setFlagIsolatedTrails(bool b);
664
        //! Get the current value of the flag which enables showing of isolated trails for selected objects only or not.
665
        bool getFlagIsolatedTrails(void) const;
666

667
        //! Set number of displayed of isolated trails for latest selected objects
668
        void setNumberIsolatedTrails(int n);
669
        //! Get the number of displayed of isolated trails for latest selected objects
670
        int getNumberIsolatedTrails(void) const;
671

672
        //! Set flag which enabled the showing of isolated orbits for selected objects only or not
673
        void setFlagIsolatedOrbits(bool b);
674
        //! Get the current value of the flag which enables showing of isolated orbits for selected objects only or not.
675
        bool getFlagIsolatedOrbits(void) const;
676

677
        //! Set flag which enabled the showing of planets orbits, regardless of the other orbit settings
678
        void setFlagPlanetsOrbits(bool b);
679
        //! Get the current value of the flag which enables showing of planets orbits, regardless of the other orbit settings.
680
        bool getFlagPlanetsOrbits(void) const;
681

682
        //! Set flag which enabled the showing of planets orbits only or not
683
        void setFlagPlanetsOrbitsOnly(bool b);
684
        //! Get the current value of the flag which enables showing of planets orbits only or not.
685
        bool getFlagPlanetsOrbitsOnly(void) const;
686

687
        //! Set flag which enables showing of planets orbits together mith orbits of their moons.
688
        void setFlagOrbitsWithMoons(bool b);
689
        //! Get the current value of the flag for showing of planets orbits together mith orbits of their moons.
690
        bool getFlagOrbitsWithMoons(void) const;
691

692
        //! 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)
693
        void setFlagPermanentSolarCorona(bool b) {if (flagPermanentSolarCorona!=b){ flagPermanentSolarCorona = b; StelApp::immediateSave("viewing/flag_draw_sun_corona", b); emit flagPermanentSolarCoronaChanged(b); } }
×
694
        //! 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.
695
        bool getFlagPermanentSolarCorona(void) const { return flagPermanentSolarCorona; }
×
696

697
        //! Set longitude of Great Red Spot (System II is used)
698
        //! @param longitude (degrees)
699
        void setGrsLongitude(int longitude);
700
        //! Get longitude of Great Red Spot (System II is used)
701
        //! @return a longitude (degrees)
702
        int getGrsLongitude() const;
703

704
        //! Set speed of annual drift for Great Red Spot (System II is used)
705
        //! @param annual drift (degrees)
706
        void setGrsDrift(double drift);
707
        //! Get speed of annual drift for Great Red Spot (System II is used)
708
        double getGrsDrift() const;
709

710
        //! Set initial JD for calculation of position of Great Red Spot
711
        //! @param JD
712
        // TODO (GZ): Clarify whether this is JD or rather JDE?
713
        void setGrsJD(double JD);
714
        //! Get initial JD for calculation of position of Great Red Spot
715
        double getGrsJD();
716

717
        //! Set whether earth shadow should be enlarged following Danjon's method
718
        void setFlagEarthShadowEnlargementDanjon(bool b);
719
        //! Get whether earth shadow should be enlarged following Danjon's method
720
        bool getFlagEarthShadowEnlargementDanjon() const;
721

722
        //! Set style of colors of orbits for Solar system bodies
723
        void setOrbitColorStyle(const QString &style);
724
        //! Get style of colors of orbits for Solar system bodies
725
        QString getOrbitColorStyle() const;
726

727
        //! Get list of objects by type
728
        //! @param objType object type
729
        QStringList getObjectsList(QString objType="all") const;
730

731
        //! Set flag which enables display of orbits for planets even if they are off screen
732
        void setFlagPermanentOrbits(bool b);
733
        bool getFlagPermanentOrbits() const;
734

735
        void setOrbitsThickness(int v);
736
        int getOrbitsThickness() const;
737

738
        void setFlagDrawMoonHalo(bool b);
739
        bool getFlagDrawMoonHalo() const;
740

741
        void setFlagDrawSunHalo(bool b);
742
        bool getFlagDrawSunHalo() const;
743

744
        //! Reload the planets. This can be helpful as scripting command when editing planet details, e.g. comet tails or magnitude parameters.
745
        void reloadPlanets();
746

747
        //! Reset and recreate trails
748
        void recreateTrails();
749

750
        //! Reset textures for planet @param planetName
751
        //! @note if @param planetName is empty then reset will happen for all solar system objects
752
        void resetTextures(const QString& planetName);
753

754
        //! Replace the texture for the planet @param planetName
755
        //! @param planetName - English name of the planet
756
        //! @param texName - file path for texture
757
        //! The texture path starts in the scripts directory.
758
        void setTextureForPlanet(const QString &planetName, const QString &texName);
759

760
        //! Return the number of additional threads (in addition to the main thread) configured to compute planet positions.
761
        int getExtraThreads() const {return extraThreads;}
×
762
        //! Configure the number of additional threads (in addition to the main thread) to compute planet positions.
763
        //! The argument will be bounded by 0 and QThreadPool::globalInstance()->maxThreadCount()-1
764
        void setExtraThreads(int n);
765

766
        //! Return the limiting absolute magnitude configured for plotting minor bodies. (min. mag. 37 includes de facto "all".)
767
        double getMarkerMagThreshold() const {return markerMagThreshold;}
×
768
        //! Configure the limiting absolute magnitude for plotting minor bodies. Configured value is clamped to -2..37 (practical limit)
769
        void setMarkerMagThreshold(double m);
770

771
signals:
772
        void labelsDisplayedChanged(bool b);
773
        void flagOrbitsChanged(bool b);
774
        void flagHintsChanged(bool b);
775
        void markersDisplayedChanged(bool b);
776
        void flagDrawMoonHaloChanged(bool b);
777
        void flagDrawSunHaloChanged(bool b);
778
        void trailsDisplayedChanged(bool b);
779
        void trailsThicknessChanged(int v);
780
        void orbitsThicknessChanged(int v);
781
        void maxTrailPointsChanged(int max);
782
        void maxTrailTimeExtentChanged(int max);
783
        void flagPointerChanged(bool b);
784
        void flagNativePlanetNamesChanged(bool b);
785
        void flagPlanetsDisplayedChanged(bool b);
786
        void flagPlanetsOrbitsChanged(bool b);
787
        void flagPlanetsOrbitsOnlyChanged(bool b);
788
        void flagPermanentOrbitsChanged(bool b);
789
        void flagIsolatedOrbitsChanged(bool b);
790
        void flagOrbitsWithMoonsChanged(bool b);
791
        void flagIsolatedTrailsChanged(bool b);
792
        void numberIsolatedTrailsChanged(int n);
793
        void flagLightTravelTimeChanged(bool b);
794
        void flagUseObjModelsChanged(bool b);
795
        void flagShowObjSelfShadowsChanged(bool b);
796
        void flagMoonScaleChanged(bool b);
797
        void moonScaleChanged(double f);
798
        void flagMinorBodyScaleChanged(bool b);
799
        void minorBodyScaleChanged(double f);
800
        void flagPlanetScaleChanged(bool b);
801
        void planetScaleChanged(double f);
802
        void flagSunScaleChanged(bool b);
803
        void sunScaleChanged(double f);
804
        void labelsAmountChanged(double f);
805
        void ephemerisMarkersChanged(bool b);
806
        void ephemerisHorizontalCoordinatesChanged(bool b);
807
        void ephemerisDatesChanged(bool b);
808
        void ephemerisMagnitudesChanged(bool b);
809
        void ephemerisLineChanged(bool b);
810
        void ephemerisAlwaysOnChanged(bool b);
811
        void ephemerisNowChanged(bool b);
812
        void ephemerisLineThicknessChanged(int v);
813
        void ephemerisSkipDataChanged(bool b);
814
        void ephemerisSkipMarkersChanged(bool b);
815
        void ephemerisDataStepChanged(int s);
816
        void ephemerisDataLimitChanged(int s);
817
        void ephemerisSmartDatesChanged(bool b);
818
        void ephemerisScaleMarkersChanged(bool b);
819
        void grsLongitudeChanged(int l);
820
        void grsDriftChanged(double drift);
821
        void grsJDChanged(double JD);
822
        void earthShadowEnlargementDanjonChanged(bool b);
823
        void flagPermanentSolarCoronaChanged(bool b);
824

825
        void labelsColorChanged(const Vec3f & color);
826
        void pointerColorChanged(const Vec3f & color);
827
        void trailsColorChanged(const Vec3f & color);
828
        void orbitsColorChanged(const Vec3f & color);
829
        void nomenclatureColorChanged(const Vec3f & color);
830
        void majorPlanetsOrbitsColorChanged(const Vec3f & color);
831
        void minorPlanetsOrbitsColorChanged(const Vec3f & color);
832
        void dwarfPlanetsOrbitsColorChanged(const Vec3f & color);
833
        void moonsOrbitsColorChanged(const Vec3f & color);
834
        void cubewanosOrbitsColorChanged(const Vec3f & color);
835
        void plutinosOrbitsColorChanged(const Vec3f & color);
836
        void scatteredDiskObjectsOrbitsColorChanged(const Vec3f & color);
837
        void oortCloudObjectsOrbitsColorChanged(const Vec3f & color);
838
        void cometsOrbitsColorChanged(const Vec3f & color);
839
        void sednoidsOrbitsColorChanged(const Vec3f & color);
840
        void interstellarOrbitsColorChanged(const Vec3f & color);
841
        void mercuryOrbitColorChanged(const Vec3f & color);
842
        void venusOrbitColorChanged(const Vec3f & color);
843
        void earthOrbitColorChanged(const Vec3f & color);
844
        void marsOrbitColorChanged(const Vec3f & color);
845
        void jupiterOrbitColorChanged(const Vec3f & color);
846
        void saturnOrbitColorChanged(const Vec3f & color);
847
        void uranusOrbitColorChanged(const Vec3f & color);
848
        void neptuneOrbitColorChanged(const Vec3f & color);
849
        void ephemerisGenericMarkerColorChanged(const Vec3f & color);
850
        void ephemerisSecondaryMarkerColorChanged(const Vec3f & color);
851
        void ephemerisSelectedMarkerColorChanged(const Vec3f & color);
852
        void ephemerisMercuryMarkerColorChanged(const Vec3f & color);
853
        void ephemerisVenusMarkerColorChanged(const Vec3f & color);
854
        void ephemerisMarsMarkerColorChanged(const Vec3f & color);
855
        void ephemerisJupiterMarkerColorChanged(const Vec3f & color);
856
        void ephemerisSaturnMarkerColorChanged(const Vec3f & color);
857

858
        void orbitColorStyleChanged(const QString &style);
859
        void apparentMagnitudeAlgorithmOnEarthChanged(const QString &algorithm);
860

861
        void solarSystemDataReloaded();
862
        void requestEphemerisVisualization();
863

864
        void extraThreadsChanged(const int);
865

866
        void markerMagThresholdChanged(double m);
867

868
public:
869
        ///////////////////////////////////////////////////////////////////////////
870
        // Other public methods
871
        //! Get a pointer to a Planet object.
872
        //! @param planetEnglishName the English name of the desired planet.
873
        //! @return The matching planet pointer if exists or Q_NULLPTR.
874
        PlanetP searchByEnglishName(const QString &planetEnglishName) const;
875

876
        PlanetP searchMinorPlanetByEnglishName(const QString &planetEnglishName) const;
877

878
        //! Get the Planet object pointer for the Sun.
879
        PlanetP getSun() const {return sun;}
×
880

881
        //! Get the Planet object pointer for the Earth.
882
        PlanetP getEarth() const {return earth;}
×
883

884
        //! Get the Planet object pointer for Earth's moon.
885
        PlanetP getMoon() const {return moon;}
×
886

887
        //! Determine if a lunar eclipse is close at hand?
888
        bool nearLunarEclipse() const;
889

890
        //! Get the list of all the planet english names
891
        QStringList getAllPlanetEnglishNames() const;
892

893
        //! Get the list of all the planet localized names
894
        QStringList getAllPlanetLocalizedNames() const;
895

896
        //! Get the list of all the minor planet common english names
897
        QStringList getAllMinorPlanetCommonEnglishNames() const;
898

899

900
        //! New 0.16: delete a planet from the solar system. Writes a warning to log if this is not a minor object.
901
        bool removeMinorPlanet(const QString &name);
902

903
        //! Determines relative amount of sun visible from the observer's position (first element) and the Planet object pointer for eclipsing celestial body (second element).
904
        //! Full sun is 1.0, fully covered sun is 0.0.
905
        //! In the unlikely event of multiple objects in front of the sun, only the largest will be reported.
906
        QPair<double, PlanetP> getSolarEclipseFactor(const StelCore *core) const;
907

908
        //! Opening angle of the bright Solar crescent, radians
909
        //! From: J. Meeus, Morsels IV, ch.15
910
        //! @param lunarSize: apparent Lunar angular size (radius or diameter), angular units of your preference
911
        //! @param solarSize: apparent Solar angular size (radius or diameter, resp.), same angular units
912
        //! @param eclipseMagnitude: covered fraction of the Solar diameter.
913
        static double getEclipseCrescentAngle(const double lunarSize, const double solarSize, const double eclipseMagnitude);
914

915
        //! Retrieve Radius of Umbra and Penumbra at the distance of the Moon.
916
        //! Returns a pair (umbra, penumbra) in (geocentric_arcseconds, AU, geometric_AU).
917
        //! * sizes in arcseconds are the usual result found as Bessel element in eclipse literature.
918
        //!   It includes scaling for effects of atmosphere either after Chauvenet (2%) or after Danjon. (see Espenak: 5000 Years Canon of Lunar Eclipses.)
919
        //! * sizes in AU are the same, converted back to AU in Lunar distance.
920
        //! * sizes in geometric_AU derived from pure geometrical evaluations without scalings applied.
921
        QPair<Vec3d,Vec3d> getEarthShadowRadiiAtLunarDistance() const;
922

923
        //! Compute the position and transform matrix for every element of the solar system.
924
        //! @param core the central StelCore instance
925
        //! @param dateJDE the Julian Day in JDE (Ephemeris Time or equivalent)        
926
        //! @param observerPlanet planet of the observer (Required for light travel time or aberration computation).
927
        void computePositions(StelCore *core, double dateJDE, PlanetP observerPlanet);
928

929
        //! Get the list of all the bodies of the solar system.        
930
        const QList<PlanetP>& getAllPlanets() const {return systemPlanets;}
×
931
        //! Get the list of all the bodies of the solar system.
932
        const QList<PlanetP>& getAllMinorBodies() const {return systemMinorBodies;}
×
933
        //! Get the list of all minor bodies names.
934
        const QStringList getMinorBodiesList() const { return minorBodies; }
935

936
private slots:
937
        //! Called when a new object is selected.
938
        void selectedObjectChange(StelModule::StelModuleSelectAction action);
939

940
        //! Called when the sky culture is updated.
941
        //! Loads native names of planets for a given sky culture.
942
        void updateSkyCulture(const StelSkyCulture& skyCulture);
943

944
        void loadCultureSpecificNames(const QJsonObject& data);
945

946
        //! Called following StelMainView::reloadShadersRequested
947
        void reloadShaders();
948

949
        //! Set flag which enabled the showing of ephemeris markers or not
950
        void setFlagEphemerisMarkers(bool b);
951
        //! Get the current value of the flag which enabled the showing of ephemeris markers or not
952
        bool getFlagEphemerisMarkers() const;
953

954
        //! Set flag which enabled the showing of ephemeris line between markers or not
955
        void setFlagEphemerisLine(bool b);
956
        //! Get the current value of the flag which enabled the showing of ephemeris line between markers or not
957
        bool getFlagEphemerisLine() const;
958

959
        //! Set flag which enables ephemeris lines and marks always on
960
        void setFlagEphemerisAlwaysOn(bool b);
961
        //! Get the current value of the flag which makes ephemeris lines and marks always on
962
        bool getFlagEphemerisAlwaysOn() const;
963

964
        //! Set flag, which enables ephemeris marks on position "now"
965
        void setFlagEphemerisNow(bool b);
966
        //! Get the current value of the flag which makes ephemeris marks on position "now"
967
        bool getFlagEphemerisNow() const;
968

969
        //! Set the thickness of ephemeris line
970
        void setEphemerisLineThickness(int v);
971
        //! Get the thickness of ephemeris line
972
        int getEphemerisLineThickness() const;
973

974
        //! Set flag which enabled the showing of ephemeris markers in horizontal coordinates or not
975
        void setFlagEphemerisHorizontalCoordinates(bool b);
976
        //! Get the current value of the flag which enabled the showing of ephemeris markers in horizontal coordinates or not
977
        bool getFlagEphemerisHorizontalCoordinates() const;
978

979
        //! Set flag which enable the showing the date near ephemeris markers or not
980
        void setFlagEphemerisDates(bool b);
981
        //! Get the current value of the flag which enable the showing the date near ephemeris markers or not
982
        bool getFlagEphemerisDates() const;
983

984
        //! Set flag which enable the showing the magnitude near ephemeris markers or not
985
        void setFlagEphemerisMagnitudes(bool b);
986
        //! Get the current value of the flag which enable the showing the magnitude near ephemeris markers or not
987
        bool getFlagEphemerisMagnitudes() const;
988

989
        //! Set flag which allow skipping dates near ephemeris markers
990
        void setFlagEphemerisSkipData(bool b);
991
        //! Get the current value of the flag which allow skipping dates near ephemeris markers
992
        bool getFlagEphemerisSkipData() const;
993

994
        //! Set flag which allow skipping the ephemeris markers without dates
995
        void setFlagEphemerisSkipMarkers(bool b);
996
        //! Get the current value of the flag which allow skipping the ephemeris markers without dates
997
        bool getFlagEphemerisSkipMarkers() const;
998

999
        //! Set flag which allow using smart format for dates near ephemeris markers
1000
        void setFlagEphemerisSmartDates(bool b);
1001
        //! Get the current value of the flag which allow using smart format for dates near ephemeris markers
1002
        bool getFlagEphemerisSmartDates() const;
1003

1004
        //! Set flag which allow scaling the ephemeris markers
1005
        void setFlagEphemerisScaleMarkers(bool b);
1006
        //! Get the current value of the flag which allow scaling the ephemeris markers
1007
        bool getFlagEphemerisScaleMarkers() const;
1008

1009
        //! Set the step of skip for date of ephemeris markers (and markers if it enabled)
1010
        void setEphemerisDataStep(int step);
1011
        //! Get the step of skip for date of ephemeris markers
1012
        int getEphemerisDataStep() const;
1013

1014
        //! Set the limit for data: we computed ephemeris for 1, 2 or 5 celestial bodies
1015
        void setEphemerisDataLimit(int limit);
1016
        //! Get the limit of the data (how many celestial bodies was in computing of ephemeris)
1017
        int getEphemerisDataLimit() const;
1018

1019
        void setEphemerisGenericMarkerColor(const Vec3f& c);
1020
        Vec3f getEphemerisGenericMarkerColor(void) const;
1021

1022
        void setEphemerisSecondaryMarkerColor(const Vec3f& c);
1023
        Vec3f getEphemerisSecondaryMarkerColor(void) const;
1024

1025
        void setEphemerisSelectedMarkerColor(const Vec3f& c);
1026
        Vec3f getEphemerisSelectedMarkerColor(void) const;
1027

1028
        void setEphemerisMercuryMarkerColor(const Vec3f& c);
1029
        Vec3f getEphemerisMercuryMarkerColor(void) const;
1030

1031
        void setEphemerisVenusMarkerColor(const Vec3f& c);
1032
        Vec3f getEphemerisVenusMarkerColor(void) const;
1033

1034
        void setEphemerisMarsMarkerColor(const Vec3f& c);
1035
        Vec3f getEphemerisMarsMarkerColor(void) const;
1036

1037
        void setEphemerisJupiterMarkerColor(const Vec3f& c);
1038
        Vec3f getEphemerisJupiterMarkerColor(void) const;
1039

1040
        void setEphemerisSaturnMarkerColor(const Vec3f& c);
1041
        Vec3f getEphemerisSaturnMarkerColor(void) const;
1042

1043
        //! Called when a new Hips survey has been loaded by the hips mgr.
1044
        void onNewSurvey(HipsSurveyP survey);
1045

1046
        //! Taking the JD dates for each ephemeride and preparation the human readable dates according to the settings for dates
1047
        void fillEphemerisDates();
1048

1049
        //! When some aspect of orbit drawing changes, update their configuration
1050
        void reconfigureOrbits();
1051
private:
1052
        //! Search for SolarSystem objects which are close to the position given
1053
        //! in earth equatorial position.
1054
        //! @param v A position in earth equatorial position.
1055
        //! @param core the StelCore object.
1056
        //! @return a pointer to a StelObject if found, else Q_NULLPTR
1057
        StelObjectP search(Vec3d v, const StelCore* core) const;
1058

1059
        //! Compute the transformation matrix for every elements of the solar system.
1060
        //! observerPos is needed for light travel time computation.
1061
        void computeTransMatrices(double dateJDE, const Vec3d& observerPos = Vec3d(0.));
1062

1063
        //! Draw a nice animated pointer around the object.
1064
        void drawPointer(const StelCore* core);
1065

1066
        //! Draw ephemeris lines and markers
1067
        void drawEphemerisItems(const StelCore* core);
1068

1069
        //! Draw a nice markers for ephemeris of objects.
1070
        void drawEphemerisMarkers(const StelCore* core);
1071

1072
        //! Draw a line, who connected markers for ephemeris of objects.
1073
        void drawEphemerisLine(const StelCore* core);
1074

1075
        //! Load planet data from the Solar System configuration files.
1076
        //! This function attempts to load every possible instance of the
1077
        //! Solar System configuration files in the file paths, falling back if a
1078
        //! given path can't be loaded.
1079
        void loadPlanets();
1080

1081
        //! Load planet data from the given file
1082
        bool loadPlanets(const QString& filePath);
1083

1084
        Vec3f getEphemerisMarkerColor(int index) const;
1085

1086
        //! Calculate a color of Solar system bodies
1087
        //! @param bV value of B-V color index
1088
        static unsigned char BvToColorIndex(double bV);
1089

1090
        //! Used to count how many planets actually need shadow information
1091
        int shadowPlanetCount;
1092
        //! Used to track whether earth shadow enlargement shall be computed after Danjon (1951)
1093
        bool earthShadowEnlargementDanjon;
1094
        PlanetP sun;
1095
        PlanetP moon;
1096
        PlanetP earth;
1097

1098
        //! Set selected planets by englishName.
1099
        //! @param englishName The planet name or "" to select no planet
1100
        void setSelected(const QString& englishName);
1101
        //! Set selected object from its pointer.
1102
        void setSelected(PlanetP obj);
1103
        //! Get selected object's pointer.
1104
        PlanetP getSelected(void) const {return selected;}
1105
        //! The currently selected planet.
1106
        PlanetP selected;
1107
        std::vector<PlanetP> selectedSSO; // More than one can be selected at a time
1108

1109
        // Allow enlargements of the planets. May be useful to highlight the planets in in overview plots
1110
        // 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.
1111
        bool flagMoonScale;
1112
        double moonScale;
1113
        bool flagMinorBodyScale;
1114
        double minorBodyScale;
1115
        bool flagPlanetScale;
1116
        double planetScale;
1117
        bool flagSunScale;
1118
        double sunScale;
1119

1120
        QFont planetNameFont;
1121

1122
        //! The amount of planet labels (between 0 and 10).
1123
        double labelsAmount;
1124

1125
        // Flag to follow the state of drawing of solar corona
1126
        bool flagPermanentSolarCorona;
1127

1128
        //! List of all the bodies of the solar system.
1129
        QList<PlanetP> systemPlanets;
1130
        //! List of all the minor bodies of the solar system.
1131
        QList<PlanetP> systemMinorBodies;
1132

1133
        // Master settings
1134
        bool flagOrbits;
1135
        bool flagLightTravelTime;
1136
        bool flagUseObjModels;
1137
        bool flagShowObjSelfShadows;
1138

1139
        //! The selection pointer texture.
1140
        StelTextureSP texPointer;
1141
        StelTextureSP texEphemerisMarker;
1142
        StelTextureSP texEphemerisCometMarker;
1143
        StelTextureSP texEphemerisNowMarker;
1144

1145
        bool flagShow;
1146
        bool flagPointer;                           // show red cross selection pointer?
1147
        bool flagNativePlanetNames;                 // show native names for planets?
1148
        bool flagIsolatedTrails;
1149
        int numberIsolatedTrails;
1150
        int maxTrailPoints;                         // limit trails to a manageable size.
1151
        int maxTrailTimeExtent;
1152
        int trailsThickness;
1153
        bool flagIsolatedOrbits;
1154
        bool flagPlanetsOrbits;                                // Show orbits of the major planets, regardless of other orbit settings
1155
        bool flagPlanetsOrbitsOnly;                        // show orbits of the major planets only (no minor bodies in any case)
1156
        bool flagOrbitsWithMoons;                        // Show moon systems if planet orbits are displayed
1157
        bool ephemerisMarkersDisplayed;
1158
        bool ephemerisDatesDisplayed;
1159
        bool ephemerisMagnitudesDisplayed;
1160
        bool ephemerisHorizontalCoordinates;
1161
        bool ephemerisLineDisplayed;
1162
        bool ephemerisAlwaysOn;
1163
        bool ephemerisNow;
1164
        int ephemerisLineThickness;
1165
        bool ephemerisSkipDataDisplayed;
1166
        bool ephemerisSkipMarkersDisplayed;
1167
        int ephemerisDataStep;                                // How many days skip for dates near ephemeris markers (and the markers if it enabled)
1168
        int ephemerisDataLimit;                                // Number of celestial bodies in ephemeris data (how many celestial bodies was in computing of ephemeris)
1169
        bool ephemerisSmartDatesDisplayed;
1170
        bool ephemerisScaleMarkersDisplayed;
1171
        Vec3f ephemerisGenericMarkerColor;
1172
        Vec3f ephemerisSecondaryMarkerColor;
1173
        Vec3f ephemerisSelectedMarkerColor;
1174
        Vec3f ephemerisMercuryMarkerColor;
1175
        Vec3f ephemerisVenusMarkerColor;
1176
        Vec3f ephemerisMarsMarkerColor;
1177
        Vec3f ephemerisJupiterMarkerColor;
1178
        Vec3f ephemerisSaturnMarkerColor;
1179

1180
        class TrailGroup* allTrails;
1181
        QSettings* conf;
1182
        LinearFader trailFader;
1183
        Vec3f trailsColor;
1184
        Vec3f pointerColor;
1185

1186
        static const QMap<Planet::ApparentMagnitudeAlgorithm, QString> vMagAlgorithmMap;
1187

1188
        QHash<QString, QString> planetNativeNamesMap, planetNativeNamesMeaningMap;
1189
        QStringList minorBodies;
1190

1191
        // 0.16pre observation GZ: this list contains pointers to all orbit objects,
1192
        // while the planets don't own their orbit objects.
1193
        // Would it not be better to hand over the orbit object ownership to the Planet object?
1194
        // This list could then be removed.
1195
        // In case this was originally intended to provide some fast access for time-dependent computation with the same JD,
1196
        // note that we must also always compensate to light time travel, so likely each computation has to be done twice,
1197
        // with current JDE and JDE-lightTime(distance).
1198
        QList<Orbit*> orbits;           // Pointers on created elliptical orbits. 0.16pre: WHY DO WE NEED THIS???
1199

1200
        //! Number of additional threads. This could be automatically derived, but for now we can experiment.
1201
        int extraThreads;
1202

1203
        // BEGIN OF BLOCK RELATED TO MASS MARKER DISPLAY
1204
        // Variables used for GL optimization when displaying little markers for the minor bodies.
1205
        // These data structures were borrowed from StelSkyDrawer. However, we need only one color.
1206
        // Maybe, to extend the idea, have several such Arrays for category-colored main belt, Jupiter Trojans, NEA, KBO etc.
1207
        //! Vertex format for a minor body marker.
1208
        //! Texture pos is stored in another separately.
1209
        struct MarkerVertex {
1210
                Vec2f pos;
1211
                unsigned char color[4]; // can we remove that?
1212
        };
1213
        static_assert(sizeof(MarkerVertex) == 2*4+4, "Size of MarkerVertex must be 12 bytes");
1214

1215
        //! Buffer for storing the marker positions
1216
        MarkerVertex* markerArray;
1217
        //! Buffer for storing the texture coordinate array data.
1218
        unsigned char* textureCoordArray;
1219

1220
        class QOpenGLShaderProgram* markerShaderProgram;
1221
        struct MarkerShaderVars {
1222
                int projectionMatrix;
1223
                int texCoord;
1224
                int pos;
1225
                int color; // Can we remove that?
1226
                int texture;
1227
        };
1228
        MarkerShaderVars markerShaderVars;
1229

1230
        //! Current number of sources stored in the buffer (still to display)
1231
        unsigned int nbMarkers;
1232
        std::unique_ptr<QOpenGLVertexArrayObject> vao;
1233
        std::unique_ptr<QOpenGLBuffer> vbo;
1234
        //! Binds actual VAO if it's supported, sets up the relevant state manually otherwise.
1235
        void bindVAO();
1236
        //! Sets the vertex attribute states for the currently bound VAO so that glDraw* commands can work.
1237
        void setupCurrentVAO();
1238
        //! Binds zero VAO if VAO is supported, manually disables the relevant vertex attributes otherwise.
1239
        void releaseVAO();
1240

1241
        //! Maximum number of markers which can be stored in the buffers
1242
        constexpr static unsigned int maxMarkers=2048;
1243
        void postDrawAsteroidMarkers(StelPainter *sPainter);
1244
        StelTextureSP markerCircleTex; // An optional marker to have "something" in the sky even if object not visible.
1245
        LinearFader markerFader;         // Useful for markers displayed for minor bodies regardless of magnitude
1246

1247
public:
1248
        bool drawAsteroidMarker(StelCore* core, StelPainter* sPainter, const float x, const float y, Vec3f &color);
1249
        float getMarkerValue() const {return markerFader.getInterstate();}
×
1250

1251
private:
1252
        //! absolute value of the dimmest SSO drawn by drawAsteroidMarker()
1253
        double markerMagThreshold;
1254
        //! Preliminary experimental select-per-config.ini.
1255
        //! 0: original single-threaded 3 loops
1256
        //! 1: blockingMap
1257
        //! 2: strided pool threads plus main thread
1258
        //! 3: Ruslan's 1-pass loop (suspected to have a logical error.)
1259
        //! To configure the experimental new solution, add [devel]/compute_positions_algorithm=0|1|2|3. Default=2
1260
        int computePositionsAlgorithm;
1261
        // END OF BLOCK RELATED TO MASS MARKER DISPLAY
1262
};
1263

1264

1265
#endif // SOLARSYSTEM_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc