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

Stellarium / stellarium / 15291801018

28 May 2025 04:52AM UTC coverage: 11.931% (-0.02%) from 11.951%
15291801018

push

github

alex-w
Added new set of navigational stars (XIX century)

0 of 6 new or added lines in 2 files covered. (0.0%)

14124 existing lines in 74 files now uncovered.

14635 of 122664 relevant lines covered (11.93%)

18291.42 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 planetsDisplayed                READ getFlagPlanets                        WRITE setFlagPlanets                        NOTIFY flagPlanetsDisplayedChanged)
66
        Q_PROPERTY(bool flagOrbits                        READ getFlagOrbits                        WRITE setFlagOrbits                        NOTIFY flagOrbitsChanged)
67
        Q_PROPERTY(bool flagPlanetsOrbits                READ getFlagPlanetsOrbits                WRITE setFlagPlanetsOrbits                NOTIFY flagPlanetsOrbitsChanged)
68
        Q_PROPERTY(bool flagPlanetsOrbitsOnly                READ getFlagPlanetsOrbitsOnly                WRITE setFlagPlanetsOrbitsOnly                NOTIFY flagPlanetsOrbitsOnlyChanged)
69
        Q_PROPERTY(bool flagPermanentOrbits                READ getFlagPermanentOrbits                WRITE setFlagPermanentOrbits                NOTIFY flagPermanentOrbitsChanged)
70
        Q_PROPERTY(bool flagIsolatedOrbits                READ getFlagIsolatedOrbits                WRITE setFlagIsolatedOrbits                NOTIFY flagIsolatedOrbitsChanged)
71
        Q_PROPERTY(bool flagOrbitsWithMoons                READ getFlagOrbitsWithMoons                WRITE setFlagOrbitsWithMoons                NOTIFY flagOrbitsWithMoonsChanged)
72
        Q_PROPERTY(bool flagIsolatedTrails                READ getFlagIsolatedTrails                WRITE setFlagIsolatedTrails                NOTIFY flagIsolatedTrailsChanged)
73
        Q_PROPERTY(int numberIsolatedTrails                READ getNumberIsolatedTrails                WRITE setNumberIsolatedTrails                NOTIFY numberIsolatedTrailsChanged)
74
        Q_PROPERTY(bool flagLightTravelTime                READ getFlagLightTravelTime                WRITE setFlagLightTravelTime                NOTIFY flagLightTravelTimeChanged)
75
        Q_PROPERTY(bool flagUseObjModels                READ getFlagUseObjModels                WRITE setFlagUseObjModels                NOTIFY flagUseObjModelsChanged)
76
        Q_PROPERTY(bool flagShowObjSelfShadows                READ getFlagShowObjSelfShadows                WRITE setFlagShowObjSelfShadows                NOTIFY flagShowObjSelfShadowsChanged)
77
        Q_PROPERTY(bool flagMoonScale                        READ getFlagMoonScale                        WRITE setFlagMoonScale                        NOTIFY flagMoonScaleChanged)
78
        Q_PROPERTY(double moonScale                        READ getMoonScale                        WRITE setMoonScale                        NOTIFY moonScaleChanged)
79
        Q_PROPERTY(bool flagMinorBodyScale                READ getFlagMinorBodyScale                WRITE setFlagMinorBodyScale                NOTIFY flagMinorBodyScaleChanged)
80
        Q_PROPERTY(double minorBodyScale                READ getMinorBodyScale                        WRITE setMinorBodyScale                        NOTIFY minorBodyScaleChanged)
81
        Q_PROPERTY(bool flagPlanetScale                        READ getFlagPlanetScale                        WRITE setFlagPlanetScale                NOTIFY flagPlanetScaleChanged)
82
        Q_PROPERTY(double planetScale                        READ getPlanetScale                        WRITE setPlanetScale                        NOTIFY planetScaleChanged)
83
        Q_PROPERTY(bool flagSunScale                        READ getFlagSunScale                        WRITE setFlagSunScale                        NOTIFY flagSunScaleChanged)
84
        Q_PROPERTY(double sunScale                        READ getSunScale                        WRITE setSunScale                        NOTIFY sunScaleChanged)
85
        Q_PROPERTY(double labelsAmount                        READ getLabelsAmount                        WRITE setLabelsAmount                        NOTIFY labelsAmountChanged)
86
        Q_PROPERTY(bool flagPermanentSolarCorona        READ getFlagPermanentSolarCorona        WRITE setFlagPermanentSolarCorona        NOTIFY flagPermanentSolarCoronaChanged)
87
        // Ephemeris-related properties
88
        Q_PROPERTY(bool ephemerisMarkersDisplayed        READ getFlagEphemerisMarkers                WRITE setFlagEphemerisMarkers                NOTIFY ephemerisMarkersChanged)
89
        Q_PROPERTY(bool ephemerisHorizontalCoordinates        READ getFlagEphemerisHorizontalCoordinates        WRITE setFlagEphemerisHorizontalCoordinates        NOTIFY ephemerisHorizontalCoordinatesChanged)
90
        Q_PROPERTY(bool ephemerisDatesDisplayed                READ getFlagEphemerisDates                WRITE setFlagEphemerisDates                NOTIFY ephemerisDatesChanged)
91
        Q_PROPERTY(bool ephemerisMagnitudesDisplayed        READ getFlagEphemerisMagnitudes                WRITE setFlagEphemerisMagnitudes        NOTIFY ephemerisMagnitudesChanged)
92
        Q_PROPERTY(bool ephemerisLineDisplayed                READ getFlagEphemerisLine                WRITE setFlagEphemerisLine                NOTIFY ephemerisLineChanged)
93
        Q_PROPERTY(int ephemerisLineThickness                READ getEphemerisLineThickness                WRITE setEphemerisLineThickness                NOTIFY ephemerisLineThicknessChanged)
94
        Q_PROPERTY(bool ephemerisSkippedData                READ getFlagEphemerisSkipData                WRITE setFlagEphemerisSkipData                NOTIFY ephemerisSkipDataChanged)
95
        Q_PROPERTY(bool ephemerisSkippedMarkers                READ getFlagEphemerisSkipMarkers        WRITE setFlagEphemerisSkipMarkers        NOTIFY ephemerisSkipMarkersChanged)
96
        Q_PROPERTY(int ephemerisDataStep                READ getEphemerisDataStep                WRITE setEphemerisDataStep                NOTIFY ephemerisDataStepChanged)
97
        Q_PROPERTY(int ephemerisDataLimit                READ getEphemerisDataLimit                WRITE setEphemerisDataLimit                NOTIFY ephemerisDataLimitChanged)
98
        Q_PROPERTY(bool ephemerisSmartDates                READ getFlagEphemerisSmartDates                WRITE setFlagEphemerisSmartDates        NOTIFY ephemerisSmartDatesChanged)
99
        Q_PROPERTY(bool ephemerisScaleMarkersDisplayed        READ getFlagEphemerisScaleMarkers        WRITE setFlagEphemerisScaleMarkers        NOTIFY ephemerisScaleMarkersChanged)
100
        Q_PROPERTY(bool ephemerisAlwaysOn                READ getFlagEphemerisAlwaysOn                WRITE setFlagEphemerisAlwaysOn                NOTIFY ephemerisAlwaysOnChanged)
101
        Q_PROPERTY(bool ephemerisNow                        READ getFlagEphemerisNow                WRITE setFlagEphemerisNow                NOTIFY ephemerisNowChanged)
102
        // Great Red Spot (GRS) properties
103
        Q_PROPERTY(int grsLongitude                        READ getGrsLongitude                        WRITE setGrsLongitude                        NOTIFY grsLongitudeChanged)
