Stellarium 0.14.3
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 // GZ NOTE from JDfix for V0.14:
42 // TODO: I don't know whether the peak times given are UT or DT times.
43 // If DT, please change relevant calls from core->getJD() to getJDE() etc
44 // and rename variables to include JDE for clarity.
45 
46 class Nova : public StelObject
47 {
48  friend class Novae;
49 public:
51  Nova(const QVariantMap& map);
52  ~Nova();
53 
56  QVariantMap getMap(void);
57 
58  virtual QString getType(void) const
59  {
60  return "Nova";
61  }
62 
66  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
67  virtual Vec3f getInfoColor(void) const;
68  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
69  {
70  return XYZ;
71  }
72  virtual float getVMagnitude(const StelCore* core) const;
73  virtual double getAngularSize(const StelCore* core) const;
74  virtual QString getNameI18n(void) const;
75  virtual QString getEnglishName(void) const;
76  QString getDesignation(void) const;
77 
78  void update(double deltaTime);
79 
80 private:
81  bool initialized;
82 
83  Vec3d XYZ; // holds J2000 position
84 
85  void draw(StelCore* core, StelPainter* painter);
86 
87  // Nova
88  QString designation;
89  QString novaName;
90  QString novaType;
91  float maxMagnitude;
92  float minMagnitude;
93  double peakJD;
94  int m2;
95  int m3;
96  int m6;
97  int m9;
98  double RA;
99  double Dec;
100  double distance;
101 
102  LinearFader labelsFader;
103 
104  QString getMaxBrightnessDate(const double JD) const;
105 };
106 
107 #endif // _NOVA_HPP_
Main class of the Bright Novae plugin.
Definition: Novae.hpp:67
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Get an HTML string to describe the object.
QVariantMap getMap(void)
Get a QVariantMap which describes the nova.
Nova(const QVariantMap &map)
A Nova object represents one nova on the sky.
Definition: Nova.hpp:46