Stellarium 0.12.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 "StelProjectorType.hpp"
31 #include "StelFader.hpp"
32 
33 typedef struct
34 {
35  QString planetName;
36  float mass;
37  float radius;
38  float period;
39  float semiAxis;
40  float eccentricity;
41  float inclination;
42  float angleDistance;
43  int discovered;
45 
46 
51 
52 class Exoplanet : public StelObject
53 {
54  friend class Exoplanets;
55 public:
57  Exoplanet(const QVariantMap& map);
58  ~Exoplanet();
59 
62  QVariantMap getMap(void);
63 
65  virtual QString getType(void) const
66  {
67  return "Exoplanet";
68  }
69  virtual float getSelectPriority(const StelCore* core) const;
70 
74  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
75  virtual Vec3f getInfoColor(void) const;
76  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
77  {
78  return XYZ;
79  }
81  virtual float getVMagnitude(const StelCore* core, bool withExtinction=false) const;
83  virtual double getAngularSize(const StelCore* core) const;
85  virtual QString getNameI18n(void) const;
87  virtual QString getEnglishName(void) const
88  {
89  return designation;
90  }
91 
92  bool isDiscovered(const StelCore* core);
93 
94  void update(double deltaTime);
95 
96 private:
97  bool initialized;
98 
99  Vec3d XYZ; // holds J2000 position
100 
101  void draw(StelCore* core, class StelRenderer* renderer, StelProjectorP projector,
102  class StelTextureNew* markerTexture);
103 
105  QString designation;
106  float RA;
107  float DE;
108  float distance;
109  QString stype;
110  float smass;
111  float smetal;
112  float Vmag;
113  float sradius;
114  int effectiveTemp;
115  QList<exoplanetData> exoplanets;
116 
117  LinearFader labelsFader;
118 
119 };
120 
121 #endif // _EXOPLANET_HPP_