104
        Q_PROPERTY(double grsDrift                        READ getGrsDrift                        WRITE setGrsDrift                        NOTIFY grsDriftChanged)
105
        Q_PROPERTY(double grsJD                                READ getGrsJD                                WRITE setGrsJD                                NOTIFY grsJDChanged)
106
        // Eclipse algorithm properties
107
        Q_PROPERTY(bool earthShadowEnlargementDanjon    READ getFlagEarthShadowEnlargementDanjon    WRITE setFlagEarthShadowEnlargementDanjon   NOTIFY earthShadowEnlargementDanjonChanged)
108
        // Colors
109
        Q_PROPERTY(Vec3f labelsColor                        READ getLabelsColor                        WRITE setLabelsColor                        NOTIFY labelsColorChanged)
110
        Q_PROPERTY(Vec3f pointerColor                        READ getPointerColor                        WRITE setPointerColor                        NOTIFY pointerColorChanged)
111
        Q_PROPERTY(Vec3f trailsColor                        READ getTrailsColor                        WRITE setTrailsColor                        NOTIFY trailsColorChanged)
112
        Q_PROPERTY(Vec3f orbitsColor                        READ getOrbitsColor                        WRITE setOrbitsColor                        NOTIFY orbitsColorChanged)
113
        Q_PROPERTY(Vec3f majorPlanetsOrbitsColor        READ getMajorPlanetsOrbitsColor                WRITE setMajorPlanetsOrbitsColor        NOTIFY majorPlanetsOrbitsColorChanged)
114
        Q_PROPERTY(Vec3f minorPlanetsOrbitsColor        READ getMinorPlanetsOrbitsColor                WRITE setMinorPlanetsOrbitsColor        NOTIFY minorPlanetsOrbitsColorChanged)
115
        Q_PROPERTY(Vec3f dwarfPlanetsOrbitsColor        READ getDwarfPlanetsOrbitsColor                WRITE setDwarfPlanetsOrbitsColor        NOTIFY dwarfPlanetsOrbitsColorChanged)
116
        Q_PROPERTY(Vec3f moonsOrbitsColor                READ getMoonsOrbitsColor                WRITE setMoonsOrbitsColor                NOTIFY moonsOrbitsColorChanged)
117
        Q_PROPERTY(Vec3f cubewanosOrbitsColor                READ getCubewanosOrbitsColor                WRITE setCubewanosOrbitsColor                NOTIFY cubewanosOrbitsColorChanged)
118
        Q_PROPERTY(Vec3f plutinosOrbitsColor                READ getPlutinosOrbitsColor                WRITE setPlutinosOrbitsColor                NOTIFY plutinosOrbitsColorChanged)
119
        Q_PROPERTY(Vec3f scatteredDiskObjectsOrbitsColor        READ getScatteredDiskObjectsOrbitsColor                WRITE setScatteredDiskObjectsOrbitsColor        NOTIFY scatteredDiskObjectsOrbitsColorChanged)
120
        Q_PROPERTY(Vec3f oortCloudObjectsOrbitsColor        READ getOortCloudObjectsOrbitsColor        WRITE setOortCloudObjectsOrbitsColor                NOTIFY oortCloudObjectsOrbitsColorChanged)
121
        Q_PROPERTY(Vec3f cometsOrbitsColor                READ getCometsOrbitsColor                WRITE setCometsOrbitsColor                NOTIFY cometsOrbitsColorChanged)
122
        Q_PROPERTY(Vec3f sednoidsOrbitsColor                READ getSednoidsOrbitsColor                WRITE setSednoidsOrbitsColor                NOTIFY sednoidsOrbitsColorChanged)
123
        Q_PROPERTY(Vec3f interstellarOrbitsColor        READ getInterstellarOrbitsColor                WRITE setInterstellarOrbitsColor        NOTIFY interstellarOrbitsColorChanged)
124
        Q_PROPERTY(Vec3f mercuryOrbitColor                READ getMercuryOrbitColor                WRITE setMercuryOrbitColor                NOTIFY mercuryOrbitColorChanged)
125
        Q_PROPERTY(Vec3f venusOrbitColor                READ getVenusOrbitColor                        WRITE setVenusOrbitColor                NOTIFY venusOrbitColorChanged)
126
        Q_PROPERTY(Vec3f earthOrbitColor                READ getEarthOrbitColor                        WRITE setEarthOrbitColor                NOTIFY earthOrbitColorChanged)
127
        Q_PROPERTY(Vec3f marsOrbitColor                        READ getMarsOrbitColor                        WRITE setMarsOrbitColor                        NOTIFY marsOrbitColorChanged)
128
        Q_PROPERTY(Vec3f jupiterOrbitColor                READ getJupiterOrbitColor                WRITE setJupiterOrbitColor                NOTIFY jupiterOrbitColorChanged)
129
        Q_PROPERTY(Vec3f saturnOrbitColor                READ getSaturnOrbitColor                WRITE setSaturnOrbitColor                NOTIFY saturnOrbitColorChanged)
130
        Q_PROPERTY(Vec3f uranusOrbitColor                READ getUranusOrbitColor                WRITE setUranusOrbitColor                NOTIFY uranusOrbitColorChanged)
131
        Q_PROPERTY(Vec3f neptuneOrbitColor                READ getNeptuneOrbitColor                WRITE setNeptuneOrbitColor                NOTIFY neptuneOrbitColorChanged)
132
        // Ephemeris-related properties
133
        Q_PROPERTY(Vec3f ephemerisGenericMarkerColor        READ getEphemerisGenericMarkerColor        WRITE setEphemerisGenericMarkerColor        NOTIFY ephemerisGenericMarkerColorChanged)
134
        Q_PROPERTY(Vec3f ephemerisSecondaryMarkerColor        READ getEphemerisSecondaryMarkerColor        WRITE setEphemerisSecondaryMarkerColor        NOTIFY ephemerisSecondaryMarkerColorChanged)
135
        Q_PROPERTY(Vec3f ephemerisSelectedMarkerColor        READ getEphemerisSelectedMarkerColor        WRITE setEphemerisSelectedMarkerColor        NOTIFY ephemerisSelectedMarkerColorChanged)
136
        Q_PROPERTY(Vec3f ephemerisMercuryMarkerColor        READ getEphemerisMercuryMarkerColor        WRITE setEphemerisMercuryMarkerColor        NOTIFY ephemerisMercuryMarkerColorChanged)
137
        Q_PROPERTY(Vec3f ephemerisVenusMarkerColor        READ getEphemerisVenusMarkerColor        WRITE setEphemerisVenusMarkerColor        NOTIFY ephemerisVenusMarkerColorChanged)
138
        Q_PROPERTY(Vec3f ephemerisMarsMarkerColor        READ getEphemerisMarsMarkerColor        WRITE setEphemerisMarsMarkerColor        NOTIFY ephemerisMarsMarkerColorChanged)
139
        Q_PROPERTY(Vec3f ephemerisJupiterMarkerColor        READ getEphemerisJupiterMarkerColor        WRITE setEphemerisJupiterMarkerColor        NOTIFY ephemerisJupiterMarkerColorChanged)
140
        Q_PROPERTY(Vec3f ephemerisSaturnMarkerColor        READ getEphemerisSaturnMarkerColor        WRITE setEphemerisSaturnMarkerColor        NOTIFY ephemerisSaturnMarkerColorChanged)
141
        // Color style
142
        Q_PROPERTY(QString orbitColorStyle                READ getOrbitColorStyle                        WRITE setOrbitColorStyle                NOTIFY orbitColorStyleChanged)
