-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathNebulaMgr.hpp
More file actions
1034 lines (938 loc) · 39.5 KB
/
Copy pathNebulaMgr.hpp
File metadata and controls
1034 lines (938 loc) · 39.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Stellarium
* Copyright (C) 2002 Fabien Chereau
* Copyright (C) 2011 Alexander Wolf
* Copyright (C) 2015 Georg Zotti
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/
#ifndef NEBULAMGR_HPP
#define NEBULAMGR_HPP
#include "StelObjectType.hpp"
#include "StelFader.hpp"
#include "StelSphericalIndex.hpp"
#include "StelObjectModule.hpp"
#include "StelTextureTypes.hpp"
#include "Nebula.hpp"
#include <QString>
#include <QStringList>
#include <QFont>
class StelTranslator;
class StelToneReproducer;
class QSettings;
class StelPainter;
typedef QSharedPointer<Nebula> NebulaP;
//! @class NebulaMgr
//! Manage a collection of nebulae. This class is used
//! to display the NGC catalog with information, and textures for some of them.
// GZ: This doc seems outdated/misleading - photo textures are not mamaged here but in StelSkyImageTile
class NebulaMgr : public StelObjectModule
{
Q_OBJECT
//StelActions
Q_PROPERTY(bool flagHintDisplayed
READ getFlagHints
WRITE setFlagHints
NOTIFY flagHintsDisplayedChanged)
Q_PROPERTY(bool flagTypeFiltersUsage
READ getFlagUseTypeFilters
WRITE setFlagUseTypeFilters
NOTIFY flagUseTypeFiltersChanged)
//StelProperties
// This used to be of type Nebula::TypeGroup, however on Qt6 this does not work and was changed to int.
Q_PROPERTY(int typeFilters
READ getTypeFilters
WRITE setTypeFilters
NOTIFY typeFiltersChanged
)
// This used to be of type Nebula::CatalogGroup, however on Qt6 this does not work and was changed to int.
Q_PROPERTY(int catalogFilters
READ getCatalogFilters
WRITE setCatalogFilters
NOTIFY catalogFiltersChanged
)
Q_PROPERTY(bool hintsProportional
READ getHintsProportional
WRITE setHintsProportional
NOTIFY hintsProportionalChanged
)
Q_PROPERTY(bool flagOutlinesDisplayed
READ getFlagOutlines
WRITE setFlagOutlines
NOTIFY flagOutlinesDisplayedChanged
)
Q_PROPERTY(bool flagAdditionalNamesDisplayed
READ getFlagAdditionalNames
WRITE setFlagAdditionalNames
NOTIFY flagAdditionalNamesDisplayedChanged
)
Q_PROPERTY(bool flagSurfaceBrightnessUsage
READ getFlagSurfaceBrightnessUsage
WRITE setFlagSurfaceBrightnessUsage
NOTIFY flagSurfaceBrightnessUsageChanged
)
Q_PROPERTY(bool flagSurfaceBrightnessArcsecUsage
READ getFlagSurfaceBrightnessArcsecUsage
WRITE setFlagSurfaceBrightnessArcsecUsage
NOTIFY flagSurfaceBrightnessArcsecUsageChanged
)
Q_PROPERTY(bool flagSurfaceBrightnessShortNotationUsage
READ getFlagSurfaceBrightnessShortNotationUsage
WRITE setFlagSurfaceBrightnessShortNotationUsage
NOTIFY flagSurfaceBrightnessShortNotationUsageChanged
)
Q_PROPERTY(double labelsAmount
READ getLabelsAmount
WRITE setLabelsAmount
NOTIFY labelsAmountChanged
)
Q_PROPERTY(double hintsAmount
READ getHintsAmount
WRITE setHintsAmount
NOTIFY hintsAmountChanged
)
Q_PROPERTY(bool flagDesignationLabels
READ getDesignationUsage
WRITE setDesignationUsage
NOTIFY designationUsageChanged
)
Q_PROPERTY(bool flagUseSizeLimits
READ getFlagSizeLimitsUsage
WRITE setFlagSizeLimitsUsage
NOTIFY flagSizeLimitsUsageChanged
)
Q_PROPERTY(double minSizeLimit
READ getMinSizeLimit
WRITE setMinSizeLimit
NOTIFY minSizeLimitChanged
)
Q_PROPERTY(double maxSizeLimit
READ getMaxSizeLimit
WRITE setMaxSizeLimit
NOTIFY maxSizeLimitChanged
)
// Colors
Q_PROPERTY(Vec3f labelsColor
READ getLabelsColor
WRITE setLabelsColor
NOTIFY labelsColorChanged
)
Q_PROPERTY(Vec3f circlesColor
READ getCirclesColor
WRITE setCirclesColor
NOTIFY circlesColorChanged
)
Q_PROPERTY(Vec3f regionsColor
READ getRegionsColor
WRITE setRegionsColor
NOTIFY regionsColorChanged
)
Q_PROPERTY(Vec3f galaxiesColor
READ getGalaxyColor
WRITE setGalaxyColor
NOTIFY galaxiesColorChanged
)
Q_PROPERTY(Vec3f activeGalaxiesColor
READ getActiveGalaxyColor
WRITE setActiveGalaxyColor
NOTIFY activeGalaxiesColorChanged
)
Q_PROPERTY(Vec3f radioGalaxiesColor
READ getRadioGalaxyColor
WRITE setRadioGalaxyColor
NOTIFY radioGalaxiesColorChanged
)
Q_PROPERTY(Vec3f interactingGalaxiesColor
READ getInteractingGalaxyColor
WRITE setInteractingGalaxyColor
NOTIFY interactingGalaxiesColorChanged
)
Q_PROPERTY(Vec3f quasarsColor
READ getQuasarColor
WRITE setQuasarColor
NOTIFY quasarsColorChanged
)
Q_PROPERTY(Vec3f possibleQuasarsColor
READ getPossibleQuasarColor
WRITE setPossibleQuasarColor
NOTIFY possibleQuasarsColorChanged
)
Q_PROPERTY(Vec3f clustersColor
READ getClusterColor
WRITE setClusterColor
NOTIFY clustersColorChanged
)
Q_PROPERTY(Vec3f openClustersColor
READ getOpenClusterColor
WRITE setOpenClusterColor
NOTIFY openClustersColorChanged
)
Q_PROPERTY(Vec3f globularClustersColor
READ getGlobularClusterColor
WRITE setGlobularClusterColor
NOTIFY globularClustersColorChanged
)
Q_PROPERTY(Vec3f stellarAssociationsColor
READ getStellarAssociationColor
WRITE setStellarAssociationColor
NOTIFY stellarAssociationsColorChanged
)
Q_PROPERTY(Vec3f starCloudsColor
READ getStarCloudColor
WRITE setStarCloudColor
NOTIFY starCloudsColorChanged
)
Q_PROPERTY(Vec3f starsColor
READ getStarColor
WRITE setStarColor
NOTIFY starsColorChanged
)
Q_PROPERTY(Vec3f symbioticStarsColor
READ getSymbioticStarColor
WRITE setSymbioticStarColor
NOTIFY symbioticStarsColorChanged
)
Q_PROPERTY(Vec3f emissionLineStarsColor
READ getEmissionLineStarColor
WRITE setEmissionLineStarColor
NOTIFY emissionLineStarsColorChanged
)
Q_PROPERTY(Vec3f nebulaeColor
READ getNebulaColor
WRITE setNebulaColor
NOTIFY nebulaeColorChanged
)
Q_PROPERTY(Vec3f planetaryNebulaeColor
READ getPlanetaryNebulaColor
WRITE setPlanetaryNebulaColor
NOTIFY planetaryNebulaeColorChanged
)
Q_PROPERTY(Vec3f darkNebulaeColor
READ getDarkNebulaColor
WRITE setDarkNebulaColor
NOTIFY darkNebulaeColorChanged
)
Q_PROPERTY(Vec3f reflectionNebulaeColor
READ getReflectionNebulaColor
WRITE setReflectionNebulaColor
NOTIFY reflectionNebulaeColorChanged
)
Q_PROPERTY(Vec3f bipolarNebulaeColor
READ getBipolarNebulaColor
WRITE setBipolarNebulaColor
NOTIFY bipolarNebulaeColorChanged
)
Q_PROPERTY(Vec3f emissionNebulaeColor
READ getEmissionNebulaColor
WRITE setEmissionNebulaColor
NOTIFY emissionNebulaeColorChanged
)
Q_PROPERTY(Vec3f possiblePlanetaryNebulaeColor
READ getPossiblePlanetaryNebulaColor
WRITE setPossiblePlanetaryNebulaColor
NOTIFY possiblePlanetaryNebulaeColorChanged
)
Q_PROPERTY(Vec3f protoplanetaryNebulaeColor
READ getProtoplanetaryNebulaColor
WRITE setProtoplanetaryNebulaColor
NOTIFY protoplanetaryNebulaeColorChanged
)
Q_PROPERTY(Vec3f clusterWithNebulosityColor
READ getClusterWithNebulosityColor
WRITE setClusterWithNebulosityColor
NOTIFY clusterWithNebulosityColorChanged
)
Q_PROPERTY(Vec3f hydrogenRegionsColor
READ getHydrogenRegionColor
WRITE setHydrogenRegionColor
NOTIFY hydrogenRegionsColorChanged
)
Q_PROPERTY(Vec3f interstellarMatterColor
READ getInterstellarMatterColor
WRITE setInterstellarMatterColor
NOTIFY interstellarMatterColorChanged
)
Q_PROPERTY(Vec3f emissionObjectsColor
READ getEmissionObjectColor
WRITE setEmissionObjectColor
NOTIFY emissionObjectsColorChanged
)
Q_PROPERTY(Vec3f molecularCloudsColor
READ getMolecularCloudColor
WRITE setMolecularCloudColor
NOTIFY molecularCloudsColorChanged
)
Q_PROPERTY(Vec3f blLacObjectsColor
READ getBlLacObjectColor
WRITE setBlLacObjectColor
NOTIFY blLacObjectsColorChanged
)
Q_PROPERTY(Vec3f blazarsColor
READ getBlazarColor
WRITE setBlazarColor
NOTIFY blazarsColorChanged
)
Q_PROPERTY(Vec3f youngStellarObjectsColor
READ getYoungStellarObjectColor
WRITE setYoungStellarObjectColor
NOTIFY youngStellarObjectsColorChanged
)
Q_PROPERTY(Vec3f supernovaRemnantsColor
READ getSupernovaRemnantColor
WRITE setSupernovaRemnantColor
NOTIFY supernovaRemnantsColorChanged
)
Q_PROPERTY(Vec3f supernovaCandidatesColor
READ getSupernovaCandidateColor
WRITE setSupernovaCandidateColor
NOTIFY supernovaCandidatesColorChanged
)
Q_PROPERTY(Vec3f supernovaRemnantCandidatesColor
READ getSupernovaRemnantCandidateColor
WRITE setSupernovaRemnantCandidateColor
NOTIFY supernovaRemnantCandidatesColorChanged
)
Q_PROPERTY(Vec3f galaxyClustersColor
READ getGalaxyClusterColor
WRITE setGalaxyClusterColor
NOTIFY galaxyClustersColorChanged
)
public:
NebulaMgr();
virtual ~NebulaMgr() Q_DECL_OVERRIDE;
///////////////////////////////////////////////////////////////////////////
// Methods defined in the StelModule class
//! Initialize the NebulaMgr object.
//! - Load the font into the Nebula class, which is used to draw Nebula labels.
//! - Load the texture used to draw nebula locations into the Nebula class (for
//! those with no individual texture).
//! - Load the pointer texture.
//! - Set flags values from ini parser which relate to nebula display.
//! - call updateI18n() to translate names.
virtual void init() Q_DECL_OVERRIDE;
//! Draws all nebula objects.
virtual void draw(StelCore* core) Q_DECL_OVERRIDE;
//! Update state which is time dependent.
virtual void update(double deltaTime) Q_DECL_OVERRIDE {hintsFader.update(static_cast<int>(deltaTime*1000)); flagShow.update(static_cast<int>(deltaTime*1000));}
//! Determines the order in which the various modules are drawn.
virtual double getCallOrder(StelModuleActionName actionName) const Q_DECL_OVERRIDE;
///////////////////////////////////////////////////////////////////////////
// Methods defined in StelObjectModule class
//! Used to get a vector of objects which are near to some position.
//! @param v a vector representing the position in th sky around which to search for nebulae.
//! @param limitFov the field of view around the position v in which to search for nebulae.
//! @param core the StelCore to use for computations.
//! @return a list containing the nebulae located inside the limitFov circle around position v.
virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const Q_DECL_OVERRIDE;
//! Return the matching nebula object's pointer if exists or an "empty" StelObjectP.
//! @param nameI18n The case in-sensitive nebula name or NGC M catalog name : format can
//! be M31, M 31, NGC31, NGC 31
virtual StelObjectP searchByNameI18n(const QString& nameI18n) const Q_DECL_OVERRIDE;
//! Return the matching nebula if exists or Q_NULLPTR.
//! @param name The case in-sensitive standard program name
virtual StelObjectP searchByName(const QString& name) const Q_DECL_OVERRIDE;
virtual StelObjectP searchByID(const QString &id) const Q_DECL_OVERRIDE { return searchByName(id); }
//! Find and return the list of at most maxNbItem objects auto-completing the passed object English name.
//! @param objPrefix the case insensitive first letters of the searched object
//! @param maxNbItem the maximum number of returned object names
//! @param useStartOfWords the autofill mode for returned objects names
//! @return a list of matching object name by order of relevance, or an empty list if nothing match
virtual QStringList listMatchingObjects(const QString& objPrefix, int maxNbItem=5, bool useStartOfWords=false) const Q_DECL_OVERRIDE;
//! @note Loading deep-sky objects with the proper names only.
virtual QStringList listAllObjects(bool inEnglish) const Q_DECL_OVERRIDE;
virtual QStringList listAllObjectsByType(const QString& objType, bool inEnglish) const Q_DECL_OVERRIDE;
virtual QString getName() const Q_DECL_OVERRIDE { return "Deep-sky objects"; }
virtual QString getStelObjectType() const Q_DECL_OVERRIDE { return Nebula::NEBULA_TYPE; }
//! Compute the maximum magntiude for which hints will be displayed.
float computeMaxMagHint(const class StelSkyDrawer* skyDrawer) const;
//! Get designation for latest selected DSO with priority
//! @note using for bookmarks feature as example
//! @return a designation
QString getLatestSelectedDSODesignation() const;
//! Get designation for latest selected DSO with priority and ignorance of availability of catalogs
//! @note using for bookmarks feature as example
//! @return a designation
QString getLatestSelectedDSODesignationWIC() const;
//! Get the list of all deep-sky objects.
const QVector<NebulaP>& getAllDeepSkyObjects() const { return dsoArray; }
//! Get the list of deep-sky objects by type.
const QList<NebulaP> getDeepSkyObjectsByType(const QString& objType) const;
///////////////////////////////////////////////////////////////////////////
// Properties setters and getters
public slots:
void setCatalogFilters(int cflags);
int getCatalogFilters() const { return int(Nebula::catalogFilters); }
//! Activate all catalogs
void selectAllCatalogs();
//! Activate a useful selection of catalogs: M, NGC, IC
void selectStandardCatalogs();
//! Disable all catalogs
void selectNoneCatalogs();
//! retrieve configured catalogs from config.ini.
void loadCatalogFilters();
//! store configured catalogs into config.ini.
void storeCatalogFilters();
void setTypeFilters(int tflags);
int getTypeFilters() const { return int(Nebula::typeFilters); }
//! Set the default color used to draw the nebula symbols (default circles, etc).
//! @param c The color of the nebula symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setCirclesColor(Vec3f(0.6,0.8,0.0));
//! @endcode
void setCirclesColor(const Vec3f& c);
//! Get current value of the nebula circle color.
const Vec3f getCirclesColor(void) const;
//! Set the default color used to draw the region symbols (default dashed shape).
//! @param c The color of the region symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setRegionsColor(Vec3f(0.6,0.8,0.0));
//! @endcode
void setRegionsColor(const Vec3f& c);
//! Get current value of the region color.
const Vec3f getRegionsColor(void) const;
//! Set the color used to draw the galaxy symbols (ellipses).
//! @param c The color of the galaxy symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setGalaxyColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setGalaxyColor(const Vec3f& c);
//! Get current value of the galaxy symbol color.
const Vec3f getGalaxyColor(void) const;
//! Set the color used to draw the active galaxy symbols (ellipses).
//! @param c The color of the active galaxy symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setActiveGalaxyColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setActiveGalaxyColor(const Vec3f& c);
//! Get current value of the active galaxy symbol color.
const Vec3f getActiveGalaxyColor(void) const;
//! Set the color used to draw the interacting galaxy symbols (ellipses).
//! @param c The color of the interacting galaxy symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setInteractingGalaxyColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setInteractingGalaxyColor(const Vec3f& c);
//! Get current value of the interacting galaxy symbol color.
const Vec3f getInteractingGalaxyColor(void) const;
//! Set the color used to draw the radio galaxy symbols (ellipses).
//! @param c The color of the radio galaxy symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setRadioGalaxyColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setRadioGalaxyColor(const Vec3f& c);
//! Get current value of the radio galaxy symbol color.
const Vec3f getRadioGalaxyColor(void) const;
//! Set the color used to draw the quasars symbols (ellipses).
//! @param c The color of the quasars symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setQuasarColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setQuasarColor(const Vec3f& c);
//! Get current value of the quasar symbol color.
const Vec3f getQuasarColor(void) const;
//! Set the color used to draw the bright nebula symbols (emission nebula boxes, planetary nebulae circles).
//! @param c The color of the nebula symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setNebulaColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setNebulaColor(const Vec3f& c);
//! Get current value of the nebula circle color.
const Vec3f getNebulaColor(void) const;
//! Set the color used to draw the planetary nebulae symbols.
//! @param c The color of the planetary nebulae symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setPlanetaryNebulaColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setPlanetaryNebulaColor(const Vec3f& c);
//! Get current value of the planetary nebula circle color.
const Vec3f getPlanetaryNebulaColor(void) const;
//! Set the color used to draw the reflection nebulae symbols.
//! @param c The color of the reflection nebulae symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setReflectionNebulaColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setReflectionNebulaColor(const Vec3f& c);
//! Get current value of the reflection nebula circle color.
const Vec3f getReflectionNebulaColor(void) const;
//! Set the color used to draw the bipolar nebulae symbols.
//! @param c The color of the bipolar nebulae symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setBipolarNebulaColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setBipolarNebulaColor(const Vec3f& c);
//! Get current value of the bipolar nebula circle color.
const Vec3f getBipolarNebulaColor(void) const;
//! Set the color used to draw the emission nebulae symbols.
//! @param c The color of the emission nebulae symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setEmissionNebulaColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setEmissionNebulaColor(const Vec3f& c);
//! Get current value of the emission nebula circle color.
const Vec3f getEmissionNebulaColor(void) const;
//! Set the color used to draw the ionized hydrogen region symbols.
//! @param c The color of the ionized hydrogen region symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setHydrogenRegionColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setHydrogenRegionColor(const Vec3f& c);
//! Get current value of the hydrogen region symbol color.
const Vec3f getHydrogenRegionColor(void) const;
//! Set the color used to draw the supernova remnant symbols.
//! @param c The color of the supernova remnant symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setSupernovaRemnantColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setSupernovaRemnantColor(const Vec3f& c);
//! Get current value of the supernova remnant symbol color.
const Vec3f getSupernovaRemnantColor(void) const;
//! Set the color used to draw the supernova candidate symbols.
//! @param c The color of the supernova candidate symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setSupernovaCandidateColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setSupernovaCandidateColor(const Vec3f& c);
//! Get current value of the supernova candidate symbol color.
const Vec3f getSupernovaCandidateColor(void) const;
//! Set the color used to draw the supernova remnant candidate symbols.
//! @param c The color of the supernova remnant candidate symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setSupernovaRemnantCandidateColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setSupernovaRemnantCandidateColor(const Vec3f& c);
//! Get current value of the supernova remnant candidate symbol color.
const Vec3f getSupernovaRemnantCandidateColor(void) const;
//! Set the color used to draw the interstellar matter symbols.
//! @param c The color of the interstellar matter symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setInterstellarMatterColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setInterstellarMatterColor(const Vec3f& c);
//! Get current value of the interstellar matter symbol color.
const Vec3f getInterstellarMatterColor(void) const;
//! Set the color used to draw the dark nebula symbols (gray boxes).
//! @param c The color of the dark nebula symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setDarkNebulaColor(Vec3f(0.2,0.2,0.2));
//! @endcode
void setDarkNebulaColor(const Vec3f& c);
//! Get current value of the dark nebula color.
const Vec3f getDarkNebulaColor(void) const;
//! Set the color used to draw the cluster associated with nebulosity symbols.
//! @param c The color of the cluster associated with nebulosity symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setClusterWithNebulosityColor(Vec3f(0.2,0.2,0.2));
//! @endcode
void setClusterWithNebulosityColor(const Vec3f& c);
//! Get current value of the cluster associated with nebulosity color.
const Vec3f getClusterWithNebulosityColor(void) const;
//! Set the color used to draw the star cluster symbols (Open/Globular).
//! @param c The color of the cluster symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setClusterColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setClusterColor(const Vec3f& c);
//! Get current value of the star cluster symbol color.
const Vec3f getClusterColor(void) const;
//! Set the color used to draw the open star cluster symbols.
//! @param c The color of the open star cluster symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setOpenClusterColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setOpenClusterColor(const Vec3f& c);
//! Get current value of the open star cluster symbol color.
const Vec3f getOpenClusterColor(void) const;
//! Set the color used to draw the globular star cluster symbols.
//! @param c The color of the globular star cluster symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setGlobularClusterColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setGlobularClusterColor(const Vec3f& c);
//! Get current value of the globular star cluster symbol color.
const Vec3f getGlobularClusterColor(void) const;
//! Set the color used to draw the stellar associations symbols.
//! @param c The color of the stellar associations symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setStellarAssociationColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setStellarAssociationColor(const Vec3f& c);
//! Get current value of the stellar association symbol color.
const Vec3f getStellarAssociationColor(void) const;
//! Set the color used to draw the star clouds symbols.
//! @param c The color of the star clouds symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setStarCloudColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setStarCloudColor(const Vec3f& c);
//! Get current value of the star cloud symbol color.
const Vec3f getStarCloudColor(void) const;
//! Set the color used to draw the emission objects symbols.
//! @param c The color of the emission objects symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setEmissionObjectColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setEmissionObjectColor(const Vec3f& c);
//! Get current value of the emission object symbol color.
const Vec3f getEmissionObjectColor(void) const;
//! Set the color used to draw the BL Lac objects symbols.
//! @param c The color of the BL Lac objects symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setBlLacObjectColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setBlLacObjectColor(const Vec3f& c);
//! Get current value of the BL Lac object symbol color.
const Vec3f getBlLacObjectColor(void) const;
//! Set the color used to draw the blazars symbols.
//! @param c The color of the blazars symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setBlazarColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setBlazarColor(const Vec3f& c);
//! Get current value of the blazar symbol color.
const Vec3f getBlazarColor(void) const;
//! Set the color used to draw the molecular clouds symbols.
//! @param c The color of the molecular clouds symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setMolecularCloudColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setMolecularCloudColor(const Vec3f& c);
//! Get current value of the molecular cloud symbol color.
const Vec3f getMolecularCloudColor(void) const;
//! Set the color used to draw the young stellar objects symbols.
//! @param c The color of the young stellar objects symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setYoungStellarObjectColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setYoungStellarObjectColor(const Vec3f& c);
//! Get current value of the young stellar object symbol color.
const Vec3f getYoungStellarObjectColor(void) const;
//! Set the color used to draw the possible quasars symbols.
//! @param c The color of the possible quasars symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setPossibleQuasarColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setPossibleQuasarColor(const Vec3f& c);
//! Get current value of the possible quasar symbol color.
const Vec3f getPossibleQuasarColor(void) const;
//! Set the color used to draw the possible planetary nebulae symbols.
//! @param c The color of the possible planetary nebulae symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setPossiblePlanetaryNebulaColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setPossiblePlanetaryNebulaColor(const Vec3f& c);
//! Get current value of the possible planetary nebula symbol color.
const Vec3f getPossiblePlanetaryNebulaColor(void) const;
//! Set the color used to draw the protoplanetary nebulae symbols.
//! @param c The color of the protoplanetary nebulae symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setProtoplanetaryNebulaColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setProtoplanetaryNebulaColor(const Vec3f& c);
//! Get current value of the protoplanetary nebula symbol color.
const Vec3f getProtoplanetaryNebulaColor(void) const;
//! Set the color used to draw the stars symbols.
//! @param c The color of the stars symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setStarColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setStarColor(const Vec3f& c);
//! Get current value of the star symbol color.
const Vec3f getStarColor(void) const;
//! Set the color used to draw the symbiotic stars symbols.
//! @param c The color of the symbiotic stars symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setSymbioticStarColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setSymbioticStarColor(const Vec3f& c);
//! Get current value of the symbiotic star symbol color.
const Vec3f getSymbioticStarColor(void) const;
//! Set the color used to draw the emission-line stars symbols.
//! @param c The color of the emission-line stars symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setEmissionLineStarColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setEmissionLineStarColor(const Vec3f& c);
//! Get current value of the emission-line star symbol color.
const Vec3f getEmissionLineStarColor(void) const;
//! Set the color used to draw the cluster of galaxies symbols.
//! @param c The color of the cluster of galaxies symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setGalaxyClusterColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setGalaxyClusterColor(const Vec3f& c);
//! Get current value of the cluster of galaxies symbol color.
const Vec3f getGalaxyClusterColor(void) const;
//! Set how long it takes for nebula hints to fade in and out when turned on and off.
//! @param duration given in seconds
void setHintsFadeDuration(float duration) {hintsFader.setDuration(static_cast<int>(duration * 1000.f));}
//! Set flag for displaying Nebulae Hints.
void setFlagHints(bool b) { if (hintsFader!=b) { hintsFader=b; emit flagHintsDisplayedChanged(b);}}
//! Get flag for displaying Nebulae Hints.
bool getFlagHints(void) const {return hintsFader;}
//! Set whether hints (symbols) should be scaled according to nebula size.
void setHintsProportional(const bool proportional);
//! Get whether hints (symbols) are scaled according to nebula size.
bool getHintsProportional(void) const;
//! Set flag for usage outlines for big DSO instead their hints.
void setFlagOutlines(const bool flag);
//! Get flag for usage outlines for big DSO instead their hints.
bool getFlagOutlines(void) const;
//! Set flag for show an additional names for DSO
void setFlagAdditionalNames(const bool flag);
//! Get flag for show an additional names for DSO
bool getFlagAdditionalNames(void) const;
//! Set flag for usage designations of DSO for their labels instead common names.
void setDesignationUsage(const bool flag);
//! Get flag for usage designations of DSO for their labels instead common names.
bool getDesignationUsage(void) const;
//! Set whether hints (symbols) should be visible according to surface brightness value.
void setFlagSurfaceBrightnessUsage(const bool usage);
//! Get whether hints (symbols) are visible according to surface brightness value.
bool getFlagSurfaceBrightnessUsage(void) const;
//! Set flag for usage of measure unit mag/arcsec^2 to surface brightness value.
void setFlagSurfaceBrightnessArcsecUsage(const bool usage);
//! Get flag for usage of measure unit mag/arcsec^2 to surface brightness value.
bool getFlagSurfaceBrightnessArcsecUsage(void) const;
//! Set flag for usage of short notation for measure unit to surface brightness value.
void setFlagSurfaceBrightnessShortNotationUsage(const bool usage);
//! Get flag for usage of short notation for measure unit to surface brightness value.
bool getFlagSurfaceBrightnessShortNotationUsage(void) const;
//! Set flag for usage of size limits.
void setFlagSizeLimitsUsage(const bool usage);
//! Get flag for usage of size limits.
bool getFlagSizeLimitsUsage(void) const;
//! Set flag used to turn on and off Nebula rendering.
void setFlagShow(bool b) { flagShow = b; }
//! Get value of flag used to turn on and off Nebula rendering.
bool getFlagShow(void) const { return flagShow; }
//! Set flag used to turn on and off DSO type filtering.
void setFlagUseTypeFilters(const bool b);
//! Get value of flag used to turn on and off DSO type filtering.
bool getFlagUseTypeFilters(void) const;
//! Set the limit for min. angular size of displayed DSO.
//! @param s the angular size between 1 and 600 arcminutes
void setMinSizeLimit(double s);
//! Get the limit for min. angular size of displayed DSO.
//! @return the angular size between 1 and 600 arcminutes
double getMinSizeLimit(void) const;
//! Set the limit for max. angular size of displayed DSO.
//! @param s the angular size between 1 and 600 arcminutes
void setMaxSizeLimit(double s);
//! Get the limit for max. angular size of displayed DSO.
//! @return the angular size between 1 and 600 arcminutes
double getMaxSizeLimit(void) const;
//! Set the color used to draw nebula labels.
//! @param c The color of the nebula labels
//! @code
//! // example of usage in scripts
//! NebulaMgr.setLabelsColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setLabelsColor(const Vec3f& c);
//! Get current value of the nebula label color.
const Vec3f getLabelsColor(void) const;
//! Set the amount of nebulae labels. The real amount is also proportional with FOV.
//! The limit is set in function of the nebulae magnitude
//! @param a the amount between 0 and 10. 0 is no labels, 10 is maximum of labels
void setLabelsAmount(double a);
//! Get the amount of nebulae labels. The real amount is also proportional with FOV.
//! @return the amount between 0 and 10. 0 is no labels, 10 is maximum of labels
double getLabelsAmount(void) const;
//! Set the amount of nebulae hints. The real amount is also proportional with FOV.
//! The limit is set in function of the nebulae magnitude
//! @param f the amount between 0 and 10. 0 is no hints, 10 is maximum of hints
void setHintsAmount(double f);
//! Get the amount of nebulae labels. The real amount is also proportional with FOV.
//! @return the amount between 0 and 10. 0 is no hints, 10 is maximum of hints
double getHintsAmount(void) const;
signals:
//! Emitted when hints are toggled.
void flagHintsDisplayedChanged(bool b);
//! Emitted when filter types are changed.
void flagUseTypeFiltersChanged(bool b);
//! Emitted when the catalog filter is changed
void catalogFiltersChanged(int flags); // emits an int cast of Nebula::CatalogGroup
//! Emitted when the type filter is changed
void typeFiltersChanged(int flags); // emits an int cast of Nebula::TypeGroup
void hintsProportionalChanged(bool b);
void flagOutlinesDisplayedChanged(bool b);
void flagAdditionalNamesDisplayedChanged(bool b);
void designationUsageChanged(bool b);
void flagSurfaceBrightnessUsageChanged(bool b);
void flagSurfaceBrightnessArcsecUsageChanged(bool b);
void flagSurfaceBrightnessShortNotationUsageChanged(bool b);
void flagSizeLimitsUsageChanged(bool b);
void minSizeLimitChanged(double s);
void maxSizeLimitChanged(double s);
void labelsAmountChanged(double a);
void hintsAmountChanged(double f);
void labelsColorChanged(const Vec3f & color) const;
void circlesColorChanged(const Vec3f & color) const;
void regionsColorChanged(const Vec3f & color) const;
void galaxiesColorChanged(const Vec3f & color) const;
void activeGalaxiesColorChanged(const Vec3f & color) const;
void radioGalaxiesColorChanged(const Vec3f & color) const;
void interactingGalaxiesColorChanged(const Vec3f & color) const;
void quasarsColorChanged(const Vec3f & color) const;
void possibleQuasarsColorChanged(const Vec3f & color) const;
void clustersColorChanged(const Vec3f & color) const;
void openClustersColorChanged(const Vec3f & color) const;
void globularClustersColorChanged(const Vec3f & color) const;
void stellarAssociationsColorChanged(const Vec3f & color) const;
void starCloudsColorChanged(const Vec3f & color) const;
void starsColorChanged(const Vec3f & color) const;
void symbioticStarsColorChanged(const Vec3f & color) const;
void emissionLineStarsColorChanged(const Vec3f & color) const;
void nebulaeColorChanged(const Vec3f & color) const;
void planetaryNebulaeColorChanged(const Vec3f & color) const;
void darkNebulaeColorChanged(const Vec3f & color) const;
void reflectionNebulaeColorChanged(const Vec3f & color) const;
void bipolarNebulaeColorChanged(const Vec3f & color) const;
void emissionNebulaeColorChanged(const Vec3f & color) const;
void possiblePlanetaryNebulaeColorChanged(const Vec3f & color) const;
void protoplanetaryNebulaeColorChanged(const Vec3f & color) const;
void clusterWithNebulosityColorChanged(const Vec3f & color) const;
void hydrogenRegionsColorChanged(const Vec3f & color) const;
void interstellarMatterColorChanged(const Vec3f & color) const;
void emissionObjectsColorChanged(const Vec3f & color) const;
void molecularCloudsColorChanged(const Vec3f & color) const;
void blLacObjectsColorChanged(const Vec3f & color) const;
void blazarsColorChanged(const Vec3f & color) const;
void youngStellarObjectsColorChanged(const Vec3f & color) const;
void supernovaRemnantsColorChanged(const Vec3f & color) const;
void supernovaCandidatesColorChanged(const Vec3f & color) const;
void supernovaRemnantCandidatesColorChanged(const Vec3f & color) const;
void galaxyClustersColorChanged(const Vec3f & color) const;
private slots:
//! Update i18 names from English names according to passed translator.
//! The translation is done using gettext with translated strings defined
//! in translations.h
void updateI18n();
//! Called when the sky culture is updated.
//! Loads native names of deep-sky objects for a given sky culture.
//! @param skyCultureDir the name of the directory containing the sky culture to use.
void updateSkyCulture(const QString& skyCultureDir);
//! Connect from StelApp to reflect font size change.
void setFontSizeFromApp(int size){nebulaFont.setPixelSize(size);}
private:
//! Search for a nebula object by name, e.g. M83, NGC 1123, IC 1234.
NebulaP search(const QString& name);
//! Search the Nebulae by position
NebulaP search(const Vec3d& pos);
//! Load a set of nebula images.
//! Each sub-directory of the INSTALLDIR/nebulae directory contains a set of
//! nebula textures. The sub-directory is the setName. Each set has its
//! own nebula_textures.fab file and corresponding image files.
//! This function loads a set of textures.
//! @param setName a string which corresponds to the directory where the set resides
void loadNebulaSet(const QString& setName);
//! Draw a nice animated pointer around the object
void drawPointer(const StelCore* core, StelPainter& sPainter);
NebulaP searchDSO(unsigned int DSO) const;
NebulaP searchM(unsigned int M) const;
NebulaP searchNGC(unsigned int NGC) const;
NebulaP searchIC(unsigned int IC) const;
NebulaP searchC(unsigned int C) const;
NebulaP searchB(unsigned int B) const;
NebulaP searchSh2(unsigned int Sh2) const;
NebulaP searchVdB(unsigned int VdB) const;
NebulaP searchRCW(unsigned int RCW) const;
NebulaP searchLDN(unsigned int LDN) const;
NebulaP searchLBN(unsigned int LBN) const;
NebulaP searchCr(unsigned int Cr) const;
NebulaP searchMel(unsigned int Mel) const;
NebulaP searchPGC(unsigned int PGC) const;
NebulaP searchUGC(unsigned int UGC) const;
NebulaP searchCed(QString Ced) const;
NebulaP searchArp(unsigned int Arp) const;
NebulaP searchVV(unsigned int VV) const;
NebulaP searchPK(QString PK) const;
NebulaP searchPNG(QString PNG) const;
NebulaP searchSNRG(QString SNRG) const;
NebulaP searchACO(QString ACO) const;
NebulaP searchHCG(QString HCG) const;
NebulaP searchESO(QString ESO) const;
NebulaP searchVdBH(QString VdBH) const;
NebulaP searchDWB(unsigned int DWB) const;
NebulaP searchTr(unsigned int Tr) const;
NebulaP searchSt(unsigned int St) const;
NebulaP searchRu(unsigned int Ru) const;
NebulaP searchVdBHa(unsigned int VdBHa) const;
//! Return the matching nebula if exists or Q_NULLPTR.
//! @param name The case in-sensitive designation of deep-sky object
NebulaP searchByDesignation(const QString& designation) const;
// Load catalog of DSO
bool loadDSOCatalog(const QString& filename);