Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

core/StelSkyImageMgr.hpp

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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  */
00018 
00019 #ifndef _SKYIMAGEMGR_HPP_
00020 #define _SKYIMAGEMGR_HPP_
00021 
00022 #include "StelModule.hpp"
00023 #include <QString>
00024 #include <QStringList>
00025 #include <QMap>
00026 
00027 class StelCore;
00028 class StelSkyImageTile;
00029 class QProgressBar;
00030 
00032 class StelSkyImageMgr : public StelModule
00033 {
00034     Q_OBJECT
00035             
00036 public:
00037     StelSkyImageMgr();
00038     ~StelSkyImageMgr();
00039 
00041     // Methods defined in the StelModule class
00043     virtual void init();
00044     
00046     virtual void draw(StelCore* core);
00047     
00049     virtual void update(double deltaTime) {;}
00050     
00052     virtual void updateI18n() {;}
00053     
00055     virtual double getCallOrder(StelModuleActionName actionName) const;
00056 
00058     // Other specific methods
00061     QString insertSkyImage(StelSkyImageTile* img, bool show=true, bool externallyOwned=true);
00062     
00064     void removeSkyImage(StelSkyImageTile* img);
00065     
00066 public slots:
00068     // Properties setters and getters
00070     void setFlagShow(bool b) {flagShow = b;}
00072     bool getFlagShow() const {return flagShow;}
00073 
00091     bool loadSkyImage(const QString& id, const QString& filename, 
00092                       double ra0, double dec0, 
00093                       double ra1, double dec1, 
00094                       double ra2, double dec2,
00095                       double ra3, double dec3,
00096                       double minRes, double maxBright, bool visible);
00097 
00103     void showImage(const QString& id, bool b);
00109     bool getShowImage(const QString& id);
00110     
00112     // Other slots
00119     QString insertSkyImage(const QString& uri, bool show=true);
00120     
00126     void removeSkyImage(const QString& key);
00127     
00129     QStringList getAllKeys() const {return allSkyImages.keys();}
00130 
00131 private slots:
00134     void loadingStateChanged(bool b);
00135     
00138     void percentLoadedChanged(int percentage);
00139 
00140 private:
00141     class StelSkyImageMgrElem
00142     {
00143     public:
00144         StelSkyImageMgrElem(StelSkyImageTile* t, bool show=true, bool externallyOwned=true);
00145         ~StelSkyImageMgrElem();
00146         StelSkyImageTile* tile;
00147         QProgressBar* progressBar;
00148         bool show;
00149         bool externallyOwned;
00150     };
00151     
00152     StelSkyImageMgrElem* skyBackgroundElemForTile(const StelSkyImageTile*);
00153     
00154     QString keyForTile(const StelSkyImageTile*);
00155     
00157     QMap<QString, StelSkyImageMgrElem*> allSkyImages;
00158     
00159     // Whether to draw at all
00160     bool flagShow;
00161 };
00162 
00163 #endif // _SKYIMAGEMGR_HPP_

Generated on Mon Mar 9 16:16:16 2009 for Stellarium by  doxygen 1.5.5