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