143
        Q_PROPERTY(QString apparentMagnitudeAlgorithmOnEarth        READ getApparentMagnitudeAlgorithmOnEarth        WRITE setApparentMagnitudeAlgorithmOnEarth        NOTIFY apparentMagnitudeAlgorithmOnEarthChanged)
144
        Q_PROPERTY(int orbitsThickness                        READ getOrbitsThickness                        WRITE setOrbitsThickness                NOTIFY orbitsThicknessChanged)
145
        Q_PROPERTY(bool flagDrawMoonHalo                READ getFlagDrawMoonHalo                WRITE setFlagDrawMoonHalo                NOTIFY flagDrawMoonHaloChanged)
146
        Q_PROPERTY(bool flagDrawSunHalo                        READ getFlagDrawSunHalo                        WRITE setFlagDrawSunHalo                NOTIFY flagDrawSunHaloChanged)
147
        Q_PROPERTY(int extraThreads                     READ getExtraThreads                    WRITE setExtraThreads                   NOTIFY extraThreadsChanged)
148
        Q_PROPERTY(double markerMagThreshold            READ getMarkerMagThreshold              WRITE setMarkerMagThreshold             NOTIFY markerMagThresholdChanged)
149

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

303
        //! Set the color used to draw planet labels.
304
        //! @param c The color of the planet labels (R,G,B)
305
        //! @code
306
        //! // example of usage in scripts (Qt6-based Stellarium)
307
        //! var c = new Color(1.0, 0.0, 0.0);
308
        //! SolarSystem.setLabelsColor(c.toVec3f());
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 (Qt6-based Stellarium)
319
        //! var c = new Color(1.0, 0.0, 0.0);
320
        //! SolarSystem.setOrbitsColor(c.toVec3f());
321
        //! @endcode
322
        void setOrbitsColor(const Vec3f& c);
323
        //! Get the current color used to draw solar system object orbit lines.
324
        //! @return current color
325
        Vec3f getOrbitsColor(void) const;
326

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

339
        //! Set the color used to draw orbits lines of moons of planets.
340
        //! @param c The color of orbits lines of moons of planets lines (R,G,B)
341
        //! @code
342
        //! // example of usage in scripts (Qt6-based Stellarium)
343
        //! var c = new Color(1.0, 0.0, 0.0);
344
        //! SolarSystem.setMoonsOrbitsColor(c.toVec3f());
345
        //! @endcode
346
        void setMoonsOrbitsColor(const Vec3f& c);
347
        //! Get the current color used to draw orbits lines of moons of planets.
348
        //! @return current color
349
        Vec3f getMoonsOrbitsColor(void) const;
350

351
        //! Set the color used to draw orbits lines of the minor planets.
352
        //! @param c The color of orbits lines of the minor planets (R,G,B)
353
        //! @code
354
        //! // example of usage in scripts (Qt6-based Stellarium)
355
        //! var c = new Color(1.0, 0.0, 0.0);
356
        //! SolarSystem.setMinorPlanetsOrbitsColor(c.toVec3f());
357
        //! @endcode
358
        void setMinorPlanetsOrbitsColor(const Vec3f& c);
359
        //! Get the current color used to draw orbits lines of the minor planets.
360
        //! @return current color
361
        Vec3f getMinorPlanetsOrbitsColor(void) const;
362

363
        //! Set the color used to draw orbits lines of the dwarf planets.
364
        //! @param c The color of orbits lines of the dwarf planets (R,G,B)
365
        //! @code
366
        //! // example of usage in scripts (Qt6-based Stellarium)
367
        //! var c = new Color(1.0, 0.0, 0.0);
368
        //! SolarSystem.setDwarfPlanetsOrbitsColor(c.toVec3f());
369
        //! @endcode
370
        void setDwarfPlanetsOrbitsColor(const Vec3f& c);
371
        //! Get the current color used to draw orbits lines of the dwarf planets.
372
        //! @return current color
373
        Vec3f getDwarfPlanetsOrbitsColor(void) const;
374

375
        //! Set the color used to draw orbits lines of cubewanos.
376
        //! @param c The color of orbits lines of cubewanos (R,G,B)
377
        //! @code
378
        //! // example of usage in scripts (Qt6-based Stellarium)
379
        //! var c = new Color(1.0, 0.0, 0.0);
380
        //! SolarSystem.setCubewanosOrbitsColor(c.toVec3f());
381
        //! @endcode
382
        void setCubewanosOrbitsColor(const Vec3f& c);
383
        //! Get the current color used to draw orbits lines of cubewanos.
384
        //! @return current color
385
        Vec3f getCubewanosOrbitsColor(void) const;
386

387
        //! Set the color used to draw orbits lines of plutinos.
388
        //! @param c The color of orbits lines of plutinos (R,G,B)
389
        //! @code
390
        //! // example of usage in scripts (Qt6-based Stellarium)
391
        //! var c = new Color(1.0, 0.0, 0.0);
392
        //! SolarSystem.setPlutinosOrbitsColor(c.toVec3f());
393
        //! @endcode
394
        void setPlutinosOrbitsColor(const Vec3f& c);
395
        //! Get the current color used to draw orbits lines of plutinos.
396
        //! @return current color
397
        Vec3f getPlutinosOrbitsColor(void) const;
398

399
        //! Set the color used to draw orbits lines of scattered disk objects.
400
        //! @param c The color of orbits lines of scattered disk objects (R,G,B)
401
        //! @code
402
        //! // example of usage in scripts (Qt6-based Stellarium)
403
        //! var c = new Color(1.0, 0.0, 0.0);
404
        //! SolarSystem.setScatteredDiskObjectsOrbitsColor(c.toVec3f());
405
        //! @endcode
406
        void setScatteredDiskObjectsOrbitsColor(const Vec3f& c);
407
        //! Get the current color used to draw orbits lines of scattered disk objects.
408
        //! @return current color
409
        Vec3f getScatteredDiskObjectsOrbitsColor(void) const;
410

411
        //! Set the color used to draw orbits lines of Oort cloud objects.
412
        //! @param c The color of orbits lines of Oort cloud objects (R,G,B)
413
        //! @code
414
        //! // example of usage in scripts (Qt6-based Stellarium)
415
        //! var c = new Color(1.0, 0.0, 0.0);
416
        //! SolarSystem.setOortCloudObjectsOrbitsColor(c.toVec3f());
417
        //! @endcode
418
        void setOortCloudObjectsOrbitsColor(const Vec3f& c);
419
        //! Get the current color used to draw orbits lines of Oort cloud objects.
420
        //! @return current color
421
        Vec3f getOortCloudObjectsOrbitsColor(void) const;
422

423
        //! Set the color used to draw comet orbit lines.
424
        //! @param c The color of the comet orbit lines (R,G,B)
425
        //! @code
426
        //! // example of usage in scripts (Qt6-based Stellarium)
427
        //! var c = new Color(1.0, 0.0, 0.0);
428
        //! SolarSystem.setCometsOrbitsColor(c.toVec3f());
429
        //! @endcode
430
        void setCometsOrbitsColor(const Vec3f& c);
431
        //! Get the current color used to draw comet orbit lines.
432
        //! @return current color
433
        Vec3f getCometsOrbitsColor(void) const;
434

435
        //! Set the color used to draw sednoid orbit lines.
436
        //! @param c The color of the sednoid orbit lines (R,G,B)
437
        //! @code
438
        //! // example of usage in scripts (Qt6-based Stellarium)
439
        //! var c = new Color(1.0, 0.0, 0.0);
440
        //! SolarSystem.setSednoidsOrbitsColor(c.toVec3f());
441
        //! @endcode
442
        void setSednoidsOrbitsColor(const Vec3f& c);
