Stellarium  0.16.1
Nebula.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2002 Fabien Chereau
4  * Copyright (C) 2011 Alexander Wolf
5  * Copyright (C) 2015 Georg Zotti
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
20  */
21 
22 #ifndef _NEBULA_HPP_
23 #define _NEBULA_HPP_
24 
25 #include "StelObject.hpp"
26 #include "StelTranslator.hpp"
27 #include "StelTextureTypes.hpp"
28 
29 #include <QString>
30 
31 class StelPainter;
32 class QDataStream;
33 
34 // This only draws nebula icons. For the DSO images, see StelSkylayerMgr and StelSkyImageTile.
35 class Nebula : public StelObject
36 {
37 friend class NebulaMgr;
38 
39  //Required for the correct working of the Q_FLAGS macro (which requires a MOC pass)
40  Q_GADGET
41  Q_FLAGS(CatalogGroup)
42  Q_FLAGS(TypeGroup)
43  Q_ENUMS(NebulaType)
44 public:
45  static const QString NEBULA_TYPE;
46 
48  {
49  CatNGC = 0x00000001,
50  CatIC = 0x00000002,
51  CatM = 0x00000004,
52  CatC = 0x00000008,
53  CatB = 0x00000010,
54  CatSh2 = 0x00000020,
55  CatLBN = 0x00000040,
56  CatLDN = 0x00000080,
57  CatRCW = 0x00000100,
58  CatVdB = 0x00000200,
59  CatCr = 0x00000400,
60  CatMel = 0x00000800,
61  CatPGC = 0x00001000,
62  CatUGC = 0x00002000,
63  CatCed = 0x00004000,
64  CatArp = 0x00008000,
65  CatVV = 0x00010000,
66  CatPK = 0x00020000,
67  CatPNG = 0x00040000,
68  CatSNRG = 0x00080000,
69  CatACO = 0x00100000
70  };
71  Q_DECLARE_FLAGS(CatalogGroup, CatalogGroupFlags)
72 
74  {
75  TypeGalaxies = 0x00000001,
76  TypeActiveGalaxies = 0x00000002,
77  TypeInteractingGalaxies = 0x00000004,
78  TypeStarClusters = 0x00000008,
79  TypeHydrogenRegions = 0x00000010,
80  TypeBrightNebulae = 0x00000020,
81  TypeDarkNebulae = 0x00000040,
82  TypePlanetaryNebulae = 0x00000080,
83  TypeSupernovaRemnants = 0x00000100,
84  TypeGalaxyClusters = 0x00000200,
85  TypeOther = 0x00000400
86  };
87  Q_DECLARE_FLAGS(TypeGroup, TypeGroupFlags)
88 
89 
92 
95  {
96  NebGx = 0,
97  NebAGx = 1,
98  NebRGx = 2,
99  NebIGx = 3,
100  NebQSO = 4,
101  NebCl = 5,
102  NebOc = 6,
103  NebGc = 7,
104  NebSA = 8,
105  NebSC = 9,
106  NebN = 10,
107  NebPn = 11,
108  NebDn = 12,
109  NebRn = 13,
110  NebBn = 14,
111  NebEn = 15,
112  NebCn = 16,
113  NebHII = 17,
114  NebSNR = 18,
115  NebISM = 19,
116  NebEMO = 20,
117  NebBLL = 21,
118  NebBLA = 22,
119  NebMolCld = 23,
120  NebYSO = 24,
121  NebPossQSO = 25,
122  NebPossPN = 26,
123  NebPPN = 27,
124  NebStar = 28,
127  NebSNC = 31,
128  NebSNRC = 32,
129  NebGxCl = 33,
131  };
132 
133  Nebula();
134  ~Nebula();
135 
149  virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags) const;
157  virtual QVariantMap getInfoMap(const StelCore *core) const;
158  virtual QString getType() const {return NEBULA_TYPE;}
159  virtual QString getID() const {return getDSODesignation(); } //this depends on the currently shown catalog flags, should this be changed?
160  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return XYZ;}
161  virtual double getCloseViewFov(const StelCore* core = Q_NULLPTR) const;
162  virtual float getVMagnitude(const StelCore* core) const;
163  virtual float getSelectPriority(const StelCore* core) const;
164  virtual Vec3f getInfoColor() const;
165  virtual QString getNameI18n() const {return nameI18;}
166  virtual QString getEnglishName() const {return englishName;}
167  QString getEnglishAliases() const;
168  QString getI18nAliases() const;
169  virtual double getAngularSize(const StelCore*) const;
170  virtual SphericalRegionP getRegion() const {return pointRegion;}
171 
172  // Methods specific to Nebula
173  void setLabelColor(const Vec3f& v) {labelColor = v;}
174  void setCircleColor(const Vec3f& v) {circleColor = v;}
175 
178  QString getTypeString() const;
179 
180  NebulaType getDSOType() const {return nType;}
181 
184  QString getMorphologicalTypeString() const;
185 
186  float getSurfaceBrightness(const StelCore* core, bool arcsec=false) const;
187  float getSurfaceBrightnessWithExtinction(const StelCore* core, bool arcsec=false) const;
189  float getContrastIndex(const StelCore* core) const;
190 
193  float getSurfaceArea(void) const;
194 
195  void setProperName(QString name) { englishName = name; }
196  void addNameAlias(QString name) { englishAliases.append(name); }
197  void removeAllNames() { englishName=""; englishAliases.clear(); }
198 
201  QString getDSODesignation() const;
202 
203  bool objectInDisplayedCatalog() const;
204 
205 private:
206  friend struct DrawNebulaFuncObject;
207 
209  void translateName(const StelTranslator& trans)
210  {
211  nameI18 = trans.qtranslate(englishName);
212  nameI18Aliases.clear();
213  foreach(QString alias, englishAliases)
214  nameI18Aliases.append(trans.qtranslate(alias));
215  }
216 
217  void readDSO(QDataStream& in);
218 
219  void drawLabel(StelPainter& sPainter, float maxMagLabel) const;
220  void drawHints(StelPainter& sPainter, float maxMagHints) const;
221  void drawOutlines(StelPainter& sPainter, float maxMagHints) const;
222 
223  bool objectInDisplayedType() const;
224 
225  Vec3f getHintColor() const;
226  float getVisibilityLevelByMagnitude() const;
227 
230  QString getMorphologicalTypeDescription() const;
231 
232  unsigned int DSO_nb;
233  unsigned int M_nb; // Messier Catalog number
234  unsigned int NGC_nb; // New General Catalog number
235  unsigned int IC_nb; // Index Catalog number
236  unsigned int C_nb; // Caldwell Catalog number
237  unsigned int B_nb; // Barnard Catalog number (Dark Nebulae)
238  unsigned int Sh2_nb; // Sharpless Catalog number (Catalogue of HII Regions (Sharpless, 1959))
239  unsigned int VdB_nb; // Van den Bergh Catalog number (Catalogue of Reflection Nebulae (Van den Bergh, 1966))
240  unsigned int RCW_nb; // RCW Catalog number (H-α emission regions in Southern Milky Way (Rodgers+, 1960))
241  unsigned int LDN_nb; // LDN Catalog number (Lynds' Catalogue of Dark Nebulae (Lynds, 1962))
242  unsigned int LBN_nb; // LBN Catalog number (Lynds' Catalogue of Bright Nebulae (Lynds, 1965))
243  unsigned int Cr_nb; // Collinder Catalog number
244  unsigned int Mel_nb; // Melotte Catalog number
245  unsigned int PGC_nb; // PGC number (Catalog of galaxies)
246  unsigned int UGC_nb; // UGC number (The Uppsala General Catalogue of Galaxies)
247  unsigned int Arp_nb; // Arp number (Atlas of Peculiar Galaxies (Arp, 1966))
248  unsigned int VV_nb; // VV number (The Catalogue of Interacting Galaxies (Vorontsov-Velyaminov+, 2001))
249  QString Ced_nb; // Ced number (Cederblad Catalog of bright diffuse Galactic nebulae)
250  QString PK_nb; // PK number (Catalogue of Galactic Planetary Nebulae)
251  QString PNG_nb; // PN G number (Strasbourg-ESO Catalogue of Galactic Planetary Nebulae (Acker+, 1992))
252  QString SNRG_nb; // SNR G number (A catalogue of Galactic supernova remnants (Green, 2014))
253  QString ACO_nb; // ACO number (Rich Clusters of Galaxies (Abell+ 1989))
254  bool withoutID;
255  QString englishName; // English name
256  QStringList englishAliases; // English aliases
257  QString nameI18; // Nebula name
258  QStringList nameI18Aliases; // Nebula aliases
259  QString mTypeString; // Morphological type of object (as string)
260  float bMag; // B magnitude
261  float vMag; // V magnitude. For Dark Nebulae, opacity is stored here.
262  float majorAxisSize; // Major axis size in degrees
263  float minorAxisSize; // Minor axis size in degrees
264  int orientationAngle; // Orientation angle in degrees
265  float oDistance; // distance (Mpc for galaxies, kpc for other objects)
266  float oDistanceErr; // Error of distance (Mpc for galaxies, kpc for other objects)
267  float redshift;
268  float redshiftErr;
269  float parallax;
270  float parallaxErr;
271  Vec3d XYZ; // Cartesian equatorial position (J2000.0)
272  Vec3d XY; // Store temporary 2D position
273  NebulaType nType;
274 
275  SphericalRegionP pointRegion;
276 
277  static StelTextureSP texCircle; // The symbolic circle texture
278  static StelTextureSP texGalaxy; // Type 0
279  static StelTextureSP texOpenCluster; // Type 1
280  static StelTextureSP texGlobularCluster; // Type 2
281  static StelTextureSP texPlanetaryNebula; // Type 3
282  static StelTextureSP texDiffuseNebula; // Type 4
283  static StelTextureSP texDarkNebula; // Type 5
284  static StelTextureSP texOpenClusterWithNebulosity; // Type 7
285  static float hintsBrightness;
286 
287  static Vec3f labelColor; // The color of labels
288  static Vec3f circleColor; // The color of the symbolic circle texture (default marker; NebUnknown)
289  static Vec3f galaxyColor; // The color of galaxy marker texture (NebGx)
290  static Vec3f radioGalaxyColor; // The color of radio galaxy marker texture (NebRGx)
291  static Vec3f activeGalaxyColor; // The color of active galaxy marker texture (NebAGx)
292  static Vec3f interactingGalaxyColor; // The color of interacting galaxy marker texture (NebIGx)
293  static Vec3f quasarColor; // The color of quasar marker texture (NebQSO)
294  static Vec3f nebulaColor; // The color of nebula marker texture (NebN)
295  static Vec3f planetaryNebulaColor; // The color of planetary nebula marker texture (NebPn)
296  static Vec3f reflectionNebulaColor; // The color of reflection nebula marker texture (NebRn)
297  static Vec3f bipolarNebulaColor; // The color of bipolar nebula marker texture (NebBn)
298  static Vec3f emissionNebulaColor; // The color of emission nebula marker texture (NebEn)
299  static Vec3f darkNebulaColor; // The color of dark nebula marker texture (NebDn)
300  static Vec3f hydrogenRegionColor; // The color of hydrogen region marker texture (NebHII)
301  static Vec3f supernovaRemnantColor; // The color of supernova remnant marker texture (NebSNR)
302  static Vec3f interstellarMatterColor; // The color of interstellar matter marker texture (NebISM)
303  static Vec3f clusterWithNebulosityColor; // The color of cluster associated with nebulosity marker texture (NebCn)
304  static Vec3f clusterColor; // The color of star cluster marker texture (NebCl)
305  static Vec3f openClusterColor; // The color of open star cluster marker texture (NebOc)
306  static Vec3f globularClusterColor; // The color of globular star cluster marker texture (NebGc)
307  static Vec3f stellarAssociationColor; // The color of stellar association marker texture (NebSA)
308  static Vec3f starCloudColor; // The color of star cloud marker texture (NebSC)
309  static Vec3f emissionObjectColor; // The color of emission object marker texture (NebEMO)
310  static Vec3f blLacObjectColor; // The color of BL Lac object marker texture (NebBLL)
311  static Vec3f blazarColor; // The color of blazar marker texture (NebBLA)
312  static Vec3f molecularCloudColor; // The color of molecular cloud marker texture (NebMolCld)
313  static Vec3f youngStellarObjectColor; // The color of Young Stellar Object marker texture (NebYSO)
314  static Vec3f possibleQuasarColor; // The color of possible quasar marker texture (NebPossQSO)
315  static Vec3f possiblePlanetaryNebulaColor; // The color of possible planetary nebula marker texture (NebPossPN)
316  static Vec3f protoplanetaryNebulaColor; // The color of protoplanetary nebula marker texture (NebPPN)
317  static Vec3f starColor; // The color of star marker texture (NebStar)
318  static Vec3f symbioticStarColor; // The color of symbiotic star marker texture (NebSymbioticStar)
319  static Vec3f emissionLineStarColor; // The color of emission-line star marker texture (NebEmissionLineStar)
320  static Vec3f supernovaCandidateColor; // The color of supermova candidate marker texture (NebSNC)
321  static Vec3f supernovaRemnantCandidateColor; // The color of supermova remnant candidate marker texture (NebSNRC)
322  static Vec3f galaxyClusterColor; // The color of galaxy cluster marker texture (NebGxCl)
323 
324  static bool drawHintProportional; // scale hint with nebula size?
325  static bool surfaceBrightnessUsage;
326  static bool designationUsage;
327 
328  static bool flagUseTypeFilters;
329  static CatalogGroup catalogFilters;
330  static TypeGroup typeFilters;
331 
332  static bool flagUseArcsecSurfaceBrightness;
333  static bool flagUseShortNotationSurfaceBrightness;
334  static bool flagUseOutlines;
335 
336  std::vector<std::vector<Vec3f> *> outlineSegments;
337 };
338 
339 Q_DECLARE_OPERATORS_FOR_FLAGS(Nebula::CatalogGroup)
340 Q_DECLARE_OPERATORS_FOR_FLAGS(Nebula::TypeGroup)
341 
342 #endif // _NEBULA_HPP_
343 
HYPERLEDA. I. Catalog of galaxies (PGC)
Definition: Nebula.hpp:61
A catalogue of Hα-emission regions in the southern Milky Way (RCW)
Definition: Nebula.hpp:57
Interacting galaxy.
Definition: Nebula.hpp:99
virtual float getVMagnitude(const StelCore *core) const
Return object&#39;s apparent V magnitude as seen from observer, without including extinction.
Sharpless Catalogue (Sh 2)
Definition: Nebula.hpp:54
Bright Nebulae.
Definition: Nebula.hpp:80
Possible Planetary Nebula.
Definition: Nebula.hpp:122
Catalogue of Galactic Planetary Nebulae (PK)
Definition: Nebula.hpp:66
Protoplanetary Nebula.
Definition: Nebula.hpp:123
virtual float getSelectPriority(const StelCore *core) const
Return a priority value which is used to discriminate objects by priority As for magnitudes, the lower is the higher priority.
Galaxy Clusters.
Definition: Nebula.hpp:84
Class used to translate strings to any language.
virtual QString getType() const
Return object&#39;s type. It should be the name of the class.
Definition: Nebula.hpp:158
The Uppsala General Catalogue of Galaxies.
Definition: Nebula.hpp:62
virtual SphericalRegionP getRegion() const
Default implementation of the getRegion method.
Definition: Nebula.hpp:170
Cederblad Catalog of bright diffuse Galactic nebulae (Ced)
Definition: Nebula.hpp:63
Supernova Remnant Candidate.
Definition: Nebula.hpp:128
Possible Quasar.
Definition: Nebula.hpp:121
New General Catalogue (NGC)
Definition: Nebula.hpp:49
Reflection nebula.
Definition: Nebula.hpp:109
Interacting Galaxies.
Definition: Nebula.hpp:77
Quasar.
Definition: Nebula.hpp:100
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
Definition: StelObject.hpp:36
Van den Bergh Catalogue of reflection nebulae (VdB)
Definition: Nebula.hpp:58
Galaxies.
Definition: Nebula.hpp:75
Planetary nebula.
Definition: Nebula.hpp:107
A shared pointer on a SphericalRegion.
Define the StelTextureSP type.
Supernova remnant.
Definition: Nebula.hpp:114
float getSurfaceArea(void) const
Get the surface area.
float getContrastIndex(const StelCore *core) const
Compute an extended object&#39;s contrast index.
Messier Catalog (M)
Definition: Nebula.hpp:51
Interstellar matter.
Definition: Nebula.hpp:115
Atlas of Peculiar Galaxies (Arp)
Definition: Nebula.hpp:64
QString getMorphologicalTypeString() const
Get the printable morphological nebula Type.
virtual QString getID() const
Returns a unique identifier for this object.
Definition: Nebula.hpp:159
Cluster associated with nebulosity.
Definition: Nebula.hpp:112
Stellar association.
Definition: Nebula.hpp:104
Open star cluster.
Definition: Nebula.hpp:102
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
Emission nebula.
Definition: Nebula.hpp:111
virtual QString getNameI18n() const
Return translated object&#39;s name.
Definition: Nebula.hpp:165
Young Stellar Object.
Definition: Nebula.hpp:120
Other objects.
Definition: Nebula.hpp:85
A catalogue of Galactic supernova remnants (Green, 2014) (SNR G)
Definition: Nebula.hpp:68
static const CatalogGroupFlags AllCatalogs
A pre-defined set of specifiers for the catalogs filter.
Definition: Nebula.hpp:90
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Nebula.hpp:160
Radio galaxy.
Definition: Nebula.hpp:98
Hydrogen Regions.
Definition: Nebula.hpp:79
virtual QVariantMap getInfoMap(const StelCore *core) const
In addition to the entries from StelObject::getInfoMap(), Nebula objects provide. ...
Unknown type, catalog errors, "Unidentified Southern Objects" etc.
Definition: Nebula.hpp:130
Define some translation macros.
Caldwell Catalogue (C)
Definition: Nebula.hpp:52
virtual QString getEnglishName() const
Return object&#39;s name in english.
Definition: Nebula.hpp:166
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Nebula support the following InfoStringGroup flags:
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
Active galaxy.
Definition: Nebula.hpp:97
HII Region.
Definition: Nebula.hpp:113
Index Catalogue (IC)
Definition: Nebula.hpp:50
virtual double getAngularSize(const StelCore *) const
Return the angular radius of a circle containing the object as seen from the observer with the circle...
Star cloud.
Definition: Nebula.hpp:105
A nebula.
Definition: Nebula.hpp:106
Collinder Catalogue (Cr or Col)
Definition: Nebula.hpp:59
Dark Nebulae.
Definition: Nebula.hpp:81
Different Active Galaxies.
Definition: Nebula.hpp:76
Supernova Remnants.
Definition: Nebula.hpp:83
Star cluster.
Definition: Nebula.hpp:101
Emission object.
Definition: Nebula.hpp:116
Bipolar nebula.
Definition: Nebula.hpp:110
Lynds&#39; Catalogue of Bright Nebulae (LBN)
Definition: Nebula.hpp:55
QString getDSODesignation() const
Get designation for DSO (with priority: M, C, NGC, IC, B, Sh2, VdB, RCW, LDN, LBN, Cr, Mel, PGC, UGC, Ced)
TypeGroupFlags
Definition: Nebula.hpp:73
Molecular Cloud.
Definition: Nebula.hpp:119
Planetary Nebulae.
Definition: Nebula.hpp:82
Supernova Candidate.
Definition: Nebula.hpp:127
Barnard Catalogue (B)
Definition: Nebula.hpp:53
Dark Nebula.
Definition: Nebula.hpp:108
Galaxy.
Definition: Nebula.hpp:96
QString qtranslate(const QString &s, const QString &c=QString()) const
Translate input message and return it as a QString.
QString getTypeString() const
Get the printable nebula Type.
BL Lac object.
Definition: Nebula.hpp:117
Cluster of Galaxies.
Definition: Nebula.hpp:129
Blazar.
Definition: Nebula.hpp:118
A Catalog of Rich Clusters of Galaxies (Abell+ 1989) (ACO)
Definition: Nebula.hpp:69
Lynds&#39; Catalogue of Dark Nebulae (LDN)
Definition: Nebula.hpp:56
Symbiotic Star.
Definition: Nebula.hpp:125
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual double getCloseViewFov(const StelCore *core=Q_NULLPTR) const
Return the best FOV in degree to use for a close view of the object.
Globular star cluster, usually in the Milky Way Galaxy.
Definition: Nebula.hpp:103
Strasbourg-ESO Catalogue of Galactic Planetary Nebulae (Acker+, 1992) (PN G)
Definition: Nebula.hpp:67
Emission-line Star.
Definition: Nebula.hpp:126
Melotte Catalogue of Deep Sky Objects (Mel)
Definition: Nebula.hpp:60
Star Clusters.
Definition: Nebula.hpp:78
NebulaType
Nebula types.
Definition: Nebula.hpp:94
virtual Vec3f getInfoColor() const
Get a color used to display info about the object.
CatalogGroupFlags
Definition: Nebula.hpp:47
Manage a collection of nebulae.
Definition: NebulaMgr.hpp:48
Interacting galaxies catalogue by Vorontsov-Velyaminov (VV)
Definition: Nebula.hpp:65