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

StelSkyImageTile.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., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
00017  */
00018 
00019 
00020 #ifndef _STELSKYIMAGETILE_HPP_
00021 #define _STELSKYIMAGETILE_HPP_
00022 
00023 #include <QTimeLine>
00024 
00025 #include "MultiLevelJsonBase.hpp"
00026 #include "StelSphereGeometry.hpp"
00027 
00028 //#define DEBUG_STELSKYIMAGE_TILE 1
00029 
00030 class QIODevice;
00031 class StelCore;
00032 
00034 class ServerCredits
00035 {
00036 public:
00038     QString shortCredits;
00039 
00041     QString fullCredits;
00042 
00044     QString infoURL;
00045 };
00046 
00048 class DataSetCredits
00049 {
00050 public:
00052     QString shortCredits;
00053 
00055     QString fullCredits;
00056 
00058     QString infoURL;
00059 };
00060 
00062 class StelSkyImageTile : public MultiLevelJsonBase
00063 {
00064     Q_OBJECT
00065 
00066     friend class StelSkyLayerMgr;
00067 
00068 public:
00070     StelSkyImageTile();
00071 
00073     StelSkyImageTile(const QString& url, StelSkyImageTile* parent=NULL);
00075     StelSkyImageTile(const QVariantMap& map, StelSkyImageTile* parent);
00076 
00078     ~StelSkyImageTile();
00079 
00081     void draw(StelCore* core, class StelRenderer* renderer, StelProjectorP projector, float opacity=1.);
00082 
00084     DataSetCredits getDataSetCredits() const {return dataSetCredits;}
00085 
00087     ServerCredits getServerCredits() const {return serverCredits;}
00088 
00090     bool isReadyToDisplay() const;
00091 
00094     QVariantMap toQVariantMap() const;
00095 
00097     QString getAbsoluteImageURI() const {return absoluteImageURI;}
00098 
00100     virtual QString getLayerDescriptionHtml() const {return htmlDescription;}
00101 
00102 protected:
00105     virtual void loadFromQVariantMap(const QVariantMap& map);
00106 
00108     ServerCredits serverCredits;
00109 
00111     DataSetCredits dataSetCredits;
00112 
00114     QString absoluteImageURI;
00115 
00117     float luminance;
00118 
00120     bool alphaBlend;
00121 
00123     bool noTexture;
00124 
00126     QList<SphericalRegionP> skyConvexPolygons;
00127 
00129     class StelTextureNew* tex;
00130 
00132     float minResolution;
00133 
00134 private:
00136     void initCtor();
00137 
00140     void getTilesToDraw(QMultiMap<double, StelSkyImageTile*>& result, 
00141                         StelCore* core, 
00142                         StelRenderer* renderer,
00143                         const SphericalRegionP& viewPortPoly,
00144                         float limitLuminance, 
00145                         bool recheckIntersect=true);
00146 
00149     bool drawTile(StelCore* core, StelRenderer* renderer, StelProjectorP projector);
00150 
00152     double getMinResolution() const {return minResolution;}
00153 
00155     QVariantList subTilesUrls;
00156 
00157     // Used for smooth fade in
00158     QTimeLine* texFader;
00159 
00160     QString htmlDescription;
00161 };
00162 
00163 #endif // _STELSKYIMAGETILE_HPP_
Generated on Thu Jan 31 14:05:40 2013 for Stellarium by  doxygen 1.6.3