Stellarium 0.15.2
Supernova.hpp
1 /*
2  * Copyright (C) 2011 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 _SUPERNOVA_HPP_
20 #define _SUPERNOVA_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 
33 class StelPainter;
34 
40 
41 class Supernova : public StelObject
42 {
43  friend class Supernovae;
44 public:
46  Supernova(const QVariantMap& map);
47  ~Supernova();
48 
58  QVariantMap getMap(void) const;
59 
60  virtual QString getType(void) const
61  {
62  return "Supernova";
63  }
64 
68  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
75  virtual QVariantMap getInfoMap(const StelCore *core) const;
76  virtual Vec3f getInfoColor(void) const;
77  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
78  {
79  return XYZ;
80  }
81  virtual float getVMagnitude(const StelCore* core) const;
82  virtual double getAngularSize(const StelCore* core) const;
83  virtual QString getNameI18n(void) const;
84  virtual QString getEnglishName(void) const;
85 
86  void update(double deltaTime);
87 
88 private:
89  bool initialized;
90 
91  Vec3d XYZ; // holds J2000 position
92 
93  static StelTextureSP hintTexture;
94 
95  void draw(StelCore* core, StelPainter& painter);
96 
97  // Supernova
98  QString designation;
99  QString sntype;
100  float maxMagnitude;
101  double peakJD;
102  double snra;
103  double snde;
104  QString note;
105  double distance;
106 
107  LinearFader labelsFader;
108 
109  QString getMaxBrightnessDate(const double JD) const;
110 };
111 
112 #endif // _SUPERNOVA_HPP_
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Supernova.hpp:77
Implementation of StelFader which implements a linear transition.
Definition: StelFader.hpp:77
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Get an HTML string to describe the object.
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
Definition: StelObject.hpp:36
virtual QString getType(void) const
Return object&#39;s type. It should be the name of the class.
Definition: Supernova.hpp:60
virtual QString getNameI18n(void) const
Return translated object&#39;s name.
Define the StelTextureSP type.
virtual QVariantMap getInfoMap(const StelCore *core) const
Return a map like StelObject::getInfoMap(), but with a few extra tags also available in getMap()...
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual QString getEnglishName(void) const
Return object&#39;s name in english.
Supernova(const QVariantMap &map)
A Supernova object represents one supernova on the sky.
Definition: Supernova.hpp:41
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
Main class of the Historical Supernovae plugin.
Definition: Supernovae.hpp:68
virtual float getVMagnitude(const StelCore *core) const
Return object&#39;s apparent V magnitude as seen from observer, without including extinction.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
virtual void update(double)
Update the module with respect to the time.
Definition: Supernovae.hpp:89
QVariantMap getMap(void) const
Get a QVariantMap which describes the supernova.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual double getAngularSize(const StelCore *core) const
Return the angular radius of a circle containing the object as seen from the observer with the circle...
virtual Vec3f getInfoColor(void) const
Get a color used to display info about the object.