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

Stellarium / stellarium / 15670925756

16 Jun 2025 02:08AM UTC coverage: 11.775% (-0.2%) from 11.932%
15670925756

push

github

alex-w
Updated data

14700 of 124846 relevant lines covered (11.77%)

18189.25 hits per line

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

0.0
/src/core/modules/ConstellationMgr.hpp
1
/*
2
 * Stellarium
3
 * Copyright (C) 2002 Fabien Chereau
4
 * Copyright (C) 2012 Timothy Reaves
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 CONSTELLATIONMGR_HPP
22
#define CONSTELLATIONMGR_HPP
23

24
#include "StelObjectType.hpp"
25
#include "StelObjectModule.hpp"
26
#include "StelObject.hpp"
27
#include "StelSkyCultureSkyPartition.hpp"
28

29
#include <vector>
30
#include <QString>
31
#include <QStringList>
32
#include <QFont>
33

34
class StelToneReproducer;
35
class StarMgr;
36
class Constellation;
37
class StelProjector;
38
class StelPainter;
39
class StelSkyCulture;
40

41
//! @class ConstellationMgr
42
//! Display and manage the constellations.
43
//! It can display constellations lines, names, art textures and boundaries.
44
//! It also supports several different sky cultures.
45
//! Some sky cultures have up to 2 optional @ref StelSkycultureSkyPartition elements related to concepts of a Zodiac (the known cases are all similar, 12x30 degrees along the ecliptic),
46
//! or of sections along ecliptic or equator related to the Moon, called LunarSystems. These are more diverse, but still only at most one per skyculture.
47
//! Both of these systems bear concepts of coordinates and are important for timekeeping, but esp. the Chinese systems also for actual use as celestial coordinates.
48
class ConstellationMgr : public StelObjectModule
49
{
50
        Q_OBJECT
51
        Q_PROPERTY(bool artDisplayed              READ getFlagArt                        WRITE setFlagArt                       NOTIFY artDisplayedChanged)
52
        Q_PROPERTY(float artFadeDuration          READ getArtFadeDuration                WRITE setArtFadeDuration               NOTIFY artFadeDurationChanged)
53
        Q_PROPERTY(float artIntensity             READ getArtIntensity                   WRITE setArtIntensity                  NOTIFY artIntensityChanged)
54
        Q_PROPERTY(Vec3f boundariesColor          READ getBoundariesColor                WRITE setBoundariesColor               NOTIFY boundariesColorChanged)
55
        Q_PROPERTY(bool boundariesDisplayed       READ getFlagBoundaries                 WRITE setFlagBoundaries                NOTIFY boundariesDisplayedChanged)
56
        Q_PROPERTY(float boundariesFadeDuration          READ getBoundariesFadeDuration         WRITE setBoundariesFadeDuration        NOTIFY boundariesFadeDurationChanged)
57
        Q_PROPERTY(int fontSize                          READ getFontSize                       WRITE setFontSize                      NOTIFY fontSizeChanged)
58
        Q_PROPERTY(bool isolateSelected                  READ getFlagIsolateSelected            WRITE setFlagIsolateSelected           NOTIFY isolateSelectedChanged)
59
        Q_PROPERTY(bool flagConstellationPick     READ getFlagConstellationPick          WRITE setFlagConstellationPick                NOTIFY flagConstellationPickChanged)
60
        Q_PROPERTY(Vec3f linesColor               READ getLinesColor                     WRITE setLinesColor                    NOTIFY linesColorChanged)
61
        Q_PROPERTY(bool linesDisplayed            READ getFlagLines                      WRITE setFlagLines                     NOTIFY linesDisplayedChanged)
62
        Q_PROPERTY(float linesFadeDuration        READ getLinesFadeDuration              WRITE setLinesFadeDuration             NOTIFY linesFadeDurationChanged)
63
        Q_PROPERTY(Vec3f namesColor               READ getLabelsColor                    WRITE setLabelsColor                   NOTIFY namesColorChanged)
64
        Q_PROPERTY(bool namesDisplayed            READ getFlagLabels                     WRITE setFlagLabels                    NOTIFY namesDisplayedChanged)
65
        Q_PROPERTY(float namesFadeDuration        READ getLabelsFadeDuration             WRITE setLabelsFadeDuration            NOTIFY namesFadeDurationChanged)
66
        Q_PROPERTY(int constellationLineThickness READ getConstellationLineThickness     WRITE setConstellationLineThickness    NOTIFY constellationLineThicknessChanged)
67
        Q_PROPERTY(int boundariesThickness          READ getBoundariesThickness            WRITE setBoundariesThickness           NOTIFY boundariesThicknessChanged)
68
        Q_PROPERTY(bool  hullsDisplayed           READ getFlagHulls                      WRITE setFlagHulls                     NOTIFY hullsDisplayedChanged)
69
        Q_PROPERTY(Vec3f hullsColor               READ getHullsColor                     WRITE setHullsColor                    NOTIFY hullsColorChanged)
70
        Q_PROPERTY(int   hullsThickness                  READ getHullsThickness                 WRITE setHullsThickness                NOTIFY hullsThicknessChanged)
71
        Q_PROPERTY(float hullsFadeDuration          READ getHullsFadeDuration              WRITE setHullsFadeDuration             NOTIFY hullsFadeDurationChanged)
72

73
        Q_PROPERTY(bool  zodiacDisplayed          READ getFlagZodiac                     WRITE setFlagZodiac                    NOTIFY zodiacDisplayedChanged)
74
        Q_PROPERTY(Vec3f zodiacColor              READ getZodiacColor                    WRITE setZodiacColor                   NOTIFY zodiacColorChanged)
75
        Q_PROPERTY(int   zodiacThickness          READ getZodiacThickness                WRITE setZodiacThickness               NOTIFY zodiacThicknessChanged)
76
        Q_PROPERTY(float zodiacFadeDuration          READ getZodiacFadeDuration             WRITE setZodiacFadeDuration            NOTIFY zodiacFadeDurationChanged)
77
        Q_PROPERTY(bool  lunarSystemDisplayed     READ getFlagLunarSystem                WRITE setFlagLunarSystem               NOTIFY lunarSystemDisplayedChanged)
78
        Q_PROPERTY(Vec3f lunarSystemColor         READ getLunarSystemColor               WRITE setLunarSystemColor              NOTIFY lunarSystemColorChanged)
79
        Q_PROPERTY(int   lunarSystemThickness     READ getLunarSystemThickness           WRITE setLunarSystemThickness          NOTIFY lunarSystemThicknessChanged)
80
        Q_PROPERTY(float lunarSystemFadeDuration  READ getLunarSystemFadeDuration        WRITE setLunarSystemFadeDuration       NOTIFY lunarSystemFadeDurationChanged)
81

82

83
public:
84
        //! Constructor
85
        ConstellationMgr(StarMgr *stars);
86
        //! Destructor
87
        ~ConstellationMgr() override;
88

89
        ///////////////////////////////////////////////////////////////////////////
90
        // Methods defined in the StelModule class
91
        //! Initialize the ConstellationMgr.
92
        //! Reads from the configuration parser object and updates the loading bar
93
        //! as constellation objects are loaded for the required sky culture.
94
        void init() override;
95

96
        //! Draw constellation lines, art, names and boundaries.
97
        void draw(StelCore* core) override;
98

99
        //! Updates time-varying state for each Constellation.
100
        void update(double deltaTime) override;
101

102
        //! Return the value defining the order of call for the given action
103
        //! @param actionName the name of the action for which we want the call order
104
        //! @return the value defining the order. The closer to 0 the earlier the module's action will be called
105
        double getCallOrder(StelModuleActionName actionName) const override;
106

107
        ///////////////////////////////////////////////////////////////////////////
108
        // Methods defined in StelObjectModule class
109

110
        //! Search for StelObject in an area around a specified point.
111
        //! The function searches in a disk of diameter limitFov centered on v.
112
        //! Only visible objects (i.e. currently displayed on screen) should be returned.
113
        //! @param v equatorial position at epoch J2000 (without aberration).
114
        //! @param limitFov angular diameter of the searching zone in degree. (ignored here. Only v is queried.)
115
        //! @param core the StelCore instance to use.
116
        //! @return a list of constellations identified from their hulls when clicked inside.
117
        //! This can probably be used for selection when IAU borders don't exist and click does not identify a star in a constellation line.
118
        QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const override;
119

120
        //! @return the matching constellation object's pointer if exists or Q_NULLPTR
121
        //! @param nameI18n The case in-sensitive constellation name
122
        StelObjectP searchByNameI18n(const QString& nameI18n) const override;
123

124
        //! @return the matching constellation if exists or Q_NULLPTR
125
        //! @param name The case in-sensitive standard program name (three letter abbreviation)
126
        StelObjectP searchByName(const QString& name) const override;
127

128
        StelObjectP searchByID(const QString &id) const override;
129

130
        QStringList listAllObjects(bool inEnglish) const override;
131
        QString getName() const override { return "Constellations"; }
×
132
        QString getStelObjectType() const override;
133

134
        ///////////////////////////////////////////////////////////////////////////
135
        //! Returns whether the current skyculture defines a zodiac-type cultural coordinate system
136
        bool hasZodiac() const {return !zodiac.isNull();}
×
137
        //! Returns whether the current skyculture defines a lunar-related cultural coordinate system (lunar stations or mansions)
138
        bool hasLunarSystem() const {return !lunarSystem.isNull();}
×
139
        //! @return the translated name of the Zodiac system
140
        QString getZodiacSystemName() const;
141
        //! @return the translated name of the Lunar system
142
        QString getLunarSystemName() const;
143
        //!@return longitude in the culture's zodiacal longitudes (usually sign, degrees, minutes)
144
        QString getZodiacCoordinate(Vec3d eqNow) const;
145
        //! @return lunar station in the culture's Lunar system
146
        QString getLunarSystemCoordinate(Vec3d eqNow) const;
147

148
        // Properties setters and getters
149
public slots:        
150
        //! Set whether constellation art will be displayed
151
        void setFlagArt(const bool displayed);
152
        //! Get whether constellation art is displayed
153
        bool getFlagArt(void) const;
154

155
        //! Set constellation art fade duration in second
156
        void setArtFadeDuration(const float duration);
157
        //! Get constellation art fade duration in second
158
        float getArtFadeDuration() const;
159

160
        //! Set constellation maximum art intensity (between 0 and 1)
161
        //! Note that the art intensity is linearly faded out if the FOV is in a specific interval,
162
        //! which can be adjusted using setArtIntensityMinimumFov() and setArtIntensityMaximumFov()
163
        void setArtIntensity(const float intensity);
164
        //! Return constellation maximum art intensity (between 0 and 1)
165
        //! Note that the art intensity is linearly faded out if the FOV is in a specific interval,
166
        //! which can be adjusted using setArtIntensityMinimumFov() and setArtIntensityMaximumFov()
167
        float getArtIntensity() const;
168

169
        //! Sets the lower bound on the FOV at which the art intensity fades to zero.
170
        //!  See LP:#1294483. The default is 1.0.
171
        void setArtIntensityMinimumFov(const double fov);
172
        //! Returns the lower bound on the FOV at which the art intensity fades to zero.
173
        //! See LP:#1294483. The default is 1.0.
174
        double getArtIntensityMinimumFov() const;
175

176
        //! Sets the upper bound on the FOV at which the art intensity becomes the maximum
177
        //! set by setArtIntensity()
178
        //!  See LP:#1294483. The default is 2.0.
179
        void setArtIntensityMaximumFov(const double fov);
180
        //! Returns the upper bound on the FOV at which the art intensity becomes the maximum
181
        //! set by setArtIntensity()
182
        //!  See LP:#1294483. The default is 2.0.
183
        double getArtIntensityMaximumFov() const;
184

185
        //! Define boundary color
186
        //! @param color The color of boundaries
187
        //! @code
188
        //! // example of usage in scripts (Qt6-based Stellarium)
189
        //! var c = new Color(1.0, 0.0, 0.0);
190
        //! ConstellationMgr.setBoundariesColor(c.toVec3f());
191
        //! @endcode
192
        void setBoundariesColor(const Vec3f& color);
193
        //! Get current boundary color
194
        Vec3f getBoundariesColor() const;
195

196
        //! Set whether constellation boundaries lines will be displayed
197
        void setFlagBoundaries(const bool displayed);
198
        //! Get whether constellation boundaries lines are displayed
199
        bool getFlagBoundaries(void) const;
200

201
        //! Set constellation boundaries fade duration in second
202
        void setBoundariesFadeDuration(const float duration);
203
        //! Get constellation boundaries fade duration in second
204
        float getBoundariesFadeDuration() const;
205

206
        //! Set whether selected constellation must be displayed alone
207
        void setFlagIsolateSelected(const bool isolate);
208
        //! Get whether selected constellation is displayed alone
209
        bool getFlagIsolateSelected(void) const;
210

211
        //! Set whether only one selected constellation must be displayed
212
        void setFlagConstellationPick(const bool mode);
213
        //! Get whether only one selected constellation is displayed
214
        bool getFlagConstellationPick(void) const;
215

216
        //! Define line color
217
        //! @param color The color of lines
218
        //! @code
219
        //! // example of usage in scripts (Qt6-based Stellarium)
220
        //! var c = new Color(1.0, 0.0, 0.0);
221
        //! ConstellationMgr.setLinesColor(c.toVec3f());
222
        //! @endcode
223
        void setLinesColor(const Vec3f& color);
224
        //! Get line color
225
        Vec3f getLinesColor() const;
226

227
        //! Set whether constellation lines will be displayed
228
        void setFlagLines(const bool displayed);
229
        //! Get whether constellation lines are displayed
230
        bool getFlagLines(void) const;
231

232
        //! Set constellation lines fade duration in second
233
        void setLinesFadeDuration(const float duration);
234
        //! Get constellation lines fade duration in second
235
        float getLinesFadeDuration() const;
236

237
        //! Set label color for names
238
        //! @param color The color of labels
239
        //! @code
240
        //! // example of usage in scripts (Qt6-based Stellarium)
241
        //! var c = new Color(1.0, 0.0, 0.0);
242
        //! ConstellationMgr.setLabelsColor(c.toVec3f());
243
        //! @endcode
244
        void setLabelsColor(const Vec3f& color);
245
        //! Get label color for names
246
        Vec3f getLabelsColor() const;
247

248
        //! Set whether constellation names will be displayed
249
        void setFlagLabels(const bool displayed);
250
        //! Set whether constellation names are displayed
251
        bool getFlagLabels(void) const;
252

253
        //! Set constellation labels fade duration in seconds
254
        void setLabelsFadeDuration(const float duration);
255
        //! Get constellation labels fade duration in seconds
256
        float getLabelsFadeDuration() const;
257

258
        //! Define hull line color
259
        //! @param color The color of hull lines
260
        //! @code
261
        //! // example of usage in scripts (Qt6-based Stellarium)
262
        //! var c = new Color(1.0, 0.0, 0.0);
263
        //! ConstellationMgr.setHullsColor(c.toVec3f());
264
        //! @endcode
265
        void setHullsColor(const Vec3f& color);
266
        //! Get current hulls color
267
        Vec3f getHullsColor() const;
268

269
        //! Set whether constellation hull lines will be displayed
270
        void setFlagHulls(const bool displayed);
271
        //! Get whether constellation boundaries lines are displayed
272
        bool getFlagHulls(void) const;
273

274
        //! Set constellation hulls fade duration in second
275
        void setHullsFadeDuration(const float duration);
276
        //! Get constellation hulls fade duration in second
277
        float getHullsFadeDuration() const;
278

279
        //! Set the font size used for constellation names display
280
        void setFontSize(const int newFontSize);
281
        //! Get the font size used for constellation names display
282
        int getFontSize() const;
283

284
        //! Set the thickness of lines of the constellations
285
        //! @param thickness of line in pixels
286
        void setConstellationLineThickness(const int thickness);
287
        //! Get the thickness of lines of the constellations
288
        int getConstellationLineThickness() const { return constellationLineThickness; }
×
289

290
        //! Set the thickness of boundaries of the constellations
291
        //! @param thickness of line in pixels
292
        void setBoundariesThickness(const int thickness);
293
        //! Get the thickness of boundaries of the constellations
294
        int getBoundariesThickness() const { return boundariesThickness; }
×
295

296
        //! Set the thickness of constellation hulls
297
        //! @param thickness of line in pixels
298
        void setHullsThickness(const int thickness);
299
        //! Get the thickness of constellations hulls
300
        int getHullsThickness() const { return hullsThickness; }
×
301

302

303
        //! Define zodiac line color
304
        //! @param color The color of zodiac related lines
305
        //! @code
306
        //! // example of usage in scripts (Qt6-based Stellarium)
307
        //! var c = new Color(1.0, 0.0, 0.0);
308
        //! ConstellationMgr.setZodiacColor(c.toVec3f());
309
        //! @endcode
310
        void setZodiacColor(const Vec3f& color);
311
        //! Get current zodiac color
312
        Vec3f getZodiacColor() const;
313

314
        //! Set whether zodiac will be displayed, if defined
315
        void setFlagZodiac(const bool displayed);
316
        //! Get whether zodiac-related lines are displayed (if defined in the skyculture)
317
        bool getFlagZodiac(void) const;
318

319
        //! Set zodiac fade duration in second
320
        void setZodiacFadeDuration(const float duration);
321
        //! Get zodiac fade duration in second
322
        float getZodiacFadeDuration() const;
323

324
        //! Define lunarSystem line color
325
        //! @param color The color of lunarSystem lines
326
        //! @code
327
        //! // example of usage in scripts (Qt6-based Stellarium)
328
        //! var c = new Color(1.0, 0.0, 0.0);
329
        //! ConstellationMgr.setLunarSystemColor(c.toVec3f());
330
        //! @endcode
331
        void setLunarSystemColor(const Vec3f& color);
332
        //! Get current lunarSystem color
333
        Vec3f getLunarSystemColor() const;
334

335
        //! Set whether lunarSystem lines will be displayed, if defined
336
        void setFlagLunarSystem(const bool displayed);
337
        //! Get whether lunarSystem lines are displayed
338
        bool getFlagLunarSystem(void) const;
339

340
        //! Set lunarSystem fade duration in second
341
        void setLunarSystemFadeDuration(const float duration);
342
        //! Get lunarSystem fade duration in second
343
        float getLunarSystemFadeDuration() const;
344

345
        //! Set the thickness of zodiac-related lines
346
        //! @param thickness of line in pixels
347
        void setZodiacThickness(const int thickness);
348
        //! Get the thickness of zodiac-related lines
349
        int getZodiacThickness() const { return zodiacThickness; }
×
350
        //! Set the thickness of lunarSystem-related lines
351
        //! @param thickness of line in pixels
352
        void setLunarSystemThickness(const int thickness);
353
        //! Get the thickness of lunarSystem-related lines
354
        int getLunarSystemThickness() const { return lunarSystemThickness; }
×
355

356

357
        //! Remove constellations from selected objects
358
        void deselectConstellations(void);
359

360
        //! Select all constellations
361
        void selectAllConstellations(void);
362

363
        //! Select the constellation by its English name. Calling this method will enable
364
        //! isolated selection for the constellations if it is not enabled yet.
365
        //! @param englishName the English name of the constellation
366
        //! @code
367
        //! // example of usage in scripts: select the Orion constellation
368
        //! ConstellationMgr.selectConstellation("Orion");
369
        //! @endcode
370
        void selectConstellation(const QString& englishName);
371
        //! Select the constellation where celestial body with English name is located.
372
        //! Calling this method will enable isolated selection for the constellations if it is
373
        //! not enabled yet.
374
        //! @param englishName the English name of the celestial body
375
        //! @code
376
        //! // example of usage in scripts: select constellation where Venus is located
377
        //! ConstellationMgr.selectConstellationByObjectName("Venus");
378
        //! @endcode
379
        //! @note the method will correctly work for sky cultures with boundaries
380
        //! otherwise you may use star names from constellation lines as celestial body
381
        void selectConstellationByObjectName(const QString& englishName);
382
        //! Remove the constellation from list of selected constellations by its English
383
        //! name. Calling this method will enable isolated selection for the constellations
384
        //! if it is not enabled yet.
385
        //! @param englishName the English name of the constellation
386
        //! @code
387
        //! // example of usage in scripts: remove Orion from the selection of constellations
388
        //! ConstellationMgr.deselectConstellation("Orion");
389
        //! @endcode
390
        //! @note all constellations will be hidden when list of selected constellations is empty
391
        void deselectConstellation(const QString& englishName);
392

393
        //! Get the list of English names of all constellations for loaded sky culture
394
        QStringList getConstellationsEnglishNames();
395

396
        //! Create a list of entries: Constellation: Hull_area to logfile
397
        //! @todo: Extend with GUI etc?
398
        void outputHullAreas(const QString &fileNamePrefix="hullAreas") const;
399

400
        //! Create a list of stars (CSV file) within the convex hull of constellation.
401
        //! This command is perfect to be used as scripting command to extract a data list.
402
        //! @param englishName name of the constellation. Either englishName or abbreviation.
403
        //! @param hipOnly (default: true) list only Hipparcos stars
404
        //! @param maxMag (default: 25) list stars down to this magnitude.
405
        //! @param fileNamePrefix prefix (name start) name of CSV file to be written.
406
        //! The file will be written into the Stellarium User Data directory,
407
        //! the full filename will be fileNamePrefix_englishName_maxMag.csv.
408
        void starsInHullOf(const QString &englishName, const bool hipOnly=true, const float maxMag=25.0f, const QString &fileNamePrefix="hullStars") const;
409

410

411
signals:
412
        void artDisplayedChanged(const bool displayed);
413
        void artFadeDurationChanged(const float duration);
414
        void artIntensityChanged(const double intensity);
415
        void boundariesColorChanged(const Vec3f & color);
416
        void boundariesDisplayedChanged(const bool displayed);
417
        void boundariesFadeDurationChanged(const float duration);
418
        void boundariesThicknessChanged(int thickness);
419
        void hullsColorChanged(const Vec3f & color);
420
        void hullsDisplayedChanged(const bool displayed);
421
        void hullsFadeDurationChanged(const float duration);
422
        void hullsThicknessChanged(int thickness);
423
        void zodiacColorChanged(const Vec3f & color);
424
        void zodiacDisplayedChanged(const bool displayed);
425
        void zodiacFadeDurationChanged(const float duration);
426
        void zodiacThicknessChanged(int thickness);
427
        void lunarSystemColorChanged(const Vec3f & color);
428
        void lunarSystemDisplayedChanged(const bool displayed);
429
        void lunarSystemFadeDurationChanged(const float duration);
430
        void lunarSystemThicknessChanged(int thickness);
431
        void fontSizeChanged(const int newSize);
432
        void isolateSelectedChanged(const bool isolate);
433
        void flagConstellationPickChanged(const bool mode);
434
        void linesColorChanged(const Vec3f & color);
435
        void linesDisplayedChanged(const bool displayed);
436
        void linesFadeDurationChanged(const float duration);
437
        void namesColorChanged(const Vec3f & color);
438
        void namesDisplayedChanged(const bool displayed);
439
        void namesFadeDurationChanged(const float duration);
440
        void constellationsDisplayStyleChanged(const StelObject::CulturalDisplayStyle style);
441
        void constellationLineThicknessChanged(int thickness);
442

443
private slots:
444
        //! Limit the number of constellations to draw based on selected stars.
445
        //! The selected objects changed, check if some stars are selected and display the
446
        //! matching constellations if isolateSelected mode is activated.
447
        //! @param action define whether to add to, replace, or remove from the existing selection
448
        void selectedObjectChange(StelModule::StelModuleSelectAction action);
449

450
        //! Loads new constellation data and art if the SkyCulture has changed.
451
        //! @param skyCultureDir the name of the directory containing the sky culture to use.
452
        void updateSkyCulture(const StelSkyCulture& skyCulture);
453

454
        //! Update i18n names from English names according to current
455
        //! locale, and update font for locale.
456
        //! The translation is done using gettext with translated strings defined
457
        //! in translations.h
458
        void updateI18n();
459

460
        void reloadSkyCulture(void);
461

462
private:
463
        void setFlagCheckLoadingData(const bool flag) { checkLoadingData = flag; }
×
464
        bool getFlagCheckLoadingData(void) const { return checkLoadingData; }
×
465

466
        //! Load constellation line shapes, art textures and boundaries shapes from data files.
467
        //! @param constellationsData The structure describing all the constellations
468
        void loadLinesNamesAndArt(const StelSkyCulture& culture);
469

470
        //! Recreate convex hulls. This needs to be done when stars have shifted due to proper motion.
471
        //! Should be ocasionally triggered in update().
472
        void recreateHulls();
473

474
        //! Load the constellation boundary file.
475
        //! This function deletes any currently loaded constellation boundaries
476
        //! and loads a new set from the data passed as the parameter.
477
        //! @param epoch: Specified as JSON key "edges_epoch".
478
        //! Can be "Bxxxx.x" (Besselian year), "Jxxxx.x" (Julian year), "JDjjjjjjjj.jjj" (Julian day number) and pure doubles as JD.
479
        //! The most common cases, "B1875" (for IAU boundaries) and "J2000" are handled most efficiently.
480
        bool loadBoundaries(const QJsonArray& boundaryData, const QString& epoch);
481

482
        //! Draw the constellation lines at the epoch given by the StelCore.
483
        void drawLines(StelPainter& sPainter, const StelCore* core) const;
484
        //! Draw the constellation art. obsVelocity required for aberration
485
        void drawArt(StelPainter& sPainter, const Vec3d &obsVelocity) const;
486
        //! Draw the constellation name labels.
487
        void drawNames(StelPainter& sPainter, const Vec3d &obsVelocity) const;
488
        //! Draw the constellation boundaries.
489
        //! @param obsVelocity is the speed vector of the observer planet to distort boundaries by aberration.
490
        void drawBoundaries(StelPainter& sPainter, const Vec3d &obsVelocity) const;
491
        //! Draw the constellation hulls.
492
        //! @param obsVelocity is the speed vector of the observer planet to distort hulls by aberration.
493
        void drawHulls(StelPainter& sPainter, const Vec3d &obsVelocity) const;
494
        //! Draw the zodiac, if any is defined in the current skyculture.
495
        //! @param obsVelocity is the speed vector of the observer planet to distort zodiac lines by aberration.
496
        void drawZodiac(StelPainter& sPainter, const Vec3d &obsVelocity) const;
497
        //! Draw the lunar system lines, if any is defined in the current skyculture.
498
        //! @param obsVelocity is the speed vector of the observer planet to distort lunarSystem lines by aberration.
499
        void drawLunarSystem(StelPainter& sPainter, const Vec3d &obsVelocity) const;
500

501
        //! Handle single and multi-constellation selections.
502
        void setSelectedConst(QList <Constellation*> cList);
503
        //! Handle unselecting a single constellation.
504
        void unsetSelectedConst(Constellation* c);
505
        //! Define which constellation is selected from its abbreviation.
506
        void setSelected(const QString& abbreviation);
507
        //! Define which constellation is selected and return brightest star.
508
        StelObjectP setSelectedStar(const QString& abbreviation);
509
        //! Define which constellation is selected from a star number.
510
        void setSelected(const StelObject* s);
511
        //! Remove all selected constellations.
512
        void deselect() { setSelected(Q_NULLPTR); }
513
        //! Get the first selected constellation.
514
        QList<Constellation*> getSelected(void) const;
515

516
        QList<Constellation*> selected; // More than one can be selected at a time
517

518
        //! Return list of constellations the object is member of.
519
        //! In case of IAU constellations, the list is guaranteed to be of length 1.
520
        //! @param useHull Prefer to use constellation hull, not IAU borders
521
        QList<Constellation*> isObjectIn(const StelObject *s, bool useHull) const;
522
        Constellation* findFromAbbreviation(const QString& abbreviation) const;
523
        QList<Constellation*> constellations; //!< Constellations in the current SkyCulture
524
        QFont asterFont;
525
        StarMgr* hipStarMgr;
526

527
        bool isolateSelected; //!< true to pick individual constellations.
528
        bool flagConstellationPick; // TODO: CLEAR DESCRIPTION
529
        std::vector<std::vector<Vec3d> *> allBoundarySegments;
530

531
        // These are THE master settings - individual constellation settings can vary based on selection status
532
        float artFadeDuration;
533
        float artIntensity;
534
        double artIntensityMinimumFov;
535
        double artIntensityMaximumFov;
536
        bool artDisplayed;
537
        bool boundariesDisplayed;
538
        float boundariesFadeDuration;
539
        bool linesDisplayed;
540
        float linesFadeDuration;
541
        bool namesDisplayed;
542
        float namesFadeDuration;
543
        bool hullsDisplayed;
544
        float hullsFadeDuration;
545
        float zodiacFadeDuration;
546
        float lunarSystemFadeDuration;
547

548
        bool checkLoadingData;
549

550
        int constellationLineThickness;   //!< line width of the constellation lines
551
        int boundariesThickness;          //!< line width of the constellation boundaries
552
        int hullsThickness;               //!< line width of the constellation boundaries
553
        int zodiacThickness;              //!< line width of the zodiac lines, if any
554
        int lunarSystemThickness;         //!< line width of the lunarSystem lines, if any
555
        Vec3f zodiacColor;
556
        Vec3f lunarSystemColor;
557
        LinearFader zodiacFader;
558
        LinearFader lunarSystemFader;
559

560
        //! optional zodiac description from index.json
561
        StelSkyCultureSkyPartitionP zodiac;
562
        //! optional lunarSystem description from index.json
563
        StelSkyCultureSkyPartitionP lunarSystem;
564
};
565

566
#endif // CONSTELLATIONMGR_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