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

modules/Nebula.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 _NEBULA_HPP_
00021 #define _NEBULA_HPP_
00022 
00023 #include <QString>
00024 #include "StelObject.hpp"
00025 #include "StelTranslator.hpp"
00026 #include "StelTextureTypes.hpp"
00027 
00028 class StelPainter;
00029 class QDataStream;
00030 
00031 class Nebula : public StelObject
00032 {
00033 friend class NebulaMgr;
00034 public:
00035     Nebula();
00036     ~Nebula();
00037 
00051     virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags) const;
00052     virtual QString getType(void) const {return "Nebula";}
00053     virtual Vec3d getJ2000EquatorialPos(const StelNavigator *nav) const {return XYZ;}
00054     virtual double getCloseViewFov(const StelNavigator * nav = NULL) const;
00055     virtual float getVMagnitude(const StelNavigator * nav = NULL) const {return mag;}
00056     virtual float getSelectPriority(const StelNavigator *nav) const;
00057     virtual Vec3f getInfoColor(void) const;
00058     virtual QString getNameI18n(void) const {return nameI18;}
00059     virtual QString getEnglishName(void) const {return englishName;}
00060     virtual double getAngularSize(const StelCore *core) const {return angularSize*0.5;}
00061     virtual SphericalRegionP getRegion() const {return pointRegion;}
00062 
00063     // Methods specific to Nebula
00064     void setLabelColor(const Vec3f& v) {labelColor = v;}
00065     void setCircleColor(const Vec3f& v) {circleColor = v;}
00066 
00069     QString getTypeString(void) const;
00070 
00071 private:
00072     friend struct DrawNebulaFuncObject;
00073     
00075     enum NebulaType
00076     {
00077         NebGx=0,     
00078         NebOc=1,     
00079         NebGc=2,     
00080         NebN=3,      
00081         NebPn=4,     
00082         NebDn=5,     
00083         NebIg=6,     
00084         NebCn=7,     
00085         NebUnknown=8 
00086     };
00087 
00089     void translateName(StelTranslator& trans) {nameI18 = trans.qtranslate(englishName);}
00090 
00091     bool readNGC(char *record);
00092     void readNGC(QDataStream& in);
00093             
00094     void drawLabel(StelPainter& sPainter, float maxMagLabel);
00095     void drawHints(StelPainter& sPainter, float maxMagHints);
00096 
00097     unsigned int M_nb;              // Messier Catalog number
00098     unsigned int NGC_nb;            // New General Catalog number
00099     unsigned int IC_nb;             // Index Catalog number
00100     QString englishName;            // English name
00101     QString nameI18;                // Nebula name
00102     float mag;                      // Apparent magnitude
00103     float angularSize;              // Angular size in degree
00104     Vec3d XYZ;                      // Cartesian equatorial position
00105     Vec3d XY;                       // Store temporary 2D position
00106     NebulaType nType;
00107 
00108     SphericalRegionP pointRegion;
00109 
00110     static StelTextureSP texCircle;   // The symbolic circle texture
00111     static float hintsBrightness;
00112 
00113     static Vec3f labelColor, circleColor;
00114     static float circleScale;       // Define the scaling of the hints circle
00115 };
00116 
00117 #endif // _NEBULA_HPP_
00118 

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