Stellarium 0.13.0
StelObject.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2002 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef _STELOBJECT_HPP_
21 #define _STELOBJECT_HPP_
22 
23 #include "VecMath.hpp"
24 #include "StelObjectType.hpp"
25 #include "StelRegionObject.hpp"
26 
27 #include <QFlags>
28 #include <QString>
29 
30 class StelCore;
31 
37 {
38 public:
45  {
46  Name = 0x00000001,
47  CatalogNumber = 0x00000002,
48  Magnitude = 0x00000004,
49  RaDecJ2000 = 0x00000008,
50  RaDecOfDate = 0x00000010,
51  AltAzi = 0x00000020,
52  Distance = 0x00000040,
53  Size = 0x00000080,
54  Extra = 0x00000100,
55  HourAngle = 0x00000200,
56  AbsoluteMagnitude = 0x00000400,
57  GalacticCoord = 0x00000800,
58  ObjectType = 0x00001000,
59  EclTopocentricCoord = 0x00002000,
60  PlainText = 0x00004000
61  };
62  typedef QFlags<InfoStringGroupFlags> InfoStringGroup;
63  Q_FLAGS(InfoStringGroup)
64 
65 
69 
70  virtual ~StelObject() {}
71 
75 
78  virtual Vec3d getPointInRegion() const {return getJ2000EquatorialPos(NULL);}
79 
86  virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags=StelObject::AllInfo) const = 0;
87 
89  virtual QString getType() const = 0;
90 
92  virtual QString getEnglishName() const = 0;
93 
95  virtual QString getNameI18n() const = 0;
96 
98  virtual Vec3d getJ2000EquatorialPos(const StelCore* core) const = 0;
99 
103  Vec3d getEquinoxEquatorialPos(const StelCore* core) const;
104 
106  Vec3d getGalacticPos(const StelCore* core) const;
107 
111  Vec3d getSiderealPosGeometric(const StelCore* core) const;
112 
116  Vec3d getSiderealPosApparent(const StelCore* core) const;
117 
121  Vec3d getAltAzPosGeometric(const StelCore* core) const;
122 
126  Vec3d getAltAzPosApparent(const StelCore* core) const;
127 
131  Vec3d getAltAzPosAuto(const StelCore* core) const;
132 
134  virtual float getVMagnitude(const StelCore* core) const;
135 
138  float getVMagnitudeWithExtinction(const StelCore* core) const;
139 
142  virtual float getSelectPriority(const StelCore*) const;
143 
145  virtual Vec3f getInfoColor() const {return Vec3f(1,1,1);}
146 
148  virtual double getCloseViewFov(const StelCore*) const {return 10.;}
149 
151  virtual double getSatellitesFov(const StelCore*) const {return -1.;}
152  virtual double getParentSatellitesFov(const StelCore*) const {return -1.;}
153 
157  virtual double getAngularSize(const StelCore* core) const = 0;
158 
159 protected:
160 
162  QString getPositionInfoString(const StelCore *core, const InfoStringGroup& flags) const;
163 
165  void postProcessInfoString(QString& str, const InfoStringGroup& flags) const;
166 };
167 
168 Q_DECLARE_OPERATORS_FOR_FLAGS(StelObject::InfoStringGroup)
169 
170 #endif // _STELOBJECT_HPP_
Q_FLAGS(InfoStringGroup) static const InfoStringGroupFlags AllInfo
A pre-defined set of specifiers for the getInfoString flags argument to getInfoString.
The ecliptic topocentric position.
Definition: StelObject.hpp:59
Vec3d getAltAzPosAuto(const StelCore *core) const
Get observer-centered alt/az position It is the automatic position, i.e.
The type of the object (star, planet, etc.)
Definition: StelObject.hpp:58
virtual double getAngularSize(const StelCore *core) const =0
Return the angular radius of a circle containing the object as seen from the observer with the circle...
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags=StelObject::AllInfo) const =0
Write I18n information about the object in QString.
Magnitude related data.
Definition: StelObject.hpp:48
virtual QString getType() const =0
Return object's type. It should be the name of the class.
QString getPositionInfoString(const StelCore *core, const InfoStringGroup &flags) const
Format the positional info string contain J2000/of date/altaz/hour angle positions for the object...
Vec3d getAltAzPosGeometric(const StelCore *core) const
Get observer-centered alt/az position It is the geometric position, i.e.
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
Definition: StelObject.hpp:36
The galactic position.
Definition: StelObject.hpp:57
A shared pointer on a SphericalRegion.
Definition: StelSphereGeometry.hpp:51
virtual float getSelectPriority(const StelCore *) const
Return a priority value which is used to discriminate objects by priority As for magnitudes, the lower is the higher priority.
The position (Altitude/Azimuth)
Definition: StelObject.hpp:51
virtual double getCloseViewFov(const StelCore *) const
Return the best FOV in degree to use for a close view of the object.
Definition: StelObject.hpp:148
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
The hour angle + DE (of date)
Definition: StelObject.hpp:55
virtual Vec3d getJ2000EquatorialPos(const StelCore *core) const =0
Get observer-centered equatorial coordinates at equinox J2000.
Info about an object's distance.
Definition: StelObject.hpp:52
Special SphericalRegion for a point on the sphere.
Definition: StelSphereGeometry.hpp:430
Vec3d getEquinoxEquatorialPos(const StelCore *core) const
Get observer-centered equatorial coordinate at the current equinox The frame has it's Z axis at the p...
Strip HTML tags from output.
Definition: StelObject.hpp:60
virtual Vec3f getInfoColor() const
Get a color used to display info about the object.
Definition: StelObject.hpp:145
InfoStringGroupFlags
Definition: StelObject.hpp:44
virtual QString getEnglishName() const =0
Return object's name in english.
void postProcessInfoString(QString &str, const InfoStringGroup &flags) const
Apply post processing on the info string.
The equatorial position (J2000 ref)
Definition: StelObject.hpp:49
Define the StelObjectP type.
virtual SphericalRegionP getRegion() const
Default implementation of the getRegion method.
Definition: StelObject.hpp:74
The equatorial position (of date)
Definition: StelObject.hpp:50
An object's name.
Definition: StelObject.hpp:46
Catalog numbers.
Definition: StelObject.hpp:47
virtual float getVMagnitude(const StelCore *core) const
Return object's apparent V magnitude as seen from observer, without including extinction.
virtual Vec3d getPointInRegion() const
Default implementation of the getPointInRegion method.
Definition: StelObject.hpp:78
virtual QString getNameI18n() const =0
Return translated object's name.
Vec3d getSiderealPosApparent(const StelCore *core) const
Get observer-centered hour angle + declination (at current equinox) It is the apparent position...
The absolute magnitude.
Definition: StelObject.hpp:56
Simple abstract class defining basic methods implemented by all objects that need to be stored in a S...
Definition: StelRegionObject.hpp:28
Vec3d getAltAzPosApparent(const StelCore *core) const
Get observer-centered alt/az position It is the apparent position, i.e.
float getVMagnitudeWithExtinction(const StelCore *core) const
Return object's apparent V magnitude as seen from observer including extinction.
static const InfoStringGroupFlags ShortInfo
A pre-defined set of specifiers for the getInfoString flags argument to getInfoString.
Definition: StelObject.hpp:68
Info about an object's size.
Definition: StelObject.hpp:53
Vec3d getSiderealPosGeometric(const StelCore *core) const
Get observer-centered hour angle + declination (at current equinox) It is the geometric position...
Derived class-specific extra fields.
Definition: StelObject.hpp:54
Vec3d getGalacticPos(const StelCore *core) const
Get observer-centered galactic coordinates.
virtual double getSatellitesFov(const StelCore *) const
Return the best FOV in degree to use for a global view of the object satellite system (if there are s...
Definition: StelObject.hpp:151