Stellarium 0.11.3
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 <QString>
00024 #include "VecMath.hpp"
00025 #include "StelObjectType.hpp"
00026 #include "StelRegionObject.hpp"
00027 
00028 class StelCore;
00029 
00034 class StelObject : public StelRegionObject
00035 {
00036 public:
00041     enum InfoStringGroup
00042     {
00043         Name          = 0x00000001, 
00044         CatalogNumber = 0x00000002, 
00045         Magnitude     = 0x00000004, 
00046         RaDecJ2000    = 0x00000008, 
00047         RaDecOfDate   = 0x00000010, 
00048         AltAzi        = 0x00000020, 
00049         Distance      = 0x00000040, 
00050         Size          = 0x00000080, 
00051         Extra1        = 0x00000100, 
00052         Extra2        = 0x00000200, 
00053         Extra3        = 0x00000400, 
00054         PlainText     = 0x00000800, 
00055         HourAngle     = 0x00001000,  
00056         AbsoluteMagnitude = 0x00002000  
00057     };
00058 
00060     static const InfoStringGroup AllInfo = (InfoStringGroup)(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Extra1|Extra2|Extra3|HourAngle|AbsoluteMagnitude);
00062     static const InfoStringGroup ShortInfo = (InfoStringGroup)(Name|CatalogNumber|Magnitude|RaDecJ2000);
00063 
00064     virtual ~StelObject() {}
00065 
00068     virtual SphericalRegionP getRegion() const {return SphericalRegionP(new SphericalPoint(getJ2000EquatorialPos(NULL)));}
00069 
00076     virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags=StelObject::AllInfo) const = 0;
00077 
00079     virtual QString getType() const = 0;
00080 
00082     virtual QString getEnglishName() const = 0;
00083 
00085     virtual QString getNameI18n() const = 0;
00086 
00088     virtual Vec3d getJ2000EquatorialPos(const StelCore* core) const = 0;
00089 
00093     Vec3d getEquinoxEquatorialPos(const StelCore* core) const;
00094 
00098     Vec3d getSideralPosGeometric(const StelCore* core) const;
00099 
00103     Vec3d getSideralPosApparent(const StelCore* core) const;
00104 
00108     Vec3d getAltAzPosGeometric(const StelCore* core) const;
00109 
00113     Vec3d getAltAzPosApparent(const StelCore* core) const;
00114 
00118     Vec3d getAltAzPosAuto(const StelCore* core) const;
00119 
00121     virtual float getVMagnitude(const StelCore* core, bool withExtinction=false) const;
00122 
00125     virtual float getSelectPriority(const StelCore*) const {return 99;}
00126 
00128     virtual Vec3f getInfoColor() const {return Vec3f(1,1,1);}
00129 
00131     virtual double getCloseViewFov(const StelCore*) const {return 10.;}
00132 
00134     virtual double getSatellitesFov(const StelCore*) const {return -1.;}
00135     virtual double getParentSatellitesFov(const StelCore*) const {return -1.;}
00136 
00140     virtual double getAngularSize(const StelCore* core) const = 0;
00141 
00142 protected:
00143 
00145     QString getPositionInfoString(const StelCore *core, const InfoStringGroup& flags) const;
00146 
00148     void postProcessInfoString(QString& str, const InfoStringGroup& flags) const;
00149 };
00150 
00151 #endif // _STELOBJECT_HPP_
Generated on Thu May 31 10:37:18 2012 for Stellarium by  doxygen 1.6.3