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 
131 private:
132  friend struct DrawNebulaFuncObject;
133 
135  enum NebulaType
136  {
137  NebGx = 0,
138  NebAGx = 1,
139  NebRGx = 2,
140  NebIGx = 3,
141  NebQSO = 4,
142  NebCl = 5,
143  NebOc = 6,
144  NebGc = 7,
145  NebSA = 8,
146  NebSC = 9,
147  NebN = 10,
148  NebPn = 11,
149  NebDn = 12,
150  NebRn = 13,
151  NebBn = 14,
152  NebEn = 15,
153  NebCn = 16,
154  NebHII = 17,
155  NebSNR = 18,
156  NebISM = 19,
157  NebEMO = 20,
158  NebBLL = 21,
159  NebBLA = 22,
160  NebMolCld = 23,
161  NebYSO = 24,
162  NebPossQSO = 25,
163  NebPossPN = 26,
164  NebPPN = 27,
165  NebStar = 28,
166  NebUnknown = 29
167  };
168 
170  void translateName(const StelTranslator& trans) {nameI18 = trans.qtranslate(englishName);}
171 
172  void readDSO(QDataStream& in);
173 
174  void drawLabel(StelPainter& sPainter, float maxMagLabel);
175  void drawHints(StelPainter& sPainter, float maxMagHints);
176 
177  bool objectInDisplayedType() const;
178 
181  QString getMorphologicalTypeDescription() const;
182 
183  unsigned int DSO_nb;
184  unsigned int M_nb; // Messier Catalog number
185  unsigned int NGC_nb; // New General Catalog number
186  unsigned int IC_nb; // Index Catalog number
187  unsigned int C_nb; // Caldwell Catalog number
188  unsigned int B_nb; // Barnard Catalog number (Dark Nebulae)
189  unsigned int Sh2_nb; // Sharpless Catalog number (Catalogue of HII Regions (Sharpless, 1959))
190  unsigned int VdB_nb; // Van den Bergh Catalog number (Catalogue of Reflection Nebulae (Van den Bergh, 1966))
191  unsigned int RCW_nb; // RCW Catalog number (H-α emission regions in Southern Milky Way (Rodgers+, 1960))
192  unsigned int LDN_nb; // LDN Catalog number (Lynds' Catalogue of Dark Nebulae (Lynds, 1962))
193  unsigned int LBN_nb; // LBN Catalog number (Lynds' Catalogue of Bright Nebulae (Lynds, 1965))
194  unsigned int Cr_nb; // Collinder Catalog number
195  unsigned int Mel_nb; // Melotte Catalog number
196  unsigned int PGC_nb; // PGC number (Catalog of galaxies)
197  unsigned int UGC_nb; // UGC number (The Uppsala General Catalogue of Galaxies)
198  QString Ced_nb; // Ced number (Cederblad Catalog of bright diffuse Galactic nebulae)
199  QString englishName; // English name
200  QString nameI18; // Nebula name
201  QString mTypeString; // Morphological type of object (as string)
202  float bMag; // B magnitude
203  float vMag; // V magnitude. For Dark Nebulae, opacity is stored here.
204  float majorAxisSize; // Major axis size in degrees
205  float minorAxisSize; // Minor axis size in degrees
206  int orientationAngle; // Orientation angle in degrees
207  float oDistance; // distance (Mpc for galaxies, kpc for other objects)
208  float oDistanceErr; // Error of distance (Mpc for galaxies, kpc for other objects)
209  float redshift;
210  float redshiftErr;
211  float parallax;
212  float parallaxErr;
213  Vec3d XYZ; // Cartesian equatorial position (J2000.0)
214  Vec3d XY; // Store temporary 2D position
215  NebulaType nType;
216 
217  SphericalRegionP pointRegion;
218 
219  static StelTextureSP texCircle; // The symbolic circle texture
220  static StelTextureSP texGalaxy; // Type 0
221  static StelTextureSP texOpenCluster; // Type 1
222  static StelTextureSP texGlobularCluster; // Type 2
223  static StelTextureSP texPlanetaryNebula; // Type 3
224  static StelTextureSP texDiffuseNebula; // Type 4
225  static StelTextureSP texDarkNebula; // Type 5
226  static StelTextureSP texOpenClusterWithNebulosity; // Type 7
227  static float hintsBrightness;
228 
229  static Vec3f labelColor, circleColor, galaxyColor, radioGalaxyColor, activeGalaxyColor, interactingGalaxyColor,
230  brightNebulaColor, darkNebulaColor, hydrogenRegionColor, supernovaRemnantColor, clusterColor;
231  static float circleScale; // Define the scaling of the hints circle
232  static bool drawHintProportional; // scale hint with nebula size?
233  static bool surfaceBrightnessUsage;
234 
235  static bool flagUsageTypeFilter;
236  static CatalogGroup catalogFilters;
237  static TypeGroup typeFilters;
238 };
239 
240 Q_DECLARE_OPERATORS_FOR_FLAGS(Nebula::CatalogGroup)
241 Q_DECLARE_OPERATORS_FOR_FLAGS(Nebula::TypeGroup)
242 
243 #endif // _NEBULA_HPP_
244 
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
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...
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