Stellarium 0.14.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:
39  Nebula();
40  ~Nebula();
41 
55  virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags) const;
56  virtual QString getType() const {return "Nebula";}
57  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return XYZ;}
58  virtual double getCloseViewFov(const StelCore* core = NULL) const;
59  virtual float getVMagnitude(const StelCore* core) const;
60  virtual float getSelectPriority(const StelCore* core) const;
61  virtual Vec3f getInfoColor() const;
62  virtual QString getNameI18n() const {return nameI18;}
63  virtual QString getEnglishName() const {return englishName;}
64  virtual double getAngularSize(const StelCore*) const {return angularSize*0.5;}
65  virtual SphericalRegionP getRegion() const {return pointRegion;}
66 
67  // Methods specific to Nebula
68  void setLabelColor(const Vec3f& v) {labelColor = v;}
69  void setCircleColor(const Vec3f& v) {circleColor = v;}
70 
73  QString getTypeString() const;
74 
75  float getSurfaceBrightness(const StelCore* core) const;
76  float getSurfaceBrightnessWithExtinction(const StelCore* core) const;
77 
78 private:
79  friend struct DrawNebulaFuncObject;
80 
82  enum NebulaType
83  {
84  NebGx=0,
85  NebOc=1,
86  NebGc=2,
87  NebN=3,
88  NebPn=4,
89  NebDn=5,
90  NebIg=6,
91  NebCn=7,
92  NebUnknown=8,
93  NebHII=9,
94  NebRn=10,
95  NebHa=11
96  };
97 
99  enum HIIFormType
100  {
101  FormCir=1,
102  FormEll=2,
103  FormIrr=3
104  };
105 
107  enum HIIStructureType
108  {
109  StructureAmo=1,
110  StructureCon=2,
111  StructureFil=3
112  };
113 
115  enum HIIBrightnessType
116  {
117  Faintest=1,
118  Moderate=2,
119  Brightest=3
120  };
121 
123  enum HaBrightnessType
124  {
125  HaFaint=1,
126  HaMedium=2,
127  HaBright=3,
128  HaVeryBright=4
129  };
130 
132  void translateName(const StelTranslator& trans) {nameI18 = trans.qtranslate(englishName);}
133 
134  bool readNGC(char *record);
135  void readNGC(QDataStream& in);
136  bool readBarnard(QString record);
137  bool readSharpless(QString record);
138  bool readVandenBergh(QString record);
139  bool readRCW(QString record);
140  bool readLDN(QString record);
141  bool readLBN(QString record);
142 
143  void drawLabel(StelPainter& sPainter, float maxMagLabel);
144  void drawHints(StelPainter& sPainter, float maxMagHints);
145 
146 
148  QString getHIIFormTypeString() const;
150  QString getHIIStructureTypeString() const;
152  QString getHIIBrightnessTypeString() const;
154  QString getHaBrightnessTypeString() const;
155 
156  unsigned int M_nb; // Messier Catalog number
157  unsigned int NGC_nb; // New General Catalog number
158  unsigned int IC_nb; // Index Catalog number
159  unsigned int C_nb; // Caldwell Catalog number
160  unsigned int B_nb; // Barnard Catalog number (Dark Nebulae)
161  unsigned int Sh2_nb; // Sharpless Catalog number (Catalogue of HII Regions (Sharpless, 1959))
162  unsigned int VdB_nb; // Van den Bergh Catalog number (Catalogue of Reflection Nebulae (Van den Bergh, 1966))
163  unsigned int RCW_nb; // RCW Catalog number (H-α emission regions in Southern Milky Way (Rodgers+, 1960))
164  unsigned int LDN_nb; // LDN Catalog number (Lynds' Catalogue of Dark Nebulae (Lynds, 1962))
165  unsigned int LBN_nb; // LBN Catalog number (Lynds' Catalogue of Bright Nebulae (Lynds, 1965))
166  unsigned int Cr_nb; // Collinder Catalog number
167  unsigned int Mel_nb; // Melotte Catalog number
168  QString englishName; // English name
169  QString nameI18; // Nebula name
170  float mag; // Apparent magnitude. For Dark Nebulae, opacity is stored here.
171  float angularSize; // Angular size in degree
172  Vec3d XYZ; // Cartesian equatorial position (J2000.0)
173  Vec3d XY; // Store temporary 2D position
174  NebulaType nType;
175 
176  HIIFormType formType;
177  HIIStructureType structureType;
178  HIIBrightnessType brightnessType;
179  HaBrightnessType rcwBrightnessType;
180 
181  int brightnessClass;
182 
183  SphericalRegionP pointRegion;
184 
185  static StelTextureSP texCircle; // The symbolic circle texture
186  static StelTextureSP texGalaxy; // Type 0
187  static StelTextureSP texOpenCluster; // Type 1
188  static StelTextureSP texGlobularCluster; // Type 2
189  static StelTextureSP texPlanetaryNebula; // Type 3
190  static StelTextureSP texDiffuseNebula; // Type 4
191  static StelTextureSP texDarkNebula; // Type 5
192  static StelTextureSP texOpenClusterWithNebulosity; // Type 7
193  static float hintsBrightness;
194 
195  static Vec3f labelColor, circleColor;
196  static float circleScale; // Define the scaling of the hints circle
197  static bool drawHintProportional; // scale hint with nebula size?
198 };
199 
200 #endif // _NEBULA_HPP_
201 
virtual float getVMagnitude(const StelCore *core) const
Return object's apparent V magnitude as seen from observer, without including extinction.
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:56
virtual SphericalRegionP getRegion() const
Default implementation of the getRegion method.
Definition: Nebula.hpp:65
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
Definition: StelObject.hpp:36
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.
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
virtual QString getNameI18n() const
Return translated object's name.
Definition: Nebula.hpp:62
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Nebula.hpp:57
Define some translation macros.
virtual QString getEnglishName() const
Return object's name in english.
Definition: Nebula.hpp:63
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
virtual double getAngularSize(const StelCore *) const
Return the angular radius of a circle containing the object as seen from the observer with the circle...
Definition: Nebula.hpp:64
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.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual Vec3f getInfoColor() const
Get a color used to display info about the object.
Manage a collection of nebulae.
Definition: NebulaMgr.hpp:48