Stellarium 0.14.3
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  float mass;
38  float radius;
39  float period;
40  float semiAxis;
41  float eccentricity;
42  float inclination;
43  float angleDistance;
44  int discovered;
45  QString pclass;
46  int EqTemp;
47  int ESI;
49 
50 class StelPainter;
51 
57 
58 class Exoplanet : public StelObject
59 {
60  friend class Exoplanets;
61 public:
63  Exoplanet(const QVariantMap& map);
64  ~Exoplanet();
65 
68  QVariantMap getMap(void);
69 
71  virtual QString getType(void) const
72  {
73  return "Exoplanet";
74  }
75 
76  virtual float getSelectPriority(const StelCore* core) const;
77 
81  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
82  virtual Vec3f getInfoColor(void) const;
83  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
84  {
85  return XYZ;
86  }
88  virtual float getVMagnitude(const StelCore* core) const;
90  virtual double getAngularSize(const StelCore* core) const;
92  virtual QString getNameI18n(void) const;
94  virtual QString getEnglishName(void) const
95  {
96  return designation;
97  }
98 
99  bool isDiscovered(const StelCore* core);
100 
101  void update(double deltaTime);
102 
103  int getCountExoplanets(void) const
104  {
105  return EPCount;
106  }
107  int getCountHabitableExoplanets(void) const
108  {
109  return PHEPCount;
110  }
111 
112 private:
113 
114  QString getPlanetaryClassI18n(QString ptype) const;
115 
116  bool initialized;
117 
118  Vec3d XYZ; // holds J2000 position
119 
120  static StelTextureSP hintTexture;
121  static StelTextureSP markerTexture;
122  static Vec3f habitableExoplanetMarkerColor;
123  static Vec3f exoplanetMarkerColor;
124  static bool distributionMode;
125  static bool timelineMode;
126  static bool habitableMode;
127 
128  void draw(StelCore* core, StelPainter *painter);
129 
130  int EPCount;
131  int PHEPCount;
132 
134  QString designation;
135  float RA;
136  float DE;
137  float distance;
138  QString stype;
139  float smass;
140  float smetal;
141  float Vmag;
142  float sradius;
143  int effectiveTemp;
144  bool hasHabitableExoplanets;
145  QList<exoplanetData> exoplanets;
146 
147  LinearFader labelsFader;
148 
149 };
150 
151 #endif // _EXOPLANET_HPP_
float period
Exoplanet radius (Rjup)
Definition: Exoplanet.hpp:39
int EqTemp
Exoplanet classification from host star spectral type (F, G, K, M), habitable zone (hot...
Definition: Exoplanet.hpp:46
QVariantMap getMap(void)
Get a QVariantMap which describes the exoplanet.
float radius
Exoplanet mass (Mjup)
Definition: Exoplanet.hpp:38
float inclination
Exoplanet orbit eccentricity.
Definition: Exoplanet.hpp:42
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:47
virtual QString getType(void) const
Get the type of object.
Definition: Exoplanet.hpp:71
Main class of the Exoplanets plugin.
Definition: Exoplanets.hpp:70
A exoplanet object represents one pulsar on the sky.
Definition: Exoplanet.hpp:58
float eccentricity
Exoplanet orbit semi-major axis (AU)
Definition: Exoplanet.hpp:41
float angleDistance
Exoplanet orbit inclination.
Definition: Exoplanet.hpp:43
virtual QString getEnglishName(void) const
Get the english name.
Definition: Exoplanet.hpp:94
virtual double getAngularSize(const StelCore *core) const
Get the angular size of pulsar.
int discovered
Exoplanet angle distance.
Definition: Exoplanet.hpp:44
QSharedPointer< StelTexture > StelTextureSP
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:200
QString pclass
Exoplanet discovered year.
Definition: Exoplanet.hpp:45
float semiAxis
Exoplanet period (days)
Definition: Exoplanet.hpp:40
virtual QString getNameI18n(void) const
Get the localized name of pulsar.
float mass
Exoplanet name.
Definition: Exoplanet.hpp:37