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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 StelNavigator;
00029 class StelCore;
00030 
00035 class StelObject : public StelRegionObject
00036 {
00037 public:
00042     enum InfoStringGroup
00043     {
00044         Name          = 0x00000001, 
00045         CatalogNumber = 0x00000002, 
00046         Magnitude     = 0x00000004, 
00047         RaDecJ2000    = 0x00000008, 
00048         RaDecOfDate   = 0x00000010, 
00049         AltAzi        = 0x00000020, 
00050         Distance      = 0x00000040, 
00051         Size          = 0x00000080, 
00052         Extra1        = 0x00000100, 
00053         Extra2        = 0x00000200, 
00054         Extra3        = 0x00000400, 
00055         PlainText     = 0x00000800, 
00056         HourAngle     = 0x00001000,  
00057         AbsoluteMagnitude = 0x00002000  
00058     };
00059 
00061     static const InfoStringGroup AllInfo = (InfoStringGroup)(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Extra1|Extra2|Extra3|HourAngle|AbsoluteMagnitude);
00063     static const InfoStringGroup ShortInfo = (InfoStringGroup)(Name|CatalogNumber|Magnitude|RaDecJ2000);
00064 
00065     virtual ~StelObject(void) {}
00066 
00070     virtual SphericalRegionP getRegion() const {return SphericalRegionP(new SphericalPoint(getJ2000EquatorialPos(NULL)));}
00071 
00078     virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags=StelObject::AllInfo) const = 0;
00079 
00081     virtual QString getType(void) const = 0;
00082 
00084     virtual QString getEnglishName(void) const = 0;
00085 
00087     virtual QString getNameI18n(void) const = 0;
00088 
00090     virtual Vec3d getJ2000EquatorialPos(const StelNavigator *nav) const = 0;
00091 
00095     Vec3d getEquinoxEquatorialPos(const StelNavigator* nav) const;
00096 
00099     Vec3d getSideralPos(const StelCore* core) const;
00100 
00103     Vec3d getAltAzPos(const StelNavigator* nav) const;
00104 
00106     virtual float getVMagnitude(const StelNavigator *nav) const {return 99;}
00107 
00110     virtual float getSelectPriority(const StelNavigator *nav) const {return 99;}
00111 
00113     virtual Vec3f getInfoColor() const {return Vec3f(1,1,1);}
00114 
00116     virtual double getCloseViewFov(const StelNavigator *nav) const {return 10.;}
00117 
00119     virtual double getSatellitesFov(const StelNavigator *nav) const {return -1.;}
00120     virtual double getParentSatellitesFov(const StelNavigator *nav) const {return -1.;}
00121 
00125     virtual double getAngularSize(const StelCore* core) const = 0;
00126 
00127 protected:
00128 
00130     QString getPositionInfoString(const StelCore *core, const InfoStringGroup& flags) const;
00131 
00133     void postProcessInfoString(QString& str, const InfoStringGroup& flags) const;
00134 };
00135 
00136 #endif // _STELOBJECT_HPP_

Generated on Mon Mar 22 09:55:38 2010 for Stellarium by  doxygen 1.5.5