Stellarium 0.12.3
Pulsar.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 _PULSAR_HPP_
20 #define _PULSAR_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 
32 #include "StelFader.hpp"
33 
34 
39 
40 class Pulsar : public StelObject
41 {
42  friend class Pulsars;
43 public:
45  Pulsar(const QVariantMap& map);
46  ~Pulsar();
47 
50  QVariantMap getMap(void);
51 
53  virtual QString getType(void) const
54  {
55  return "Pulsar";
56  }
57  virtual float getSelectPriority(const StelCore* core) const;
58 
62  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
63  virtual Vec3f getInfoColor(void) const;
64  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
65  {
66  return XYZ;
67  }
69  virtual float getVMagnitude(const StelCore* core, bool withExtinction=false) const;
71  virtual double getAngularSize(const StelCore* core) const;
73  virtual QString getNameI18n(void) const
74  {
75  return designation;
76  }
78  virtual QString getEnglishName(void) const
79  {
80  return designation;
81  }
82 
83  void update(double deltaTime);
84 
85 private:
86  bool initialized;
87 
88  Vec3d XYZ; // holds J2000 position
89 
90  void draw(StelCore* core, StelRenderer* renderer, StelProjectorP projector,
91  class StelTextureNew* markerTexture);
92 
94  QString designation;
95  float RA;
96  float DE;
97  float parallax;
98  double period;
99  double frequency;
100  double pfrequency;
101  double pderivative;
102  double dmeasure;
103  double bperiod;
104  double eccentricity;
105  float w50;
106  float s400;
107  float s600;
108  float s1400;
109  float distance;
110  QString notes;
111 
112  LinearFader labelsFader;
113 
117  double getEdot(double p0, double p1) const;
118 
122  double getP1(double p0, double f1) const;
123 
126  QString getPulsarTypeInfoString(QString pcode) const;
127 
128 };
129 
130 #endif // _PULSAR_HPP_