443
        //! Get the current color used to draw sednoid orbit lines.
444
        //! @return current color
445
        Vec3f getSednoidsOrbitsColor(void) const;
446

447
        //! Set the color used to draw interstellar orbit (hyperbolic trajectory) lines.
448
        //! @param c The color of the interstellar orbit lines (R,G,B)
449
        //! @code
450
        //! // example of usage in scripts (Qt6-based Stellarium)
451
        //! var c = new Color(1.0, 0.0, 0.0);
452
        //! SolarSystem.setInterstellarOrbitsColor(c.toVec3f());
453
        //! @endcode
454
        void setInterstellarOrbitsColor(const Vec3f& c);
455
        //! Get the current color used to draw interstellar orbit lines.
456
        //! @return current color
457
        Vec3f getInterstellarOrbitsColor(void) const;
458

459
        //! Set the color used to draw Mercury orbit line.
460
        //! @param c The color of Mercury orbit line (R,G,B)
461
        //! @code
462
        //! // example of usage in scripts (Qt6-based Stellarium)
463
        //! var c = new Color(1.0, 0.0, 0.0);
464
        //! SolarSystem.setMercuryOrbitColor(c.toVec3f());
465
        //! @endcode
466
        void setMercuryOrbitColor(const Vec3f& c);
467
        //! Get the current color used to draw Mercury orbit line.
468
        //! @return current color
469
        Vec3f getMercuryOrbitColor(void) const;
470

471
        //! Set the color used to draw Venus orbit line.
472
        //! @param c The color of Venus orbit line (R,G,B)
473
        //! @code
474
        //! // example of usage in scripts (Qt6-based Stellarium)
475
        //! var c = new Color(1.0, 0.0, 0.0);
476
        //! SolarSystem.setVenusOrbitColor(c.toVec3f());
477
        //! @endcode
478
        void setVenusOrbitColor(const Vec3f& c);
479
        //! Get the current color used to draw Venus orbit line.
480
        //! @return current color
481
        Vec3f getVenusOrbitColor(void) const;
482

483
        //! Set the color used to draw Earth orbit line.
484
        //! @param c The color of Earth orbit line (R,G,B)
485
        //! @code
486
        //! // example of usage in scripts (Qt6-based Stellarium)
487
        //! var c = new Color(1.0, 0.0, 0.0);
488
        //! SolarSystem.setEarthOrbitColor(c.toVec3f());
489
        //! @endcode
490
        void setEarthOrbitColor(const Vec3f& c);
491
        //! Get the current color used to draw Earth orbit line.
492
        //! @return current color
493
        Vec3f getEarthOrbitColor(void) const;
494

495
        //! Set the color used to draw Mars orbit line.
496
        //! @param c The color of Mars orbit line (R,G,B)
497
        //! @code
498
        //! // example of usage in scripts (Qt6-based Stellarium)
499
        //! var c = new Color(1.0, 0.0, 0.0);
500
        //! SolarSystem.setMarsOrbitColor(c.toVec3f());
501
        //! @endcode
502
        void setMarsOrbitColor(const Vec3f& c);
503
        //! Get the current color used to draw Mars orbit line.
504
        //! @return current color
505
        Vec3f getMarsOrbitColor(void) const;
506

507
        //! Set the color used to draw Jupiter orbit line.
508
        //! @param c The color of Jupiter orbit line (R,G,B)
509
        //! @code
510
        //! // example of usage in scripts (Qt6-based Stellarium)
511
        //! var c = new Color(1.0, 0.0, 0.0);
512
        //! SolarSystem.setJupiterOrbitColor(c.toVec3f());
513
        //! @endcode
514
        void setJupiterOrbitColor(const Vec3f& c);
515
        //! Get the current color used to draw Jupiter orbit line.
516
        //! @return current color
517
        Vec3f getJupiterOrbitColor(void) const;
518

519
        //! Set the color used to draw Saturn orbit line.
520
        //! @param c The color of Saturn orbit line (R,G,B)
521
        //! @code
522
        //! // example of usage in scripts (Qt6-based Stellarium)
523
        //! var c = new Color(1.0, 0.0, 0.0);
524
        //! SolarSystem.setSaturnOrbitColor(c.toVec3f());
525
        //! @endcode
526
        void setSaturnOrbitColor(const Vec3f& c);
527
        //! Get the current color used to draw Saturn orbit line.
528
        //! @return current color
529
        Vec3f getSaturnOrbitColor(void) const;
530

531
        //! Set the color used to draw Uranus orbit line.
532
        //! @param c The color of Uranus orbit line (R,G,B)
533
        //! @code
534
        //! // example of usage in scripts (Qt6-based Stellarium)
535
        //! var c = new Color(1.0, 0.0, 0.0);
536
        //! SolarSystem.setUranusOrbitColor(c.toVec3f());
537
        //! @endcode
538
        void setUranusOrbitColor(const Vec3f& c);
539
        //! Get the current color used to draw Uranus orbit line.
540
        //! @return current color
541
        Vec3f getUranusOrbitColor(void) const;
542

543
        //! Set the color used to draw Neptune orbit line.
544
        //! @param c The color of Neptune orbit line (R,G,B)
545
        //! @code
546
        //! // example of usage in scripts (Qt6-based Stellarium)
547
        //! var c = new Color(1.0, 0.0, 0.0);
548
        //! SolarSystem.setNeptuneOrbitColor(c.toVec3f());
549
        //! @endcode
550
        void setNeptuneOrbitColor(const Vec3f& c);
551
        //! Get the current color used to draw Neptune orbit line.
552
        //! @return current color
553
        Vec3f getNeptuneOrbitColor(void) const;
554

555
        //! Set the color used to draw planet trails lines.
556
        //! @param c The color of the planet trails lines (R,G,B)
557
        //! @code
558
        //! // example of usage in scripts (Qt6-based Stellarium)
559
        //! var c = new Color(1.0, 0.0, 0.0);
560
        //! SolarSystem.setTrailsColor(c.toVec3f());
561
        //! @endcode
UNCOV
562
        void setTrailsColor(const Vec3f& c) {if (c!=trailsColor) { trailsColor=c; emit trailsColorChanged(c);}}
×
563
        //! Get the current color used to draw planet trails lines.
564
        //! @return current color
UNCOV
565
        Vec3f getTrailsColor() const {return trailsColor;}
×
566

567
        //! Set the color used to draw planet pointers.
568
        //! @param c The color of the planet pointers
569
        //! @code
570
        //! // example of usage in scripts (Qt6-based Stellarium)
571
        //! var c = new Color(1.0, 0.0, 0.0);
572
        //! SolarSystem.setPointerColor(c.toVec3f());
573
        //! @endcode
UNCOV
574
        void setPointerColor(const Vec3f& c) {if (c!=pointerColor) {pointerColor=c; emit pointerColorChanged(c);}}
×
575
        //! Get the current color used to draw planet pointers.
576
        //! @return current color
UNCOV
577
        Vec3f getPointerColor() const {return pointerColor;}
×
578

579
        //! Set flag which determines if Earth's moon is scaled or not.
580
        void setFlagMoonScale(bool b);
581
        //! Get the current value of the flag which determines if Earth's moon is scaled or not.
UNCOV
582
        bool getFlagMoonScale(void) const {return flagMoonScale;}
×
583

584
        //! Set the display scaling factor for Earth's moon.
585
        void setMoonScale(double f);
586
        //! Get the display scaling factor for Earth's moon.
UNCOV
587
        double getMoonScale(void) const {return moonScale;}
×
588

589
        //! Set flag which determines if minor bodies (everything except the 8 planets) are drawn scaled or not.
590
        void setFlagMinorBodyScale(bool b);
