Stellarium 0.11.4
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

core/modules/NebulaMgr.hpp

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 
00130     void setLabelsAmount(float a) {labelsAmount=a;}
00133     float getLabelsAmount(void) const {return labelsAmount;}
00134 
00138     void setHintsAmount(float f) {hintsAmount = f;}
00141     float getHintsAmount(void) const {return hintsAmount;}
00142 
00143 private slots:
00146     void setStelStyle(const QString& section);
00147 
00151     void updateI18n();
00152     
00153 
00154 private:
00156     NebulaP search(const QString& name);
00157 
00159     NebulaP search(const Vec3d& pos);
00160 
00167     void loadNebulaSet(const QString& setName);
00168 
00170     void drawPointer(const StelCore* core, StelPainter& sPainter);
00171 
00172     NebulaP searchM(unsigned int M);
00173     NebulaP searchNGC(unsigned int NGC);
00174     NebulaP searchIC(unsigned int IC);
00175     bool loadNGC(const QString& fileName);
00176     bool loadNGCOld(const QString& catNGC);
00177     bool loadNGCNames(const QString& fileName);
00178 
00179     QVector<NebulaP> nebArray;      // The nebulas list
00180     QHash<unsigned int, NebulaP> ngcIndex;
00181     LinearFader hintsFader;
00182     LinearFader flagShow;
00183 
00185     StelSphericalIndex nebGrid;
00186 
00188     float hintsAmount;
00190     float labelsAmount;
00191 
00193     StelTextureSP texPointer;
00194     
00195     QFont nebulaFont;      // Font used for names printing
00196 };
00197 
00198 #endif // _NEBULAMGR_HPP_
Generated on Sat Aug 25 22:13:29 2012 for Stellarium by  doxygen 1.6.3