Stellarium 0.90.0
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:
46  {
47  CatNGC = 0x00000001,
48  CatIC = 0x00000002,
49  CatM = 0x00000004,
50  CatC = 0x00000008,
51  CatB = 0x00000010,
52  CatSh2 = 0x00000020,
53  CatLBN = 0x00000040,
54  CatLDN = 0x00000080,
55  CatRCW = 0x00000100,
56  CatVdB = 0x00000200,
57  CatCr = 0x00000400,
58  CatMel = 0x00000800,
59  CatPGC = 0x00001000,
60  CatUGC = 0x00002000,
61  CatCed = 0x00004000
62  };
63  Q_DECLARE_FLAGS(CatalogGroup, CatalogGroupFlags)
64 
66  {
67  TypeGalaxies = 0x00000001,
68  TypeActiveGalaxies = 0x00000002,
69  TypeInteractingGalaxies = 0x00000004,
70  TypeStarClusters = 0x00000008,
71  TypeHydrogenRegions = 0x00000010,
72  TypeBrightNebulae = 0x00000020,
73  TypeDarkNebulae = 0x00000040,
74  TypePlanetaryNebulae = 0x00000080,
75  TypeSupernovaRemnants = 0x00000100,
76  TypeOther = 0x00000200
77  };
78  Q_DECLARE_FLAGS(TypeGroup, TypeGroupFlags)
79 
80 
83 
86  {
87  NebGx = 0,
88  NebAGx = 1,
89  NebRGx = 2,
90  NebIGx = 3,
91  NebQSO = 4,
92  NebCl = 5,
93  NebOc = 6,
94  NebGc = 7,
95  NebSA = 8,
96  NebSC = 9,
97  NebN = 10,
98  NebPn = 11,
99  NebDn = 12,
100  NebRn = 13,
101  NebBn = 14,
102  NebEn = 15,
103  NebCn = 16,
104  NebHII = 17,
105  NebSNR = 18,
106  NebISM = 19,
107  NebEMO = 20,
108  NebBLL = 21,
109  NebBLA = 22,
110  NebMolCld = 23,
111  NebYSO = 24,
112  NebPossQSO = 25,
113  NebPossPN = 26,
114  NebPPN = 27,
115  NebStar = 28,
117  };
118 
119  Nebula();
120  ~Nebula();
121 
135  virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags) const;
136  virtual QString getType() const {return "Nebula";}
137  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return XYZ;}
138  virtual double getCloseViewFov(const StelCore* core = NULL) const;
139  virtual float getVMagnitude(const StelCore* core) const;
140  virtual float getSelectPriority(const StelCore* core) const;
141  virtual Vec3f getInfoColor() const;
142  virtual QString getNameI18n() const {return nameI18;}
143  virtual QString getEnglishName() const {return englishName;}
144  QString getEnglishAliases() const;
145  QString getI18nAliases() const;
146  virtual double getAngularSize(const StelCore*) const;
147  virtual SphericalRegionP getRegion() const {return pointRegion;}
148 
149  // Methods specific to Nebula
150  void setLabelColor(const Vec3f& v) {labelColor = v;}
151  void setCircleColor(const Vec3f& v) {circleColor = v;}
152 
155  QString getTypeString() const;
156 
157  NebulaType getDSOType() const {return nType;}
158 
161  QString getMorphologicalTypeString() const;
162 
163  float getSurfaceBrightness(const StelCore* core) const;
164  float getSurfaceBrightnessWithExtinction(const StelCore* core) const;
165 
168  float getSurfaceArea(void) const;
169 
170  void setProperName(QString name) { englishName = name; }
171  void addNameAlias(QString name) { englishAliases.append(name); }
172  void removeAllNames() { englishName=""; englishAliases.clear(); }
173 
176  QString getDSODesignation();
177 
178 private:
179  friend struct DrawNebulaFuncObject;
180 
182  void translateName(const StelTranslator& trans)
183  {
184  nameI18 = trans.qtranslate(englishName);
185  nameI18Aliases.clear();
186  foreach(QString alias, englishAliases)
187  nameI18Aliases.append(trans.qtranslate(alias));
188  }
189 
190  void readDSO(QDataStream& in);
191 
192  void drawLabel(StelPainter& sPainter, float maxMagLabel);
193  void drawHints(StelPainter& sPainter, float maxMagHints);
194 
195  bool objectInDisplayedType() const;
196 
199  QString getMorphologicalTypeDescription() const;
200 
201  unsigned int DSO_nb;
202  unsigned int M_nb; // Messier Catalog number
203  unsigned int NGC_nb; // New General Catalog number
204  unsigned int IC_nb; // Index Catalog number
205  unsigned int C_nb; // Caldwell Catalog number
206  unsigned int B_nb; // Barnard Catalog number (Dark Nebulae)
207  unsigned int Sh2_nb; // Sharpless Catalog number (Catalogue of HII Regions (Sharpless, 1959))
208  unsigned int VdB_nb; // Van den Bergh Catalog number (Catalogue of Reflection Nebulae (Van den Bergh, 1966))
209  unsigned int RCW_nb; // RCW Catalog number (H-α emission regions in Southern Milky Way (Rodgers+, 1960))
210  unsigned int LDN_nb; // LDN Catalog number (Lynds' Catalogue of Dark Nebulae (Lynds, 1962))
211  unsigned int LBN_nb; // LBN Catalog number (Lynds' Catalogue of Bright Nebulae (Lynds, 1965))
212  unsigned int Cr_nb; // Collinder Catalog number
213  unsigned int Mel_nb; // Melotte Catalog number
214  unsigned int PGC_nb; // PGC number (Catalog of galaxies)
215  unsigned int UGC_nb; // UGC number (The Uppsala General Catalogue of Galaxies)
216  QString Ced_nb; // Ced number (Cederblad Catalog of bright diffuse Galactic nebulae)
217  QString englishName; // English name
218  QStringList englishAliases; // English aliases
219  QString nameI18; // Nebula name
220  QStringList nameI18Aliases; // Nebula aliases
221  QString mTypeString; // Morphological type of object (as string)
222  float bMag; // B magnitude
223  float vMag; // V magnitude. For Dark Nebulae, opacity is stored here.
224  float majorAxisSize; // Major axis size in degrees
225  float minorAxisSize; // Minor axis size in degrees
226  int orientationAngle; // Orientation angle in degrees
227  float oDistance; // distance (Mpc for galaxies, kpc for other objects)
228  float oDistanceErr; // Error of distance (Mpc for galaxies, kpc for other objects)
229  float redshift;
230  float redshiftErr;
231  float parallax;
232  float parallaxErr;
233  Vec3d XYZ; // Cartesian equatorial position (J2000.0)
234  Vec3d XY; // Store temporary 2D position
235  NebulaType nType;
236 
237  SphericalRegionP pointRegion;
238 
239  static StelTextureSP texCircle; // The symbolic circle texture
240  static StelTextureSP texGalaxy; // Type 0
241  static StelTextureSP texOpenCluster; // Type 1
242  static StelTextureSP texGlobularCluster; // Type 2
243  static StelTextureSP texPlanetaryNebula; // Type 3
244  static StelTextureSP texDiffuseNebula; // Type 4
245  static StelTextureSP texDarkNebula; // Type 5
246  static StelTextureSP texOpenClusterWithNebulosity; // Type 7
247  static float hintsBrightness;
248 
249  static Vec3f labelColor; // The color of labels
250  static Vec3f circleColor; // The color of the symbolic circle texture (default marker; NebUnknown)
251  static Vec3f galaxyColor; // The color of galaxy marker texture (NebGx)
252  static Vec3f radioGalaxyColor; // The color of radio galaxy marker texture (NebRGx)
253  static Vec3f activeGalaxyColor; // The color of active galaxy marker texture (NebAGx)
254  static Vec3f interactingGalaxyColor; // The color of interacting galaxy marker texture (NebIGx)
255  static Vec3f quasarColor; // The color of quasar marker texture (NebQSO)
256  static Vec3f nebulaColor; // The color of nebula marker texture (NebN)
257  static Vec3f planetaryNebulaColor; // The color of planetary nebula marker texture (NebPn)
258  static Vec3f reflectionNebulaColor; // The color of reflection nebula marker texture (NebRn)
259  static Vec3f bipolarNebulaColor; // The color of bipolar nebula marker texture (NebBn)
260  static Vec3f emissionNebulaColor; // The color of emission nebula marker texture (NebEn)
261  static Vec3f darkNebulaColor; // The color of dark nebula marker texture (NebDn)
262  static Vec3f hydrogenRegionColor; // The color of hydrogen region marker texture (NebHII)
263  static Vec3f supernovaRemnantColor; // The color of supernova remnant marker texture (NebSNR)
264  static Vec3f interstellarMatterColor; // The color of interstellar matter marker texture (NebISM)
265  static Vec3f clusterWithNebulosityColor; // The color of cluster associated with nebulosity marker texture (NebCn)
266  static Vec3f clusterColor; // The color of star cluster marker texture (NebCl)
267  static Vec3f openClusterColor; // The color of open star cluster marker texture (NebOc)
268  static Vec3f globularClusterColor; // The color of globular star cluster marker texture (NebGc)
269  static Vec3f stellarAssociationColor; // The color of stellar association marker texture (NebSA)
270  static Vec3f starCloudColor; // The color of star cloud marker texture (NebSC)
271  static Vec3f emissionObjectColor; // The color of emission object marker texture (NebEMO)
272  static Vec3f blLacObjectColor; // The color of BL Lac object marker texture (NebBLL)
273  static Vec3f blazarColor; // The color of blazar marker texture (NebBLA)
274  static Vec3f molecularCloudColor; // The color of molecular cloud marker texture (NebMolCld)
275  static Vec3f youngStellarObjectColor; // The color of Young Stellar Object marker texture (NebYSO)
276  static Vec3f possibleQuasarColor; // The color of possible quasar marker texture (NebPossQSO)
277  static Vec3f possiblePlanetaryNebulaColor; // The color of possible planetary nebula marker texture (NebPossPN)
278  static Vec3f protoplanetaryNebulaColor; // The color of protoplanetary nebula marker texture (NebPPN)
279  static Vec3f starColor; // The color of star marker texture (NebStar)
280 
281  static bool drawHintProportional; // scale hint with nebula size?
282  static bool surfaceBrightnessUsage;
283  static bool designationUsage;
284 
285  static bool flagUseTypeFilters;
286  static CatalogGroup catalogFilters;
287  static TypeGroup typeFilters;
288 };
289 
290 Q_DECLARE_OPERATORS_FOR_FLAGS(Nebula::CatalogGroup)
291 Q_DECLARE_OPERATORS_FOR_FLAGS(Nebula::TypeGroup)
292 
293 #endif // _NEBULA_HPP_
294 
HYPERLEDA. I. Catalog of galaxies (PGC)
Definition: Nebula.hpp:59
A catalogue of Hα-emission regions in the southern Milky Way (RCW)
Definition: Nebula.hpp:55
Interacting galaxy.
Definition: Nebula.hpp:90
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:52
Bright Nebulae.
Definition: Nebula.hpp:72
Possible Planetary Nebula.
Definition: Nebula.hpp:113
Protoplanetary Nebula.
Definition: Nebula.hpp:114
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.
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:136
The Uppsala General Catalogue of Galaxies.
Definition: Nebula.hpp:60
virtual SphericalRegionP getRegion() const
Default implementation of the getRegion method.
Definition: Nebula.hpp:147
Cederblad Catalog of bright diffuse Galactic nebulae (Ced)
Definition: Nebula.hpp:61
Possible Quasar.
Definition: Nebula.hpp:112
New General Catalogue (NGC)
Definition: Nebula.hpp:47
Reflection nebula.
Definition: Nebula.hpp:100
Interacting Galaxies.
Definition: Nebula.hpp:69
Quasar.
Definition: Nebula.hpp:91
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:56
Galaxies.
Definition: Nebula.hpp:67
Planetary nebula.
Definition: Nebula.hpp:98
A shared pointer on a SphericalRegion.
virtual double getCloseViewFov(const StelCore *core=NULL) const
Return the best FOV in degree to use for a close view of the object.
Define the StelTextureSP type.
Supernova remnant.
Definition: Nebula.hpp:105
float getSurfaceArea(void) const
Get the surface area.
Messier Catalog (M)
Definition: Nebula.hpp:49
Interstellar matter.
Definition: Nebula.hpp:106
QString getMorphologicalTypeString() const
Get the printable morphological nebula Type.
Cluster associated with nebulosity.
Definition: Nebula.hpp:103
Stellar association.
Definition: Nebula.hpp:95
Open star cluster.
Definition: Nebula.hpp:93
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
Emission nebula.
Definition: Nebula.hpp:102
virtual QString getNameI18n() const
Return translated object&#39;s name.
Definition: Nebula.hpp:142
Young Stellar Object.
Definition: Nebula.hpp:111
Other objects.
Definition: Nebula.hpp:76
static const CatalogGroupFlags AllCatalogs
A pre-defined set of specifiers for the catalogs filter.
Definition: Nebula.hpp:81
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Nebula.hpp:137
Radio galaxy.
Definition: Nebula.hpp:89
Hydrogen Regions.
Definition: Nebula.hpp:71
Unknown type, catalog errors, "Unidentified Southern Objects" etc.
Definition: Nebula.hpp:116
Define some translation macros.
Caldwell Catalogue (C)
Definition: Nebula.hpp:50
virtual QString getEnglishName() const
Return object&#39;s name in english.
Definition: Nebula.hpp:143
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:88
HII Region.
Definition: Nebula.hpp:104
Index Catalogue (IC)
Definition: Nebula.hpp:48
virtual double getAngularSize(const StelCore *) const
Return the angular radius of a circle containing the object as seen from the observer with the circle...
QString getDSODesignation()
Get designation for DSO (with priority: M, C, NGC, IC, B, Sh2, VdB, RCW, LDN, LBN, Cr, Mel, PGC, UGC, Ced)
Star cloud.
Definition: Nebula.hpp:96
A nebula.
Definition: Nebula.hpp:97
Collinder Catalogue (Cr or Col)
Definition: Nebula.hpp:57
Dark Nebulae.
Definition: Nebula.hpp:73
Different Active Galaxies.
Definition: Nebula.hpp:68
Supernova Remnants.
Definition: Nebula.hpp:75
Star cluster.
Definition: Nebula.hpp:92
Emission object.
Definition: Nebula.hpp:107
Bipolar nebula.
Definition: Nebula.hpp:101
Lynds&#39; Catalogue of Bright Nebulae (LBN)
Definition: Nebula.hpp:53
TypeGroupFlags
Definition: Nebula.hpp:65
Molecular Cloud.
Definition: Nebula.hpp:110
Planetary Nebulae.
Definition: Nebula.hpp:74
Barnard Catalogue (B)
Definition: Nebula.hpp:51
Dark Nebula.
Definition: Nebula.hpp:99
Galaxy.
Definition: Nebula.hpp:87
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:108
Blazar.
Definition: Nebula.hpp:109
Lynds&#39; Catalogue of Dark Nebulae (LDN)
Definition: Nebula.hpp:54
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
Globular star cluster, usually in the Milky Way Galaxy.
Definition: Nebula.hpp:94
Melotte Catalogue of Deep Sky Objects (Mel)
Definition: Nebula.hpp:58
Star Clusters.
Definition: Nebula.hpp:70
NebulaType
Nebula types.
Definition: Nebula.hpp:85
virtual Vec3f getInfoColor() const
Get a color used to display info about the object.
CatalogGroupFlags
Definition: Nebula.hpp:45
Manage a collection of nebulae.
Definition: NebulaMgr.hpp:48