![]() |
Stellarium 0.11.3 | ||
| Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
00001 /* 00002 * Stellarium 00003 * Copyright (C) 2002 Fabien Chereau 00004 * Copyright (C) 2011 Alexander Wolf 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. 00019 */ 00020 00021 #ifndef _NEBULAMGR_HPP_ 00022 #define _NEBULAMGR_HPP_ 00023 00024 #include <QString> 00025 #include <QStringList> 00026 #include <QFont> 00027 #include "StelObjectType.hpp" 00028 #include "StelFader.hpp" 00029 #include "StelSphericalIndex.hpp" 00030 #include "StelObjectModule.hpp" 00031 #include "StelTextureTypes.hpp" 00032 00033 class Nebula; 00034 class StelTranslator; 00035 class StelToneReproducer; 00036 class QSettings; 00037 class StelPainter; 00038 00039 typedef QSharedPointer<Nebula> NebulaP; 00040 00044 class NebulaMgr : public StelObjectModule 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 NebulaMgr(); 00050 virtual ~NebulaMgr(); 00051 00053 // Methods defined in the StelModule class 00061 virtual void init(); 00062 00064 virtual void draw(StelCore* core); 00065 00067 virtual void update(double deltaTime) {hintsFader.update((int)(deltaTime*1000)); flagShow.update((int)(deltaTime*1000));} 00068 00070 virtual double getCallOrder(StelModuleActionName actionName) const; 00071 00073 // Methods defined in StelObjectManager class 00079 virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const; 00080 00084 virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; 00085 00088 virtual StelObjectP searchByName(const QString& name) const; 00089 00094 virtual QStringList listMatchingObjectsI18n(const QString& objPrefix, int maxNbItem=5) const; 00095 00097 // Properties setters and getters 00098 public slots: 00100 void setCirclesColor(const Vec3f& c); 00102 const Vec3f& getCirclesColor(void) const; 00103 00105 void setCircleScale(float scale); 00107 float getCircleScale(void) const; 00108 00110 void setHintsFadeDuration(float duration) {hintsFader.setDuration((int) (duration * 1000.f));} 00111 00113 void setFlagHints(bool b) {hintsFader=b;} 00115 bool getFlagHints(void) const {return hintsFader;} 00116 00118 void setFlagShow(bool b) { flagShow = b; } 00120 bool getFlagShow(void) const { return flagShow; } 00121 00123 void setLabelsColor(const Vec3f& c); 00125 const Vec3f& getLabelsColor(void) const; 00126 00128 void setFlagDisplayNoTexture(bool b) {displayNoTexture = b;} 00130 bool getFlagDisplayNoTexture(void) const {return displayNoTexture;} 00131 00135 void setLabelsAmount(float a) {labelsAmount=a;} 00138 float getLabelsAmount(void) const {return labelsAmount;} 00139 00143 void setHintsAmount(float f) {hintsAmount = f;} 00146 float getHintsAmount(void) const {return hintsAmount;} 00147 00148 private slots: 00151 void setStelStyle(const QString& section); 00152 00156 void updateI18n(); 00157 00158 00159 private: 00161 NebulaP search(const QString& name); 00162 00164 NebulaP search(const Vec3d& pos); 00165 00172 void loadNebulaSet(const QString& setName); 00173 00175 void drawPointer(const StelCore* core, StelPainter& sPainter); 00176 00177 NebulaP searchM(unsigned int M); 00178 NebulaP searchNGC(unsigned int NGC); 00179 NebulaP searchIC(unsigned int IC); 00180 bool loadNGC(const QString& fileName); 00181 bool loadNGCOld(const QString& catNGC); 00182 bool loadNGCNames(const QString& fileName); 00183 00184 QVector<NebulaP> nebArray; // The nebulas list 00185 QHash<unsigned int, NebulaP> ngcIndex; 00186 LinearFader hintsFader; 00187 LinearFader flagShow; 00188 00190 StelSphericalIndex nebGrid; 00191 00193 float hintsAmount; 00195 float labelsAmount; 00196 00197 bool displayNoTexture; // Define if nebulas without textures are to be displayed 00198 00200 StelTextureSP texPointer; 00201 00202 QFont nebulaFont; // Font used for names printing 00203 }; 00204 00205 #endif // _NEBULAMGR_HPP_
1.6.3