Stellarium  0.16.1
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:
45  static const QString PULSAR_TYPE;
46 
48  Pulsar(const QVariantMap& map);
49  ~Pulsar();
50 
52  // TODO: Add proper documentation of these fields!
71  QVariantMap getMap(void) const;
72 
74  virtual QString getType(void) const
75  {
76  return PULSAR_TYPE;
77  }
78 
79  virtual QString getID(void) const
80  {
81  return designation;
82  }
83 
84  virtual float getSelectPriority(const StelCore* core) const;
85 
89  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
91  virtual QVariantMap getInfoMap(const StelCore *core) const;
92  virtual Vec3f getInfoColor(void) const;
93  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
94  {
95  return XYZ;
96  }
98  virtual float getVMagnitude(const StelCore* core) const;
99  virtual float getVMagnitudeWithExtinction(const StelCore *core) const;
101  virtual double getAngularSize(const StelCore* core) const;
103  virtual QString getNameI18n(void) const
104  {
105  return designation;
106  }
108  virtual QString getEnglishName(void) const
109  {
110  return designation;
111  }
112 
113  void update(double deltaTime);
114 
115 private:
116  bool initialized;
117 
118  Vec3d XYZ; // holds J2000 position
119 
120  static StelTextureSP hintTexture;
121  static StelTextureSP markerTexture;
122  static bool distributionMode;
123  static bool glitchFlag;
124  static Vec3f markerColor;
125  static Vec3f glitchColor;
126 
127  void draw(StelCore* core, StelPainter *painter);
128 
130  QString designation;
131  float RA;
132  float DE;
133  float parallax;
134  double period;
135  double frequency;
136  double pfrequency;
137  double pderivative;
138  double dmeasure;
139  double bperiod;
140  double eccentricity;
141  float w50;
142  float s400;
143  float s600;
144  float s1400;
145  float distance;
146  int glitch;
147  QString notes;
148 
149  LinearFader labelsFader;
150 
154  double getEdot(double p0, double p1) const;
155 
159  double getP1(double p0, double f1) const;
160 
163  QString getPulsarTypeInfoString(QString pcode) const;
164 
165 };
166 
167 #endif // _PULSAR_HPP_
virtual QString getNameI18n(void) const
Get the localized name of pulsar.
Definition: Pulsar.hpp:103
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:74
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:108
virtual QVariantMap getInfoMap(const StelCore *core) const
Return a map like StelObject::getInfoMap(), but with a few extra tags also available in getMap()...
virtual QString getID(void) const
Returns a unique identifier for this object.
Definition: Pulsar.hpp:79
Pulsar(const QVariantMap &map)
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Pulsar.hpp:93
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Get an HTML string to describe the object.