![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · 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 <QString> 00024 #include <QStringList> 00025 #include <QFont> 00026 #include "StelObjectType.hpp" 00027 #include "StelFader.hpp" 00028 #include "StelSphericalIndex.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 00038 typedef QSharedPointer<Nebula> NebulaP; 00039 00043 class NebulaMgr : public StelObjectModule 00044 { 00045 Q_OBJECT 00046 00047 public: 00048 NebulaMgr(); 00049 virtual ~NebulaMgr(); 00050 00052 // Methods defined in the StelModule class 00060 virtual void init(); 00061 00063 virtual void draw(StelCore* core); 00064 00066 virtual void update(double deltaTime) {hintsFader.update((int)(deltaTime*1000)); flagShow.update((int)(deltaTime*1000));} 00067 00071 virtual void updateI18n(); 00072 00077 virtual void updateSkyCulture(const QString& skyCultureDir); 00078 00081 virtual void setStelStyle(const StelStyle& style); 00082 00084 virtual double getCallOrder(StelModuleActionName actionName) const; 00085 00087 // Methods defined in StelObjectManager class 00093 virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const; 00094 00098 virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; 00099 00102 virtual StelObjectP searchByName(const QString& name) const; 00103 00108 virtual QStringList listMatchingObjectsI18n(const QString& objPrefix, int maxNbItem=5) const; 00109 00111 // Properties setters and getters 00112 public slots: 00114 void setCirclesColor(const Vec3f& c); 00116 const Vec3f& getCirclesColor(void) const; 00117 00119 void setCircleScale(float scale); 00121 float getCircleScale(void) const; 00122 00124 void setHintsFadeDuration(float duration) {hintsFader.setDuration((int) (duration * 1000.f));} 00125 00127 void setFlagHints(bool b) {hintsFader=b;} 00129 bool getFlagHints(void) const {return hintsFader;} 00130 00132 void setFlagShow(bool b) { flagShow = b; } 00134 bool getFlagShow(void) const { return flagShow; } 00135 00137 void setLabelsColor(const Vec3f& c); 00139 const Vec3f& getLabelsColor(void) const; 00140 00142 void setFlagDisplayNoTexture(bool b) {displayNoTexture = b;} 00144 bool getFlagDisplayNoTexture(void) const {return displayNoTexture;} 00145 00149 void setLabelsAmount(float a) {labelsAmount=a;} 00152 float getLabelsAmount(void) const {return labelsAmount;} 00153 00157 void setHintsAmount(float f) {hintsAmount = f;} 00160 float getHintsAmount(void) const {return hintsAmount;} 00161 00162 private: 00164 NebulaP search(const QString& name); 00165 00167 NebulaP search(const Vec3d& pos); 00168 00175 void loadNebulaSet(const QString& setName); 00176 00178 void drawPointer(const StelCore* core, StelPainter& sPainter); 00179 00180 NebulaP searchM(unsigned int M); 00181 NebulaP searchNGC(unsigned int NGC); 00182 NebulaP searchIC(unsigned int IC); 00183 bool loadNGC(const QString& fileName); 00184 bool loadNGCOld(const QString& catNGC); 00185 bool loadNGCNames(const QString& fileName); 00186 00187 QList<NebulaP> nebArray; // The nebulas list 00188 QHash<unsigned int, NebulaP> ngcIndex; 00189 LinearFader hintsFader; 00190 LinearFader flagShow; 00191 00193 StelSphericalIndex nebGrid; 00194 00196 float hintsAmount; 00198 float labelsAmount; 00199 00200 bool displayNoTexture; // Define if nebulas without textures are to be displayed 00201 00203 StelTextureSP texPointer; 00204 00205 QFont nebulaFont; // Font used for names printing 00206 }; 00207 00208 #endif // _NEBULAMGR_HPP_