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

core/StelSkyLayerMgr.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2008 Fabien Chereau
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
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     // Methods defined in the StelModule class
00045     virtual void init();
00046 
00048     virtual void draw(StelCore* core);
00049 
00051     virtual void update(double) {;}
00052 
00054     virtual double getCallOrder(StelModuleActionName actionName) const;
00055 
00057     // Other specific methods
00063     QString insertSkyLayer(StelSkyLayerP l, const QString& keyHint=QString(), bool show=true);
00064 
00066     void removeSkyLayer(StelSkyLayerP l);
00067 
00069     QMap<QString, StelSkyLayerP> getAllSkyLayers() const;
00070 
00071     StelSkyLayerP getSkyLayer(const QString& key) const;
00072 
00073 public slots:
00075     // Properties setters and getters
00077     void setFlagShow(bool b) {flagShow = b;}
00079     bool getFlagShow() const {return flagShow;}
00080 
00098     bool loadSkyImage(const QString& id, const QString& filename,
00099                       double ra0, double dec0,
00100                       double ra1, double dec1,
00101                       double ra2, double dec2,
00102                       double ra3, double dec3,
00103                       double minRes, double maxBright, bool visible);
00104 
00122     bool loadSkyImageAltAz(const QString& id, const QString& filename,
00123                       double alt0, double azi0,
00124                       double alt1, double azi1,
00125                       double alt2, double azi2,
00126                       double alt3, double azi3,
00127                       double minRes, double maxBright, bool visible);
00128 
00129 
00130 
00136     void showLayer(const QString& id, bool b);
00142     bool getShowLayer(const QString& id) const;
00143 
00145     // Other slots
00153     QString insertSkyImage(const QString& uri, const QString& keyHint=QString(), bool show=true);
00154 
00160     void removeSkyLayer(const QString& key);
00161 
00163     QStringList getAllKeys() const {return allSkyLayers.keys();}
00164 
00165 private slots:
00168     void loadingStateChanged(bool b);
00169 
00172     void percentLoadedChanged(int percentage);
00173 
00174 private:
00175 
00177     class SkyLayerElem
00178     {
00179     public:
00180         SkyLayerElem(StelSkyLayerP t, bool show=true);
00181         ~SkyLayerElem();
00182         StelSkyLayerP layer;
00183         QProgressBar* progressBar;
00184         bool show;
00185     };
00186 
00187     SkyLayerElem* skyLayerElemForLayer(const StelSkyLayer*);
00188 
00189     QString keyForLayer(const StelSkyLayer*);
00190 
00192     QMap<QString, SkyLayerElem*> allSkyLayers;
00193 
00194     // Whether to draw at all
00195     bool flagShow;
00196 };
00197 
00198 #endif // _STELSKYLAYERMGR_HPP_
Generated on Sat Aug 25 22:13:30 2012 for Stellarium by  doxygen 1.6.3