Stellarium  0.90.0
Quasar.hpp
1 /*
2  * Copyright (C) 2011 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 _QUASAR_HPP_
20 #define _QUASAR_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 Quasar : public StelObject
42 {
43  friend class Quasars;
44 public:
45  static const QString QUASAR_TYPE;
46 
48  Quasar(const QVariantMap& map);
49  ~Quasar();
50 
59  QVariantMap getMap(void) const;
60 
61  virtual QString getType(void) const
62  {
63  return QUASAR_TYPE;
64  }
65 
66  virtual QString getID(void) const
67  {
68  return designation;
69  }
70 
71  virtual float getSelectPriority(const StelCore *core) const;
72 
76  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
78  // TODO: Describe the fields.
82  virtual QVariantMap getInfoMap(const StelCore *core) const;
83  virtual Vec3f getInfoColor(void) const;
84  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
85  {
86  return XYZ;
87  }
88  virtual float getVMagnitude(const StelCore* core) const;
89  virtual double getAngularSize(const StelCore* core) const;
90  virtual QString getNameI18n(void) const
91  {
92  return designation;
93  }
94  virtual QString getEnglishName(void) const
95  {
96  return designation;
97  }
98 
99  void update(double deltaTime);
100 
101 private:
102  bool initialized;
103 
104  Vec3d XYZ; // holds J2000 position
105 
106  static StelTextureSP hintTexture;
107  static StelTextureSP markerTexture;
108  static bool distributionMode;
109  static Vec3f markerColor;
110 
111  void draw(StelCore* core, StelPainter& painter);
114  unsigned char BvToColorIndex(float b_v);
115 
116  // Quasar
117  QString designation;
118  float VMagnitude;
119  float AMagnitude;
120  float bV;
121  double qRA;
122  double qDE;
123  float redshift;
124 
125  LinearFader labelsFader;
126 };
127 
128 #endif // _QUASAR_HPP_
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.
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
Define the StelTextureSP type.
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...
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Definition: Quasar.hpp:84
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual QString getEnglishName(void) const
Return object&#39;s name in english.
Definition: Quasar.hpp:94
virtual QVariantMap getInfoMap(const StelCore *core) const
Return a map like StelObject::getInfoMap(), but with a few extra tags also available in getMap()...
A Quasar object represents one Quasar on the sky.
Definition: Quasar.hpp:41
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Get an HTML string to describe the object.
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
Main class of the Quasars plugin.
Definition: Quasars.hpp:69
virtual void update(double)
Update the module with respect to the time.
Definition: Quasars.hpp:95
QVariantMap getMap(void) const
Get a QVariantMap which describes the Quasar.
virtual QString getType(void) const
Return object&#39;s type. It should be the name of the class.
Definition: Quasar.hpp:61
virtual float getVMagnitude(const StelCore *core) const
Return object&#39;s apparent V magnitude as seen from observer, without including extinction.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual QString getID(void) const
Returns a unique identifier for this object.
Definition: Quasar.hpp:66
Quasar(const QVariantMap &map)
virtual Vec3f getInfoColor(void) const
Get a color used to display info about the object.
virtual QString getNameI18n(void) const
Return translated object&#39;s name.
Definition: Quasar.hpp:90