Stellarium 0.11.4
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

core/StelObject.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2002 Fabien Chereau
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
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_
Generated on Sat Aug 25 22:13:30 2012 for Stellarium by  doxygen 1.6.3