00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _STELOBJECT_HPP_
00021 #define _STELOBJECT_HPP_
00022
00023 #include <QFlags>
00024 #include <QString>
00025 #include "VecMath.hpp"
00026 #include "StelObjectType.hpp"
00027 #include "StelRegionObject.hpp"
00028
00029 class StelCore;
00030
00035 class StelObject : public StelRegionObject
00036 {
00037 public:
00043 enum InfoStringGroupFlags
00044 {
00045 Name = 0x00000001,
00046 CatalogNumber = 0x00000002,
00047 Magnitude = 0x00000004,
00048 RaDecJ2000 = 0x00000008,
00049 RaDecOfDate = 0x00000010,
00050 AltAzi = 0x00000020,
00051 Distance = 0x00000040,
00052 Size = 0x00000080,
00053 Extra1 = 0x00000100,
00054 Extra2 = 0x00000200,
00055 Extra3 = 0x00000400,
00056 PlainText = 0x00000800,
00057 HourAngle = 0x00001000,
00058 AbsoluteMagnitude = 0x00002000
00059 };
00060 typedef QFlags<InfoStringGroupFlags> InfoStringGroup;
00061 Q_FLAGS(InfoStringGroup)
00062
00063
00064 static const InfoStringGroupFlags AllInfo = (InfoStringGroupFlags)(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Extra1|Extra2|Extra3|HourAngle|AbsoluteMagnitude);
00066 static const InfoStringGroupFlags ShortInfo = (InfoStringGroupFlags)(Name|CatalogNumber|Magnitude|RaDecJ2000);
00067
00068 virtual ~StelObject() {}
00069
00072 virtual SphericalRegionP getRegion() const {return SphericalRegionP(new SphericalPoint(getJ2000EquatorialPos(NULL)));}
00073
00080 virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags=StelObject::AllInfo) const = 0;
00081
00083 virtual QString getType() const = 0;
00084
00086 virtual QString getEnglishName() const = 0;
00087
00089 virtual QString getNameI18n() const = 0;
00090
00092 virtual Vec3d getJ2000EquatorialPos(const StelCore* core) const = 0;
00093
00097 Vec3d getEquinoxEquatorialPos(const StelCore* core) const;
00098
00102 Vec3d getSideralPosGeometric(const StelCore* core) const;
00103
00107 Vec3d getSideralPosApparent(const StelCore* core) const;
00108
00112 Vec3d getAltAzPosGeometric(const StelCore* core) const;
00113
00117 Vec3d getAltAzPosApparent(const StelCore* core) const;
00118
00122 Vec3d getAltAzPosAuto(const StelCore* core) const;
00123
00125 virtual float getVMagnitude(const StelCore* core, bool withExtinction=false) const;
00126
00129 virtual float getSelectPriority(const StelCore*) const {return 99;}
00130
00132 virtual Vec3f getInfoColor() const {return Vec3f(1,1,1);}
00133
00135 virtual double getCloseViewFov(const StelCore*) const {return 10.;}
00136
00138 virtual double getSatellitesFov(const StelCore*) const {return -1.;}
00139 virtual double getParentSatellitesFov(const StelCore*) const {return -1.;}
00140
00144 virtual double getAngularSize(const StelCore* core) const = 0;
00145
00146 protected:
00147
00149 QString getPositionInfoString(const StelCore *core, const InfoStringGroup& flags) const;
00150
00152 void postProcessInfoString(QString& str, const InfoStringGroup& flags) const;
00153 };
00154
00155 Q_DECLARE_OPERATORS_FOR_FLAGS(StelObject::InfoStringGroup)
00156
00157 #endif // _STELOBJECT_HPP_