591
        //! Get the current value of the flag which determines if minor bodies (everything except the 8 planets) are drawn scaled or not.
UNCOV
592
        bool getFlagMinorBodyScale(void) const {return flagMinorBodyScale;}
×
593

594
        //! Set the display scaling factor for minor bodies.
595
        void setMinorBodyScale(double f);
596
        //! Get the display scaling factor for minor bodies.
UNCOV
597
        double getMinorBodyScale(void) const {return minorBodyScale;}
×
598

599
        //! Set flag which determines if planets are displayed scaled or not.
600
        void setFlagPlanetScale(bool b);
601
        //! Get the current value of the flag which determines if planets are displayed scaled or not.
UNCOV
602
        bool getFlagPlanetScale(void) const {return flagPlanetScale;}
×
603

604
        //! Set the display scaling factor for planets.
605
        void setPlanetScale(double f);
606
        //! Get the display scaling factor for planets.
UNCOV
607
        double getPlanetScale(void) const {return planetScale;}
×
608

609
        //! Set flag which determines if Sun is scaled or not.
610
        void setFlagSunScale(bool b);
611
        //! Get the current value of the flag which determines if Sun is scaled or not.
UNCOV
612
        bool getFlagSunScale(void) const {return flagSunScale;}
×
613

614
        //! Set the display scaling factor for Sun.
615
        void setSunScale(double f);
616
        //! Get the display scaling factor for Sun.
UNCOV
617
        double getSunScale(void) const {return sunScale;}
×
618

619
        //! Translate names. (public so that SolarSystemEditor can call it).
620
        void updateI18n();
621

622
        //! Get the V magnitude for Solar system bodies for scripts
623
        //! @param planetName the case in-sensitive English planet name.
624
        //! @param withExtinction the flag for use extinction effect for magnitudes (default not use)
625
        //! @return a magnitude
626
        float getPlanetVMagnitude(const QString &planetName, bool withExtinction=false) const;
627

628
        //! Get type for Solar system bodies for scripts
629
        //! @param planetName the case in-sensitive English planet name.
630
        //! @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)
631
        QString getPlanetType(const QString &planetName) const;
632

633
        //! Get distance to Solar system bodies for scripts
634
        //! @param planetName the case in-sensitive English planet name.
635
        //! @return a distance (in AU)
636
        double getDistanceToPlanet(const QString &planetName) const;
637

638
        //! Get elongation for Solar system bodies for scripts
639
        //! @param planetName the case in-sensitive English planet name.
640
        //! @return a elongation (in radians)
641
        double getElongationForPlanet(const QString &planetName) const;
642

643
        //! Get phase angle for Solar system bodies for scripts
644
        //! @param planetName the case in-sensitive English planet name.
645
        //! @return a phase angle (in radians)
646
        double getPhaseAngleForPlanet(const QString &planetName) const;
647

648
        //! Get phase for Solar system bodies for scripts
649
        //! @param planetName the case in-sensitive English planet name.
650
        //! @return phase, i.e. illuminated fraction [0..1]
651
        float getPhaseForPlanet(const QString &planetName) const;
652

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

679
        //! Set flag which enabled the showing of isolated trails for selected objects only or not
680
        void setFlagIsolatedTrails(bool b);
681
        //! Get the current value of the flag which enables showing of isolated trails for selected objects only or not.
682
        bool getFlagIsolatedTrails(void) const;
683

684
        //! Set number of displayed of isolated trails for latest selected objects
685
        void setNumberIsolatedTrails(int n);
686
        //! Get the number of displayed of isolated trails for latest selected objects
687
        int getNumberIsolatedTrails(void) const;
688

689
        //! Set flag which enabled the showing of isolated orbits for selected objects only or not
690
        void setFlagIsolatedOrbits(bool b);
691
        //! Get the current value of the flag which enables showing of isolated orbits for selected objects only or not.
692
        bool getFlagIsolatedOrbits(void) const;
693

694
        //! Set flag which enabled the showing of planets orbits, regardless of the other orbit settings
695
        void setFlagPlanetsOrbits(bool b);
696
        //! Get the current value of the flag which enables showing of planets orbits, regardless of the other orbit settings.
697
        bool getFlagPlanetsOrbits(void) const;
698

699
        //! Set flag which enabled the showing of planets orbits only or not
700
        void setFlagPlanetsOrbitsOnly(bool b);
701
        //! Get the current value of the flag which enables showing of planets orbits only or not.
702
        bool getFlagPlanetsOrbitsOnly(void) const;
703

704
        //! Set flag which enables showing of planets orbits together mith orbits of their moons.
705
        void setFlagOrbitsWithMoons(bool b);
706
        //! Get the current value of the flag for showing of planets orbits together mith orbits of their moons.
707
        bool getFlagOrbitsWithMoons(void) const;
708

709
        //! 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)
UNCOV
710
        void setFlagPermanentSolarCorona(bool b) {if (flagPermanentSolarCorona!=b){ flagPermanentSolarCorona = b; StelApp::immediateSave("viewing/flag_draw_sun_corona", b); emit flagPermanentSolarCoronaChanged(b); } }
×
711
        //! 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.
UNCOV
712
        bool getFlagPermanentSolarCorona(void) const { return flagPermanentSolarCorona; }
×
713

714
        //! Set longitude of Great Red Spot (System II is used)
715
        //! @param longitude (degrees)
716
        void setGrsLongitude(int longitude);
717
        //! Get longitude of Great Red Spot (System II is used)
718
        //! @return a longitude (degrees)
719
        int getGrsLongitude() const;
720

721
        //! Set speed of annual drift for Great Red Spot (System II is used)
722
        //! @param annual drift (degrees)
723
        void setGrsDrift(double drift);
724
        //! Get speed of annual drift for Great Red Spot (System II is used)
725
        double getGrsDrift() const;
726

727
        //! Set initial JD for calculation of position of Great Red Spot
728
        //! @param JD
729
        // TODO (GZ): Clarify whether this is JD or rather JDE?
730
        void setGrsJD(double JD);
731
        //! Get initial JD for calculation of position of Great Red Spot
732
        double getGrsJD();
733

734
        //! Set whether earth shadow should be enlarged following Danjon's method
735
        void setFlagEarthShadowEnlargementDanjon(bool b);
736
        //! Get whether earth shadow should be enlarged following Danjon's method
737
        bool getFlagEarthShadowEnlargementDanjon() const;
738

739
        //! Set style of colors of orbits for Solar system bodies
740
        //! @param style One of one_color | groups | major_planets | major_planets_minor_types
741
        void setOrbitColorStyle(const QString &style);
742
        //! Get style of colors of orbits for Solar system bodies
743
        //! @return One of one_color | groups | major_planets | major_planets_minor_types
744
        QString getOrbitColorStyle() const;
745

746
        //! Get list of objects by type
747
        //! @param objType object type
748
        QStringList getObjectsList(QString objType="all") const;
749

750
        //! Set flag which enables display of orbits for planets even if they are off screen
751
        void setFlagPermanentOrbits(bool b);
752
        bool getFlagPermanentOrbits() const;
753

754
        void setOrbitsThickness(int v);
755
        int getOrbitsThickness() const;
756

757
        void setFlagDrawMoonHalo(bool b);
758
        bool getFlagDrawMoonHalo() const;
759

760
        void setFlagDrawSunHalo(bool b);
761
        bool getFlagDrawSunHalo() const;
762

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

766
        //! Reset and recreate trails
767
        void recreateTrails();
768

769
        //! Reset textures for planet @param planetName
770
        //! @note if @param planetName is empty then reset will happen for all solar system objects
771
        void resetTextures(const QString& planetName);
