![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure |
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 _NEBULAMGR_HPP_ 00021 #define _NEBULAMGR_HPP_ 00022 00023 #include <vector> 00024 #include <QString> 00025 #include <QStringList> 00026 #include "StelObjectType.hpp" 00027 #include "StelFader.hpp" 00028 #include "StelTreeGrid.hpp" 00029 #include "StelObjectModule.hpp" 00030 #include "StelTextureTypes.hpp" 00031 00032 class Nebula; 00033 class StelTranslator; 00034 class StelToneReproducer; 00035 class QSettings; 00036 class StelPainter; 00037 00041 class NebulaMgr : public StelObjectModule 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 NebulaMgr(); 00047 virtual ~NebulaMgr(); 00048 00050 // Methods defined in the StelModule class 00058 virtual void init(); 00059 00061 virtual void draw(StelCore* core); 00062 00064 virtual void update(double deltaTime) {hintsFader.update((int)(deltaTime*1000)); flagShow.update((int)(deltaTime*1000));} 00065 00069 virtual void updateI18n(); 00070 00075 virtual void updateSkyCulture(const QString& skyCultureDir); 00076 00079 virtual void setStelStyle(const StelStyle& style); 00080 00082 virtual double getCallOrder(StelModuleActionName actionName) const; 00083 00085 // Methods defined in StelObjectManager class 00091 virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const; 00092 00096 virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; 00097 00100 virtual StelObjectP searchByName(const QString& name) const; 00101 00106 virtual QStringList listMatchingObjectsI18n(const QString& objPrefix, int maxNbItem=5) const; 00107 00109 // Properties setters and getters 00110 public slots: 00112 void setCirclesColor(const Vec3f& c); 00114 const Vec3f& getCirclesColor(void) const; 00115 00117 void setCircleScale(float scale); 00119 float getCircleScale(void) const; 00120 00122 void setHintsFadeDuration(float duration) {hintsFader.setDuration((int) (duration * 1000.f));} 00123 00125 void setFlagHints(bool b) {hintsFader=b;} 00127 bool getFlagHints(void) const {return hintsFader;} 00128 00130 void setFlagShow(bool b) { flagShow = b; } 00132 bool getFlagShow(void) const { return flagShow; } 00133 00135 void setLabelsColor(const Vec3f& c); 00137 const Vec3f& getLabelsColor(void) const; 00138 00140 void setFlagDisplayNoTexture(bool b) {displayNoTexture = b;} 00142 bool getFlagDisplayNoTexture(void) const {return displayNoTexture;} 00143 00147 void setLabelsAmount(float a) {labelsAmount=a;} 00150 float getLabelsAmount(void) const {return labelsAmount;} 00151 00155 void setHintsAmount(float f) {hintsAmount = f;} 00158 float getHintsAmount(void) const {return hintsAmount;} 00159 00160 private: 00162 StelObject* search(const QString& name); 00163 00170 void loadNebulaSet(const QString& setName); 00171 00172 StelObject* search(Vec3f Pos); // Search the Nebulae by position 00173 00175 void drawPointer(const StelCore* core, const StelPainter& sPainter); 00176 00177 Nebula *searchM(unsigned int M); 00178 Nebula *searchNGC(unsigned int NGC); 00179 Nebula *searchIC(unsigned int IC); 00180 bool loadNGC(const QString& fileName); 00181 bool loadNGCNames(const QString& fileName); 00182 00183 std::vector<Nebula*> nebArray; // The nebulas list 00184 LinearFader hintsFader; 00185 LinearFader flagShow; 00186 00188 StelTreeGrid nebGrid; 00189 00191 float hintsAmount; 00193 float labelsAmount; 00194 00195 bool displayNoTexture; // Define if nebulas without textures are to be displayed 00196 00198 StelTextureSP texPointer; 00199 }; 00200 00201 #endif // _NEBULAMGR_HPP_