![]() |
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 00074 virtual void updateSkyCulture(); 00075 00078 virtual void setStelStyle(const StelStyle& style); 00079 00081 virtual double getCallOrder(StelModuleActionName actionName) const; 00082 00084 // Methods defined in StelObjectManager class 00090 virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const; 00091 00095 virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; 00096 00099 virtual StelObjectP searchByName(const QString& name) const; 00100 00105 virtual QStringList listMatchingObjectsI18n(const QString& objPrefix, int maxNbItem=5) const; 00106 00108 // Properties setters and getters 00109 public slots: 00111 void setCirclesColor(const Vec3f& c); 00113 const Vec3f& getCirclesColor(void) const; 00114 00116 void setCircleScale(float scale); 00118 float getCircleScale(void) const; 00119 00121 void setHintsFadeDuration(float duration) {hintsFader.setDuration((int) (duration * 1000.f));} 00122 00124 void setFlagHints(bool b) {hintsFader=b;} 00126 bool getFlagHints(void) const {return hintsFader;} 00127 00129 void setFlagShow(bool b) { flagShow = b; } 00131 bool getFlagShow(void) const { return flagShow; } 00132 00134 void setLabelsColor(const Vec3f& c); 00136 const Vec3f& getLabelsColor(void) const; 00137 00139 void setFlagDisplayNoTexture(bool b) {displayNoTexture = b;} 00141 bool getFlagDisplayNoTexture(void) const {return displayNoTexture;} 00142 00146 void setLabelsAmount(float a) {labelsAmount=a;} 00149 float getLabelsAmount(void) const {return labelsAmount;} 00150 00154 void setHintsAmount(float f) {hintsAmount = f;} 00157 float getHintsAmount(void) const {return hintsAmount;} 00158 00159 private: 00161 StelObject* search(const QString& name); 00162 00169 void loadNebulaSet(const QString& setName); 00170 00171 StelObject* search(Vec3f Pos); // Search the Nebulae by position 00172 00174 void drawPointer(const StelCore* core, const StelPainter& sPainter); 00175 00176 Nebula *searchM(unsigned int M); 00177 Nebula *searchNGC(unsigned int NGC); 00178 Nebula *searchIC(unsigned int IC); 00179 bool loadNGC(const QString& fileName); 00180 bool loadNGCNames(const QString& fileName); 00181 00182 std::vector<Nebula*> nebArray; // The nebulas list 00183 LinearFader hintsFader; 00184 LinearFader flagShow; 00185 00187 StelTreeGrid nebGrid; 00188 00190 float hintsAmount; 00192 float labelsAmount; 00193 00194 bool displayNoTexture; // Define if nebulas without textures are to be displayed 00195 00197 StelTextureSP texPointer; 00198 }; 00199 00200 #endif // _NEBULAMGR_HPP_