Stellarium  0.90.0
Exoplanet.hpp
1 /*
2  * Copyright (C) 2012 Alexander Wolf
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17  */
18 
19 #ifndef _EXOPLANET_HPP_
20 #define _EXOPLANET_HPP_ 1
21 
22 #include <QVariant>
23 #include <QString>
24 #include <QStringList>
25 #include <QFont>
26 #include <QList>
27 #include <QDateTime>
28 
29 #include "StelObject.hpp"
30 #include "StelTextureTypes.hpp"
31 #include "StelFader.hpp"
32 
34 typedef struct
35 {
36  QString planetName;
37  QString planetProperName;
38  float mass;
39  float radius;
40  float period;
41  float semiAxis;
42  float eccentricity;
43  float inclination;
44  float angleDistance;
45  int discovered;
46  QString pclass;
47  int EqTemp;
48  int ESI;
50 
51 class StelPainter;
52 
58 
59 class Exoplanet : public StelObject
60 {
61  friend class Exoplanets;
62 public:
63  static const QString EXOPLANET_TYPE;
64 
66  Exoplanet(const QVariantMap& map);
67  ~Exoplanet();
68 
71  QVariantMap getMap(void) const;
72 
74  virtual QString getType(void) const
75  {
76  return EXOPLANET_TYPE;
77  }
78 
79  virtual QString getID(void) const
80  {
81  return getDesignation();
82  }
83 
84  virtual float getSelectPriority(const StelCore* core) const;
85 
89  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
98  virtual QVariantMap getInfoMap(const StelCore *core) const;
99  virtual Vec3f getInfoColor(void) const;
100  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
101  {
102  return XYZ;
103  }
105  virtual float getVMagnitude(const StelCore* core) const;
107  virtual double getAngularSize(const StelCore* core) const;
109  virtual QString getNameI18n(void) const;
111  virtual QString getEnglishName(void) const;
112 
113  QString getDesignation(void) const;
114  QStringList getExoplanetsEnglishNames(void) const;
115  QStringList getExoplanetsNamesI18n(void) const;
116  QStringList getExoplanetsDesignations(void) const;
117 
118  bool isDiscovered(const StelCore* core);
119 
120  void update(double deltaTime);
121 
122  int getCountExoplanets(void) const
123  {
124  return EPCount;
125  }
126  int getCountHabitableExoplanets(void) const
127  {
128  return PHEPCount;
129  }
130 
131  QList<double> getData(int mode)
132  {
133  switch(mode)
134  {
135  case 1:
136  return semiAxisList;
137  break;
138  case 2:
139  return massList;
140  break;
141  case 3:
142  return radiusList;
143  break;
144  case 4:
145  return periodList;
146  break;
147  case 5:
148  return angleDistanceList;
149  break;
150  case 6:
151  return effectiveTempHostStarList;
152  break;
153  case 7:
154  return yearDiscoveryList;
155  break;
156  case 8:
157  return metallicityHostStarList;
158  break;
159  case 9:
160  return vMagHostStarList;
161  break;
162  case 10:
163  return raHostStarList;
164  break;
165  case 11:
166  return decHostStarList;
167  break;
168  case 12:
169  return distanceHostStarList;
170  break;
171  case 13:
172  return massHostStarList;
173  break;
174  case 14:
175  return radiusHostStarList;
176  break;
177  default:
178  return eccentricityList;
179  }
180  }
181 
182 private:
183 
184  QString getPlanetaryClassI18n(QString ptype) const;
185 
186  bool initialized;
187 
188  Vec3d XYZ; // holds J2000 position
189 
190  static StelTextureSP markerTexture;
191  static Vec3f habitableExoplanetMarkerColor;
192  static Vec3f exoplanetMarkerColor;
193  static bool distributionMode;
194  static bool timelineMode;
195  static bool habitableMode;
196  static bool showDesignations;
197 
198  void draw(StelCore* core, StelPainter *painter);
199 
200  int EPCount;
201  int PHEPCount;
202 
204  QString designation;
205  QString starProperName;
206  float RA;
207  float DE;
208  float distance;
209  QString stype;
210  float smass;
211  float smetal;
212  float Vmag;
213  float sradius;
214  int effectiveTemp;
215  bool hasHabitableExoplanets;
216  QList<exoplanetData> exoplanets;
217 
218  QStringList englishNames, translatedNames, exoplanetDesignations;
219 
220  QList<double> eccentricityList, semiAxisList, massList, radiusList, periodList, angleDistanceList,
221  effectiveTempHostStarList, yearDiscoveryList, metallicityHostStarList, vMagHostStarList,
222  raHostStarList, decHostStarList, distanceHostStarList, massHostStarList, radiusHostStarList;
223 
224  LinearFader labelsFader;
225 };
226 
227 #endif // _EXOPLANET_HPP_
QVariantMap getMap(void) const
Get a QVariantMap which describes the exoplanet.
QString planetProperName
Exoplanet designation.
Definition: Exoplanet.hpp:37
float period
Exoplanet radius (Rjup)
Definition: Exoplanet.hpp:40
Implementation of StelFader which implements a linear transition.
Definition: StelFader.hpp:77
int EqTemp
Exoplanet classification from host star spectral type (F, G, K, M), habitable zone (hot...
Definition: Exoplanet.hpp:47
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
Definition: StelObject.hpp:36
Define the StelTextureSP type.
float radius
Exoplanet mass (Mjup)
Definition: Exoplanet.hpp:39
float inclination
Exoplanet orbit eccentricity.
Definition: Exoplanet.hpp:43
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Get an HTML string to describe the object.
Exoplanet(const QVariantMap &map)
int ESI
Exoplanet equilibrium temperature in kelvins (K) assuming a 0.3 bond albedo (Earth = 255 K)...
Definition: Exoplanet.hpp:48
virtual QString getType(void) const
Get the type of object.
Definition: Exoplanet.hpp:74
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual QVariantMap getInfoMap(const StelCore *core) const
Return a map like StelObject, but with a few extra tags also available in getMap().
virtual Vec3f getInfoColor(void) const
Get a color used to display info about the object.
Main class of the Exoplanets plugin.
Definition: Exoplanets.hpp:70
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Exoplanet.hpp:100
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
A exoplanet object represents one pulsar on the sky.
Definition: Exoplanet.hpp:59
virtual void update(double deltaTime)
Update the module with respect to the time.
float eccentricity
Exoplanet orbit semi-major axis (AU)
Definition: Exoplanet.hpp:42
float angleDistance
Exoplanet orbit inclination.
Definition: Exoplanet.hpp:44
virtual QString getID(void) const
Returns a unique identifier for this object.
Definition: Exoplanet.hpp:79
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
virtual QString getEnglishName(void) const
Get the english name.
virtual double getAngularSize(const StelCore *core) const
Get the angular size of pulsar.
int discovered
Exoplanet angle distance.
Definition: Exoplanet.hpp:45
A templatized 3d vector compatible with openGL.
Definition: VecMath.hpp:33
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual float getVMagnitude(const StelCore *core) const
Get the visual magnitude.
int getCountHabitableExoplanets(void) const
Get count of potentially habitable exoplanets from catalog.
Definition: Exoplanets.hpp:307
QString pclass
Exoplanet discovered year.
Definition: Exoplanet.hpp:46
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.
float semiAxis
Exoplanet period (days)
Definition: Exoplanet.hpp:41
virtual QString getNameI18n(void) const
Get the localized name of pulsar.
float mass
Exoplanet proper name.
Definition: Exoplanet.hpp:38