772

773
        //! Replace the texture for the planet @param planetName
774
        //! @param planetName - English name of the planet
775
        //! @param texName - file path for texture
776
        //! The texture path starts in the scripts directory.
777
        void setTextureForPlanet(const QString &planetName, const QString &texName);
778

779
        //! Return the number of additional threads (in addition to the main thread) configured to compute planet positions.
UNCOV
780
        int getExtraThreads() const {return extraThreads;}
×
781
        //! Configure the number of additional threads (in addition to the main thread) to compute planet positions.
782
        //! The argument will be bounded by 0 and QThreadPool::globalInstance()->maxThreadCount()-1
783
        void setExtraThreads(int n);
784

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

790
signals:
791
        void labelsDisplayedChanged(bool b);
792
        void flagOrbitsChanged(bool b);
793
        void flagHintsChanged(bool b);
794
        void markersDisplayedChanged(bool b);
795
        void flagDrawMoonHaloChanged(bool b);
796
        void flagDrawSunHaloChanged(bool b);
797
        void trailsDisplayedChanged(bool b);
798
        void trailsThicknessChanged(int v);
799
        void orbitsThicknessChanged(int v);
800
        void maxTrailPointsChanged(int max);
801
        void maxTrailTimeExtentChanged(int max);
802
        void flagPointerChanged(bool b);
803
        void flagPlanetsDisplayedChanged(bool b);
804
        void flagPlanetsOrbitsChanged(bool b);
805
        void flagPlanetsOrbitsOnlyChanged(bool b);
806
        void flagPermanentOrbitsChanged(bool b);
807
        void flagIsolatedOrbitsChanged(bool b);
808
        void flagOrbitsWithMoonsChanged(bool b);
809
        void flagIsolatedTrailsChanged(bool b);
810
        void numberIsolatedTrailsChanged(int n);
811
        void flagLightTravelTimeChanged(bool b);
812
        void flagUseObjModelsChanged(bool b);
813
        void flagShowObjSelfShadowsChanged(bool b);
814
        void flagMoonScaleChanged(bool b);
815
        void moonScaleChanged(double f);
816
        void flagMinorBodyScaleChanged(bool b);
817
        void minorBodyScaleChanged(double f);
818
        void flagPlanetScaleChanged(bool b);
819
        void planetScaleChanged(double f);
820
        void flagSunScaleChanged(bool b);
821
        void sunScaleChanged(double f);
822
        void labelsAmountChanged(double f);
823
        void ephemerisMarkersChanged(bool b);
824
        void ephemerisHorizontalCoordinatesChanged(bool b);
825
        void ephemerisDatesChanged(bool b);
826
        void ephemerisMagnitudesChanged(bool b);
827
        void ephemerisLineChanged(bool b);
828
        void ephemerisAlwaysOnChanged(bool b);
829
        void ephemerisNowChanged(bool b);
830
        void ephemerisLineThicknessChanged(int v);
831
        void ephemerisSkipDataChanged(bool b);
832
        void ephemerisSkipMarkersChanged(bool b);
833
        void ephemerisDataStepChanged(int s);
834
        void ephemerisDataLimitChanged(int s);
835
        void ephemerisSmartDatesChanged(bool b);
836
        void ephemerisScaleMarkersChanged(bool b);
837
        void grsLongitudeChanged(int l);
838
        void grsDriftChanged(double drift);
839
        void grsJDChanged(double JD);
840
        void earthShadowEnlargementDanjonChanged(bool b);
841
        void flagPermanentSolarCoronaChanged(bool b);
842

843
        void labelsColorChanged(const Vec3f & color);
844
        void pointerColorChanged(const Vec3f & color);
845
        void trailsColorChanged(const Vec3f & color);
846
        void orbitsColorChanged(const Vec3f & color);
847
        void nomenclatureColorChanged(const Vec3f & color);
848
        void majorPlanetsOrbitsColorChanged(const Vec3f & color);
849
        void minorPlanetsOrbitsColorChanged(const Vec3f & color);
850
        void dwarfPlanetsOrbitsColorChanged(const Vec3f & color);
851
        void moonsOrbitsColorChanged(const Vec3f & color);
852
        void cubewanosOrbitsColorChanged(const Vec3f & color);
853
        void plutinosOrbitsColorChanged(const Vec3f & color);
854
        void scatteredDiskObjectsOrbitsColorChanged(const Vec3f & color);
855
        void oortCloudObjectsOrbitsColorChanged(const Vec3f & color);
856
        void cometsOrbitsColorChanged(const Vec3f & color);
857
        void sednoidsOrbitsColorChanged(const Vec3f & color);
858
        void interstellarOrbitsColorChanged(const Vec3f & color);
859
        void mercuryOrbitColorChanged(const Vec3f & color);
860
        void venusOrbitColorChanged(const Vec3f & color);
861
        void earthOrbitColorChanged(const Vec3f & color);
862
        void marsOrbitColorChanged(const Vec3f & color);
863
        void jupiterOrbitColorChanged(const Vec3f & color);
864
        void saturnOrbitColorChanged(const Vec3f & color);
865
        void uranusOrbitColorChanged(const Vec3f & color);
866
        void neptuneOrbitColorChanged(const Vec3f & color);
867
        void ephemerisGenericMarkerColorChanged(const Vec3f & color);
868
        void ephemerisSecondaryMarkerColorChanged(const Vec3f & color);
869
        void ephemerisSelectedMarkerColorChanged(const Vec3f & color);
870
        void ephemerisMercuryMarkerColorChanged(const Vec3f & color);
871
        void ephemerisVenusMarkerColorChanged(const Vec3f & color);
872
        void ephemerisMarsMarkerColorChanged(const Vec3f & color);
873
        void ephemerisJupiterMarkerColorChanged(const Vec3f & color);
874
        void ephemerisSaturnMarkerColorChanged(const Vec3f & color);
875

876
        void orbitColorStyleChanged(const QString &style);
877
        void apparentMagnitudeAlgorithmOnEarthChanged(const QString &algorithm);
878

879
        void solarSystemDataReloaded();
880
        void requestEphemerisVisualization();
881

882
        void extraThreadsChanged(const int);
883

884
        void markerMagThresholdChanged(double m);
885

886
public:
887
        ///////////////////////////////////////////////////////////////////////////
888
        // Other public methods
889
        //! Get a pointer to a Planet object.
890
        //! @param planetEnglishName the English name of the desired planet.
891
        //! @return The matching planet pointer if exists or Q_NULLPTR.
892
        PlanetP searchByEnglishName(const QString &planetEnglishName) const;
893

894
        PlanetP searchMinorPlanetByEnglishName(const QString &planetEnglishName) const;
895

896
        //! Get the Planet object pointer for the Sun.
UNCOV
897
        PlanetP getSun() const {return sun;}
×
898

899
        //! Get the Planet object pointer for the Earth.
UNCOV
900
        PlanetP getEarth() const {return earth;}
×
901

902
        //! Get the Planet object pointer for Earth's moon.
UNCOV
903
        PlanetP getMoon() const {return moon;}
×
904

905
        //! Determine if a lunar eclipse is close at hand?
906
        bool nearLunarEclipse() const;
907

908
        //! Get the list of all the planet english names
909
        QStringList getAllPlanetEnglishNames() const;
910

911
        //! Get the list of all the planet localized names
912
        QStringList getAllPlanetLocalizedNames() const;
913

914
        //! Get the list of all the minor planet english names
915
        QStringList getAllMinorPlanetEnglishNames() const;
916

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

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

925
        //! Opening angle of the bright Solar crescent, radians
926
        //! From: J. Meeus, Morsels IV, ch.15
