Stellarium  0.90.0
Nova.hpp
1 /*
2  * Copyright (C) 2013 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 _NOVA_HPP_
20 #define _NOVA_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 "StelFader.hpp"
31 #include "StelProjectorType.hpp"
32 
33 class StelPainter;
34 
40 
41 class Nova : public StelObject
42 {
43  friend class Novae;
44 public:
45  static const QString NOVA_TYPE;
46 
48  Nova(const QVariantMap& map);
49  ~Nova();
50 
52  QVariantMap getMap(void) const;
53 
54  virtual QString getType(void) const
55  {
56  return NOVA_TYPE;
57  }
58 
59  virtual QString getID(void) const
60  {
61  return getDesignation();
62  }
63 
67  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
69  // TODO: Describe the entries!
81  virtual QVariantMap getInfoMap(const StelCore *core) const;
82  virtual Vec3f getInfoColor(void) const;
83  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
84  {
85  return XYZ;
86  }
87  virtual float getVMagnitude(const StelCore* core) const;
88  virtual double getAngularSize(const StelCore* core) const;
89  virtual QString getNameI18n(void) const;
90  virtual QString getEnglishName(void) const;
91  QString getDesignation(void) const;
92 
93  void update(double deltaTime);
94 
95 private:
96  bool initialized;
97 
98  Vec3d XYZ; // holds J2000 position
99 
100  void draw(StelCore* core, StelPainter* painter);
101 
102  // Nova
103  QString designation;
104  QString novaName;
105  QString novaType;
106  float maxMagnitude;
107  float minMagnitude;
108  double peakJD;
109  int m2;
110  int m3;
111  int m6;
112  int m9;
113  double RA;
114  double Dec;
115  double distance;
116 
117  LinearFader labelsFader;
118 
119  QString getMaxBrightnessDate(const double JD) const;
120 };
121 
122 #endif // _NOVA_HPP_
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
Implementation of StelFader which implements a linear transition.
Definition: StelFader.hpp:77
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: Nova.hpp:54
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...
Main class of the Bright Novae plugin.
Definition: Novae.hpp:67
QVariantMap getMap(void) const
Get a QVariantMap which describes the nova. Could be used to create a duplicate.
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Nova.hpp:83
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual QString getEnglishName(void) const
Return object&#39;s name in english.
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Get an HTML string to describe the object.
virtual QString getNameI18n(void) const
Return translated object&#39;s name.
virtual float getVMagnitude(const StelCore *core) const
Return object&#39;s apparent V magnitude as seen from observer, without including extinction.
virtual QString getID(void) const
Returns a unique identifier for this object.
Definition: Nova.hpp:59
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
virtual void update(double)
Update the module with respect to the time.
Definition: Novae.hpp:87
Nova(const QVariantMap &map)
virtual QVariantMap getInfoMap(const StelCore *core) const
Return a map like StelObject::getInfoMap(), but with a few extra tags also available in getMap()...
A Nova object represents one nova on the sky.
Definition: Nova.hpp:41
Define the StelProjectorP type.
virtual Vec3f getInfoColor(void) const
Get a color used to display info about the object.