Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _STELSKYLAYERMGR_HPP_
00020 #define _STELSKYLAYERMGR_HPP_
00021
00022 #include <QString>
00023 #include <QStringList>
00024 #include <QMap>
00025
00026 #include "StelModule.hpp"
00027 #include "StelSkyLayer.hpp"
00028
00029 class StelCore;
00030 class StelSkyImageTile;
00031 class QProgressBar;
00032
00034 class StelSkyLayerMgr : public StelModule
00035 {
00036 Q_OBJECT
00037
00038 public:
00039 StelSkyLayerMgr();
00040 ~StelSkyLayerMgr();
00041
00043
00045 virtual void init();
00046
00048 virtual void draw(StelCore* core);
00049
00051 virtual void update(double) {;}
00052
00054 virtual void updateI18n() {;}
00055
00057 virtual double getCallOrder(StelModuleActionName actionName) const;
00058
00060
00066 QString insertSkyLayer(StelSkyLayerP l, const QString& keyHint=QString(), bool show=true);
00067
00069 void removeSkyLayer(StelSkyLayerP l);
00070
00072 QMap<QString, StelSkyLayerP> getAllSkyLayers() const;
00073
00074 StelSkyLayerP getSkyLayer(const QString& key) const;
00075
00076 public slots:
00078
00080 void setFlagShow(bool b) {flagShow = b;}
00082 bool getFlagShow() const {return flagShow;}
00083
00101 bool loadSkyImage(const QString& id, const QString& filename,
00102 double ra0, double dec0,
00103 double ra1, double dec1,
00104 double ra2, double dec2,
00105 double ra3, double dec3,
00106 double minRes, double maxBright, bool visible);
00107
00113 void showLayer(const QString& id, bool b);
00119 bool getShowLayer(const QString& id) const;
00120
00122
00130 QString insertSkyImage(const QString& uri, const QString& keyHint=QString(), bool show=true);
00131
00137 void removeSkyLayer(const QString& key);
00138
00140 QStringList getAllKeys() const {return allSkyLayers.keys();}
00141
00142 private slots:
00145 void loadingStateChanged(bool b);
00146
00149 void percentLoadedChanged(int percentage);
00150
00151 private:
00152
00154 class SkyLayerElem
00155 {
00156 public:
00157 SkyLayerElem(StelSkyLayerP t, bool show=true);
00158 ~SkyLayerElem();
00159 StelSkyLayerP layer;
00160 QProgressBar* progressBar;
00161 bool show;
00162 };
00163
00164 SkyLayerElem* skyLayerElemForLayer(const StelSkyLayer*);
00165
00166 QString keyForLayer(const StelSkyLayer*);
00167
00169 QMap<QString, SkyLayerElem*> allSkyLayers;
00170
00171
00172 bool flagShow;
00173 };
00174
00175 #endif // _STELSKYLAYERMGR_HPP_