927
        //! @param lunarSize: apparent Lunar angular size (radius or diameter), angular units of your preference
928
        //! @param solarSize: apparent Solar angular size (radius or diameter, resp.), same angular units
929
        //! @param eclipseMagnitude: covered fraction of the Solar diameter.
930
        static double getEclipseCrescentAngle(const double lunarSize, const double solarSize, const double eclipseMagnitude);
931

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

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

946
        //! Get the list of all the bodies of the solar system.        
UNCOV
947
        const QList<PlanetP>& getAllPlanets() const {return systemPlanets;}
×
948
        //! Get the list of all the bodies of the solar system.
UNCOV
949
        const QList<PlanetP>& getAllMinorBodies() const {return systemMinorBodies;}
×
950
        //! Get the list of all minor bodies names.
951
        const QStringList getMinorBodiesList() const { return minorBodies; }
952

953
private slots:
954
        //! Called when a new object is selected.
955
        void selectedObjectChange(StelModule::StelModuleSelectAction action);
956

957
        //! Called when the sky culture is updated.
958
        //! Loads native names of planets for a given sky culture.
959
        void updateSkyCulture(const StelSkyCulture& skyCulture);
960

961
        void loadCultureSpecificNames(const QJsonObject& data);
962

963
        //! Called following StelMainView::reloadShadersRequested
964
        void reloadShaders();
965

966
        //! Set flag which enabled the showing of ephemeris markers or not
967
        void setFlagEphemerisMarkers(bool b);
968
        //! Get the current value of the flag which enabled the showing of ephemeris markers or not
969
        bool getFlagEphemerisMarkers() const;
970

971
        //! Set flag which enabled the showing of ephemeris line between markers or not
972
        void setFlagEphemerisLine(bool b);
973
        //! Get the current value of the flag which enabled the showing of ephemeris line between markers or not
974
        bool getFlagEphemerisLine() const;
975

976
        //! Set flag which enables ephemeris lines and marks always on
977
        void setFlagEphemerisAlwaysOn(bool b);
978
        //! Get the current value of the flag which makes ephemeris lines and marks always on
979
        bool getFlagEphemerisAlwaysOn() const;
980

981
        //! Set flag, which enables ephemeris marks on position "now"
982
        void setFlagEphemerisNow(bool b);
983
        //! Get the current value of the flag which makes ephemeris marks on position "now"
984
        bool getFlagEphemerisNow() const;
985

986
        //! Set the thickness of ephemeris line
987
        void setEphemerisLineThickness(int v);
988
        //! Get the thickness of ephemeris line
989
        int getEphemerisLineThickness() const;
990

991
        //! Set flag which enabled the showing of ephemeris markers in horizontal coordinates or not
992
        void setFlagEphemerisHorizontalCoordinates(bool b);
993
        //! Get the current value of the flag which enabled the showing of ephemeris markers in horizontal coordinates or not
994
        bool getFlagEphemerisHorizontalCoordinates() const;
995

996
        //! Set flag which enable the showing the date near ephemeris markers or not
997
        void setFlagEphemerisDates(bool b);
998
        //! Get the current value of the flag which enable the showing the date near ephemeris markers or not
999
        bool getFlagEphemerisDates() const;
1000

1001
        //! Set flag which enable the showing the magnitude near ephemeris markers or not
1002
        void setFlagEphemerisMagnitudes(bool b);
1003
        //! Get the current value of the flag which enable the showing the magnitude near ephemeris markers or not
1004
        bool getFlagEphemerisMagnitudes() const;
1005

1006
        //! Set flag which allow skipping dates near ephemeris markers
1007
        void setFlagEphemerisSkipData(bool b);
1008
        //! Get the current value of the flag which allow skipping dates near ephemeris markers
1009
        bool getFlagEphemerisSkipData() const;
1010

1011
        //! Set flag which allow skipping the ephemeris markers without dates
1012
        void setFlagEphemerisSkipMarkers(bool b);
1013
        //! Get the current value of the flag which allow skipping the ephemeris markers without dates
1014
        bool getFlagEphemerisSkipMarkers() const;
1015

1016
        //! Set flag which allow using smart format for dates near ephemeris markers
1017
        void setFlagEphemerisSmartDates(bool b);
1018
        //! Get the current value of the flag which allow using smart format for dates near ephemeris markers
1019
        bool getFlagEphemerisSmartDates() const;
1020

1021
        //! Set flag which allow scaling the ephemeris markers
1022
        void setFlagEphemerisScaleMarkers(bool b);
1023
        //! Get the current value of the flag which allow scaling the ephemeris markers
1024
        bool getFlagEphemerisScaleMarkers() const;
1025

1026
        //! Set the step of skip for date of ephemeris markers (and markers if it enabled)
1027
        void setEphemerisDataStep(int step);
1028
        //! Get the step of skip for date of ephemeris markers
1029
        int getEphemerisDataStep() const;
1030

1031
        //! Set the limit for data: we computed ephemeris for 1, 2 or 5 celestial bodies
1032
        void setEphemerisDataLimit(int limit);
1033
        //! Get the limit of the data (how many celestial bodies was in computing of ephemeris)
1034
        int getEphemerisDataLimit() const;
1035

1036
        void setEphemerisGenericMarkerColor(const Vec3f& c);
1037
        Vec3f getEphemerisGenericMarkerColor(void) const;
1038

1039
        void setEphemerisSecondaryMarkerColor(const Vec3f& c);
1040
        Vec3f getEphemerisSecondaryMarkerColor(void) const;
1041

1042
        void setEphemerisSelectedMarkerColor(const Vec3f& c);
1043
        Vec3f getEphemerisSelectedMarkerColor(void) const;
1044

1045
        void setEphemerisMercuryMarkerColor(const Vec3f& c);
1046
        Vec3f getEphemerisMercuryMarkerColor(void) const;
1047

1048
        void setEphemerisVenusMarkerColor(const Vec3f& c);
1049
        Vec3f getEphemerisVenusMarkerColor(void) const;
1050

1051
        void setEphemerisMarsMarkerColor(const Vec3f& c);
1052
        Vec3f getEphemerisMarsMarkerColor(void) const;
1053

1054
        void setEphemerisJupiterMarkerColor(const Vec3f& c);
1055
        Vec3f getEphemerisJupiterMarkerColor(void) const;
1056

1057
        void setEphemerisSaturnMarkerColor(const Vec3f& c);
1058
        Vec3f getEphemerisSaturnMarkerColor(void) const;
1059

1060
        //! Called when a new Hips survey has been loaded by the hips mgr.
1061
        void onNewSurvey(HipsSurveyP survey);
1062

1063
        //! Taking the JD dates for each ephemeride and preparation the human readable dates according to the settings for dates
1064
        void fillEphemerisDates();
1065

1066
        //! When some aspect of orbit drawing changes, update their configuration
1067
        void reconfigureOrbits();
1068
private:
1069
        //! Search for SolarSystem objects which are close to the position given
1070
        //! in earth equatorial position.
1071
        //! @param v A position in earth equatorial position.
1072
        //! @param core the StelCore object.
1073
        //! @return a pointer to a StelObject if found, else Q_NULLPTR
1074
        StelObjectP search(Vec3d v, const StelCore* core) const;
1075

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

1080
        //! Draw a nice animated pointer around the object.
1081
        void drawPointer(const StelCore* core);
1082

1083
        //! Draw ephemeris lines and markers
1084
        void drawEphemerisItems(const StelCore* core);
1085

1086
        //! Draw a nice markers for ephemeris of objects.
1087
        void drawEphemerisMarkers(const StelCore* core);
1088

1089
        //! Draw a line, who connected markers for ephemeris of objects.
