Stellarium 0.15.2
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 "StelTextureTypes.hpp"
31 #include "StelFader.hpp"
32 
33 class StelPainter;
34 
40 
41 class Pulsar : public StelObject
42 {
43  friend class Pulsars;
44 public:
46  Pulsar(const QVariantMap& map);
47  ~Pulsar();
48 
50  // TODO: Add proper documentation of these fields!
69  QVariantMap getMap(void) const;
70 
72  virtual QString getType(void) const
73  {
74  return "Pulsar";
75  }
76 
77  virtual float getSelectPriority(const StelCore* core) const;
78 
82  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
84  virtual QVariantMap getInfoMap(const StelCore *core) const;
85  virtual Vec3f getInfoColor(void) const;
86  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
87  {
88  return XYZ;
89  }
91  virtual float getVMagnitude(const StelCore* core) const;
92  virtual float getVMagnitudeWithExtinction(const StelCore *core) const;
94  virtual double getAngularSize(const StelCore* core) const;
96  virtual QString getNameI18n(void) const
97  {
98  return designation;
99  }
101  virtual QString getEnglishName(void) const
102  {
103  return designation;
104  }
105 
106  void update(double deltaTime);
107 
108 private:
109  bool initialized;
110 
111  Vec3d XYZ; // holds J2000 position
112 
113  static StelTextureSP hintTexture;
114  static StelTextureSP markerTexture;
115  static bool distributionMode;
116  static bool glitchFlag;
117  static Vec3f markerColor;
118  static Vec3f glitchColor;
119 
120  void draw(StelCore* core, StelPainter *painter);
121 
123  QString designation;
124  float RA;
125  float DE;
126  float parallax;
127  double period;
128  double frequency;
129  double pfrequency;
130  double pderivative;
131  double dmeasure;
132  double bperiod;
133  double eccentricity;
134  float w50;
135  float s400;
136  float s600;
137  float s1400;
138  float distance;
139  int glitch;
140  QString notes;
141 
142  LinearFader labelsFader;
143 
147  double getEdot(double p0, double p1) const;
148 
152  double getP1(double p0, double f1) const;
153 
156  QString getPulsarTypeInfoString(QString pcode) const;
157 
158 };
159 
160 #endif // _PULSAR_HPP_
virtual QString getNameI18n(void) const
Get the localized name of pulsar.
Definition: Pulsar.hpp:96
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 float getSelectPriority(const StelCore *core) const
Return a priority value which is used to discriminate objects by priority As for magnitudes, the lower is the higher priority.
Define the StelTextureSP type.
virtual Vec3f getInfoColor(void) const
Get a color used to display info about the object.
Main class of the Pulsars plugin.
Definition: Pulsars.hpp:73
virtual double getAngularSize(const StelCore *core) const
Get the angular size of pulsar.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual void update(double)
Update the module with respect to the time.
Definition: Pulsars.hpp:99
A Pulsar object represents one pulsar on the sky.
Definition: Pulsar.hpp:41
virtual QString getType(void) const
Get the type of object.
Definition: Pulsar.hpp:72
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
virtual float getVMagnitude(const StelCore *core) const
Get the visual magnitude of pulsar.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
QVariantMap getMap(void) const
Get a QVariantMap which describes the pulsar. Could be used to create a duplicate.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual QString getEnglishName(void) const
Get the english name of pulsar.
Definition: Pulsar.hpp:101
virtual QVariantMap getInfoMap(const StelCore *core) const
Return a map like StelObject::getInfoMap(), but with a few extra tags also available in getMap()...
Pulsar(const QVariantMap &map)
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Pulsar.hpp:86
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Get an HTML string to describe the object.