Stellarium 0.15.2
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:
64  Exoplanet(const QVariantMap& map);
65  ~Exoplanet();
66 
69  QVariantMap getMap(void) const;
70 
72  virtual QString getType(void) const
73  {
74  return "Exoplanet";
75  }
76 
77  virtual float getSelectPriority(const StelCore* core) const;
78 
82  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
91  virtual QVariantMap getInfoMap(const StelCore *core) const;
92  virtual Vec3f getInfoColor(void) const;
93  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
94  {
95  return XYZ;
96  }
98  virtual float getVMagnitude(const StelCore* core) const;
100  virtual double getAngularSize(const StelCore* core) const;
102  virtual QString getNameI18n(void) const;
104  virtual QString getEnglishName(void) const;
105 
106  QString getDesignation(void) const;
107  QStringList getExoplanetsEnglishNames(void) const;
108  QStringList getExoplanetsNamesI18n(void) const;
109  QStringList getExoplanetsDesignations(void) const;
110 
111  bool isDiscovered(const StelCore* core);
112 
113  void update(double deltaTime);
114 
115  int getCountExoplanets(void) const
116  {
117  return EPCount;
118  }
119  int getCountHabitableExoplanets(void) const
120  {
121  return PHEPCount;
122  }
123 
124  QList<double> getData(int mode)
125  {
126  switch(mode)
127  {
128  case 1:
129  return semiAxisList;
130  break;
131  case 2:
132  return massList;
133  break;
134  case 3:
135  return radiusList;
136  break;
137  case 4:
138  return periodList;
139  break;
140  case 5:
141  return angleDistanceList;
142  break;
143  default:
144  return eccentricityList;
145  }
146  }
147 
148 private:
149 
150  QString getPlanetaryClassI18n(QString ptype) const;
151 
152  bool initialized;
153 
154  Vec3d XYZ; // holds J2000 position
155 
156  static StelTextureSP markerTexture;
157  static Vec3f habitableExoplanetMarkerColor;
158  static Vec3f exoplanetMarkerColor;
159  static bool distributionMode;
160  static bool timelineMode;
161  static bool habitableMode;
162  static bool showDesignations;
163 
164  void draw(StelCore* core, StelPainter *painter);
165 
166  int EPCount;
167  int PHEPCount;
168 
170  QString designation;
171  QString starProperName;
172  float RA;
173  float DE;
174  float distance;
175  QString stype;
176  float smass;
177  float smetal;
178  float Vmag;
179  float sradius;
180  int effectiveTemp;
181  bool hasHabitableExoplanets;
182  QList<exoplanetData> exoplanets;
183 
184  QStringList englishNames, translatedNames, exoplanetDesignations;
185 
186  QList<double> eccentricityList, semiAxisList, massList, radiusList, periodList, angleDistanceList;
187 
188  LinearFader labelsFader;
189 };
190 
191 #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:72
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:93
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 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:277
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