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