Home · All Namespaces · All Classes · Functions · Coding Style · 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 StelFont;
00029 class StelPainter;
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/2;}
00061     
00062     // Methods specific to Nebula
00063     void setLabelColor(const Vec3f& v) {labelColor = v;}
00064     void setCircleColor(const Vec3f& v) {circleColor = v;}
00065 
00068     QString getTypeString(void) const;
00069     
00070 private:
00071     
00073     enum NebulaType 
00074     { 
00075         NebGx,     
00076         NebOc,     
00077         NebGc,     
00078         NebN,      
00079         NebPn,     
00080         NebDn,     
00081         NebIg,     
00082         NebCn,     
00083         NebUnknown 
00084     };
00085     
00087     void translateName(StelTranslator& trans) {nameI18 = trans.qtranslate(englishName);}
00088 
00089     bool readNGC(char *record);
00090     
00091     void drawLabel(const StelCore* core, const StelPainter& sPainter, float maxMagLabel);
00092     void drawHints(const StelPainter& sPainter, float maxMagHints);
00093     
00094     unsigned int M_nb;              // Messier Catalog number
00095     unsigned int NGC_nb;            // New General Catalog number
00096     unsigned int IC_nb;             // Index Catalog number
00097     QString englishName;            // English name
00098     QString nameI18;                // Nebula name
00099     float mag;                      // Apparent magnitude
00100     float angularSize;              // Angular size in degree
00101     Vec3f XYZ;                      // Cartesian equatorial position
00102     Vec3d XY;                       // Store temporary 2D position
00103     NebulaType nType;
00104 
00105     static StelTextureSP texCircle;   // The symbolic circle texture
00106     static StelFont* nebulaFont;      // Font used for names printing
00107     static float hintsBrightness;
00108 
00109     static Vec3f labelColor, circleColor;
00110     static float circleScale;       // Define the scaling of the hints circle
00111 };
00112 
00113 #endif // _NEBULA_HPP_
00114 

Generated on Mon Feb 2 17:23:47 2009 for Stellarium by  doxygen 1.5.5