Stellarium 0.15.2
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;
143  virtual QVariantMap getInfoMap(const StelCore *core) const;
144  virtual QString getType() const {return "Nebula";}
145  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return XYZ;}
146  virtual double getCloseViewFov(const StelCore* core = NULL) const;
147  virtual float getVMagnitude(const StelCore* core) const;
148  virtual float getSelectPriority(const StelCore* core) const;
149  virtual Vec3f getInfoColor() const;
150  virtual QString getNameI18n() const {return nameI18;}
151  virtual QString getEnglishName() const {return englishName;}
152  QString getEnglishAliases() const;
153  QString getI18nAliases() const;
154  virtual double getAngularSize(const StelCore*) const;
155  virtual SphericalRegionP getRegion() const {return pointRegion;}
156 
157  // Methods specific to Nebula
158  void setLabelColor(const Vec3f& v) {labelColor = v;}
159  void setCircleColor(const Vec3f& v) {circleColor = v;}
160 
163  QString getTypeString() const;
164 
165  NebulaType getDSOType() const {return nType;}
166 
169  QString getMorphologicalTypeString() const;
170 
171  float getSurfaceBrightness(const StelCore* core) const;
172  float getSurfaceBrightnessWithExtinction(const StelCore* core) const;
173 
176  float getSurfaceArea(void) const;
177 
178  void setProperName(QString name) { englishName = name; }
179  void addNameAlias(QString name) { englishAliases.append(name); }
180  void removeAllNames() { englishName=""; englishAliases.clear(); }
181 
184  QString getDSODesignation();
185 
186 private:
187  friend struct DrawNebulaFuncObject;
188 
190  void translateName(const StelTranslator& trans)
191  {
192  nameI18 = trans.qtranslate(englishName);
193  nameI18Aliases.clear();
194  foreach(QString alias, englishAliases)
195  nameI18Aliases.append(trans.qtranslate(alias));
196  }
197 
198  void readDSO(QDataStream& in);
199 
200  void drawLabel(StelPainter& sPainter, float maxMagLabel);
201  void drawHints(StelPainter& sPainter, float maxMagHints);
202 
203  bool objectInDisplayedType() const;
204 
207  QString getMorphologicalTypeDescription() const;
208 
209  unsigned int DSO_nb;
210  unsigned int M_nb; // Messier Catalog number
211  unsigned int NGC_nb; // New General Catalog number
212  unsigned int IC_nb; // Index Catalog number
213  unsigned int C_nb; // Caldwell Catalog number
214  unsigned int B_nb; // Barnard Catalog number (Dark Nebulae)
215  unsigned int Sh2_nb; // Sharpless Catalog number (Catalogue of HII Regions (Sharpless, 1959))
216  unsigned int VdB_nb; // Van den Bergh Catalog number (Catalogue of Reflection Nebulae (Van den Bergh, 1966))
217  unsigned int RCW_nb; // RCW Catalog number (H-α emission regions in Southern Milky Way (Rodgers+, 1960))
218  unsigned int LDN_nb; // LDN Catalog number (Lynds' Catalogue of Dark Nebulae (Lynds, 1962))
219  unsigned int LBN_nb; // LBN Catalog number (Lynds' Catalogue of Bright Nebulae (Lynds, 1965))
220  unsigned int Cr_nb; // Collinder Catalog number
221  unsigned int Mel_nb; // Melotte Catalog number
222  unsigned int PGC_nb; // PGC number (Catalog of galaxies)
223  unsigned int UGC_nb; // UGC number (The Uppsala General Catalogue of Galaxies)
224  QString Ced_nb; // Ced number (Cederblad Catalog of bright diffuse Galactic nebulae)
225  QString englishName; // English name
226  QStringList englishAliases; // English aliases
227  QString nameI18; // Nebula name
228  QStringList nameI18Aliases; // Nebula aliases
229  QString mTypeString; // Morphological type of object (as string)
230  float bMag; // B magnitude
231  float vMag; // V magnitude. For Dark Nebulae, opacity is stored here.
232  float majorAxisSize; // Major axis size in degrees
233  float minorAxisSize; // Minor axis size in degrees
234  int orientationAngle; // Orientation angle in degrees
235  float oDistance; // distance (Mpc for galaxies, kpc for other objects)
236  float oDistanceErr; // Error of distance (Mpc for galaxies, kpc for other objects)
237  float redshift;
238  float redshiftErr;
239  float parallax;
240  float parallaxErr;
241  Vec3d XYZ; // Cartesian equatorial position (J2000.0)
242  Vec3d XY; // Store temporary 2D position
243  NebulaType nType;
244 
245  SphericalRegionP pointRegion;
246 
247  static StelTextureSP texCircle; // The symbolic circle texture
248  static StelTextureSP texGalaxy; // Type 0
249  static StelTextureSP texOpenCluster; // Type 1
250  static StelTextureSP texGlobularCluster; // Type 2
251  static StelTextureSP texPlanetaryNebula; // Type 3
252  static StelTextureSP texDiffuseNebula; // Type 4
253  static StelTextureSP texDarkNebula; // Type 5
254  static StelTextureSP texOpenClusterWithNebulosity; // Type 7
255  static float hintsBrightness;
256 
257  static Vec3f labelColor; // The color of labels
258  static Vec3f circleColor; // The color of the symbolic circle texture (default marker; NebUnknown)
259  static Vec3f galaxyColor; // The color of galaxy marker texture (NebGx)
260  static Vec3f radioGalaxyColor; // The color of radio galaxy marker texture (NebRGx)
261  static Vec3f activeGalaxyColor; // The color of active galaxy marker texture (NebAGx)
262  static Vec3f interactingGalaxyColor; // The color of interacting galaxy marker texture (NebIGx)
263  static Vec3f quasarColor; // The color of quasar marker texture (NebQSO)
264  static Vec3f nebulaColor; // The color of nebula marker texture (NebN)
265  static Vec3f planetaryNebulaColor; // The color of planetary nebula marker texture (NebPn)
266  static Vec3f reflectionNebulaColor; // The color of reflection nebula marker texture (NebRn)
267  static Vec3f bipolarNebulaColor; // The color of bipolar nebula marker texture (NebBn)
268  static Vec3f emissionNebulaColor; // The color of emission nebula marker texture (NebEn)
269  static Vec3f darkNebulaColor; // The color of dark nebula marker texture (NebDn)
270  static Vec3f hydrogenRegionColor; // The color of hydrogen region marker texture (NebHII)
271  static Vec3f supernovaRemnantColor; // The color of supernova remnant marker texture (NebSNR)
272  static Vec3f interstellarMatterColor; // The color of interstellar matter marker texture (NebISM)
273  static Vec3f clusterWithNebulosityColor; // The color of cluster associated with nebulosity marker texture (NebCn)
274  static Vec3f clusterColor; // The color of star cluster marker texture (NebCl)
275  static Vec3f openClusterColor; // The color of open star cluster marker texture (NebOc)
276  static Vec3f globularClusterColor; // The color of globular star cluster marker texture (NebGc)
277  static Vec3f stellarAssociationColor; // The color of stellar association marker texture (NebSA)
278  static Vec3f starCloudColor; // The color of star cloud marker texture (NebSC)
279  static Vec3f emissionObjectColor; // The color of emission object marker texture (NebEMO)
280  static Vec3f blLacObjectColor; // The color of BL Lac object marker texture (NebBLL)
281  static Vec3f blazarColor; // The color of blazar marker texture (NebBLA)
282  static Vec3f molecularCloudColor; // The color of molecular cloud marker texture (NebMolCld)
283  static Vec3f youngStellarObjectColor; // The color of Young Stellar Object marker texture (NebYSO)
284  static Vec3f possibleQuasarColor; // The color of possible quasar marker texture (NebPossQSO)
285  static Vec3f possiblePlanetaryNebulaColor; // The color of possible planetary nebula marker texture (NebPossPN)
286  static Vec3f protoplanetaryNebulaColor; // The color of protoplanetary nebula marker texture (NebPPN)
287  static Vec3f starColor; // The color of star marker texture (NebStar)
288 
289  static bool drawHintProportional; // scale hint with nebula size?
290  static bool surfaceBrightnessUsage;
291  static bool designationUsage;
292 
293  static bool flagUseTypeFilters;
294  static CatalogGroup catalogFilters;
295  static TypeGroup typeFilters;
296 };
297 
298 Q_DECLARE_OPERATORS_FOR_FLAGS(Nebula::CatalogGroup)
299 Q_DECLARE_OPERATORS_FOR_FLAGS(Nebula::TypeGroup)
300 
301 #endif // _NEBULA_HPP_
302 
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:144
The Uppsala General Catalogue of Galaxies.
Definition: Nebula.hpp:60
virtual SphericalRegionP getRegion() const
Default implementation of the getRegion method.
Definition: Nebula.hpp:155
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:150
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:145
Radio galaxy.
Definition: Nebula.hpp:89
Hydrogen Regions.
Definition: Nebula.hpp:71
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: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:151
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