1090
        void drawEphemerisLine(const StelCore* core);
1091

1092
        //! Load planet data from the Solar System configuration files.
1093
        //! This function attempts to load every possible instance of the
1094
        //! Solar System configuration files in the file paths, falling back if a
1095
        //! given path can't be loaded.
1096
        void loadPlanets();
1097

1098
        //! Load planet data from the given file
1099
        bool loadPlanets(const QString& filePath);
1100

1101
        Vec3f getEphemerisMarkerColor(int index) const;
1102

1103
        //! Calculate a color of Solar system bodies
1104
        //! @param bV value of B-V color index
1105
        static unsigned char BvToColorIndex(double bV);
1106

1107
        //! Used to count how many planets actually need shadow information
1108
        int shadowPlanetCount;
1109
        //! Used to track whether earth shadow enlargement shall be computed after Danjon (1951)
1110
        bool earthShadowEnlargementDanjon;
1111
        PlanetP sun;
1112
        PlanetP moon;
1113
        PlanetP earth;
1114

1115
        //! Set selected planets by englishName.
1116
        //! @param englishName The planet name or "" to select no planet
1117
        void setSelected(const QString& englishName);
1118
        //! Set selected object from its pointer.
1119
        void setSelected(PlanetP obj);
1120
        //! Get selected object's pointer.
1121
        PlanetP getSelected(void) const {return selected;}
1122
        //! The currently selected planet.
1123
        PlanetP selected;
1124
        std::vector<PlanetP> selectedSSO; // More than one can be selected at a time
1125

1126
        // Allow enlargements of the planets. May be useful to highlight the planets in in overview plots
1127
        // 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.
1128
        bool flagMoonScale;
1129
        double moonScale;
1130
        bool flagMinorBodyScale;
1131
        double minorBodyScale;
1132
        bool flagPlanetScale;
1133
        double planetScale;
1134
        bool flagSunScale;
1135
        double sunScale;
1136

1137
        QFont planetNameFont;
1138

1139
        //! The amount of planet labels (between 0 and 10).
1140
        double labelsAmount;
1141

1142
        // Flag to follow the state of drawing of solar corona
1143
        bool flagPermanentSolarCorona;
1144

1145
        //! List of all the bodies of the solar system.
1146
        QList<PlanetP> systemPlanets;
1147
        //! List of all the minor bodies of the solar system.
1148
        QList<PlanetP> systemMinorBodies;
1149

1150
        // Master settings
1151
        bool flagOrbits;
1152
        bool flagLightTravelTime;
1153
        bool flagUseObjModels;
1154
        bool flagShowObjSelfShadows;
1155

1156
        //! The selection pointer texture.
1157
        StelTextureSP texPointer;
1158
        StelTextureSP texEphemerisMarker;
1159
        StelTextureSP texEphemerisCometMarker;
1160
        StelTextureSP texEphemerisNowMarker;
1161

1162
        bool flagShow;
1163
        bool flagPointer;                           // show red cross selection pointer?
1164
        bool flagIsolatedTrails;
1165
        int numberIsolatedTrails;
1166
        int maxTrailPoints;                         // limit trails to a manageable size.
1167
        int maxTrailTimeExtent;
1168
        int trailsThickness;
1169
        bool flagIsolatedOrbits;
1170
        bool flagPlanetsOrbits;                                // Show orbits of the major planets, regardless of other orbit settings
1171
        bool flagPlanetsOrbitsOnly;                        // show orbits of the major planets only (no minor bodies in any case)
1172
        bool flagOrbitsWithMoons;                        // Show moon systems if planet orbits are displayed
1173
        bool ephemerisMarkersDisplayed;
1174
        bool ephemerisDatesDisplayed;
1175
        bool ephemerisMagnitudesDisplayed;
1176
        bool ephemerisHorizontalCoordinates;
1177
        bool ephemerisLineDisplayed;
1178
        bool ephemerisAlwaysOn;
1179
        bool ephemerisNow;
1180
        int ephemerisLineThickness;
1181
        bool ephemerisSkipDataDisplayed;
1182
        bool ephemerisSkipMarkersDisplayed;
1183
        int ephemerisDataStep;                                // How many days skip for dates near ephemeris markers (and the markers if it enabled)
1184
        int ephemerisDataLimit;                                // Number of celestial bodies in ephemeris data (how many celestial bodies was in computing of ephemeris)
1185
        bool ephemerisSmartDatesDisplayed;
1186
        bool ephemerisScaleMarkersDisplayed;
1187
        Vec3f ephemerisGenericMarkerColor;
1188
        Vec3f ephemerisSecondaryMarkerColor;
1189
        Vec3f ephemerisSelectedMarkerColor;
1190
        Vec3f ephemerisMercuryMarkerColor;
1191
        Vec3f ephemerisVenusMarkerColor;
1192
        Vec3f ephemerisMarsMarkerColor;
1193
        Vec3f ephemerisJupiterMarkerColor;
1194
        Vec3f ephemerisSaturnMarkerColor;
1195

1196
        class TrailGroup* allTrails;
1197
        QSettings* conf;
1198
        LinearFader trailFader;
1199
        Vec3f trailsColor;
1200
        Vec3f pointerColor;
1201

1202
        static const QMap<Planet::ApparentMagnitudeAlgorithm, QString> vMagAlgorithmMap;
1203

1204
        QStringList minorBodies;
1205

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

1215
        //! Number of additional threads. This could be automatically derived, but for now we can experiment.
1216
        int extraThreads;
1217

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

1230
        //! Buffer for storing the marker positions
1231
        MarkerVertex* markerArray;
1232
        //! Buffer for storing the texture coordinate array data.
1233
        unsigned char* textureCoordArray;
1234

1235
        class QOpenGLShaderProgram* markerShaderProgram;
1236
        struct MarkerShaderVars {
1237
                int projectionMatrix;
1238
                int texCoord;
1239
                int pos;
1240
                int color; // Can we remove that?
1241
                int texture;
1242
        };
1243
        MarkerShaderVars markerShaderVars;
1244

1245
        //! Current number of sources stored in the buffer (still to display)
1246
        unsigned int nbMarkers;
1247
        std::unique_ptr<QOpenGLVertexArrayObject> vao;
1248
        std::unique_ptr<QOpenGLBuffer> vbo;
1249
        //! Binds actual VAO if it's supported, sets up the relevant state manually otherwise.
1250
        void bindVAO();
1251
        //! Sets the vertex attribute states for the currently bound VAO so that glDraw* commands can work.
1252
        void setupCurrentVAO();
1253
        //! Binds zero VAO if VAO is supported, manually disables the relevant vertex attributes otherwise.
1254
        void releaseVAO();
1255

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

1262
public:
1263
        bool drawAsteroidMarker(StelCore* core, StelPainter* sPainter, const float x, const float y, Vec3f &color);
UNCOV
1264
        float getMarkerValue() const {return markerFader.getInterstate();}
×
1265

1266
private:
1267
        //! absolute value of the dimmest SSO drawn by drawAsteroidMarker()
1268
        double markerMagThreshold;
1269
        //! Preliminary experimental select-per-config.ini.
1270
        //! 0: original single-threaded 3 loops
1271
        //! 1: blockingMap
1272
        //! 2: strided pool threads plus main thread
1273
        //! 3: Ruslan's 1-pass loop (suspected to have a logical error.)
1274
        //! To configure the experimental new solution, add [devel]/compute_positions_algorithm=0|1|2|3. Default=2
1275
        int computePositionsAlgorithm;
1276
        // END OF BLOCK RELATED TO MASS MARKER DISPLAY
1277
};
1278

1279

1280
#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