00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _STELSKYIMAGETILE_HPP_
00021 #define _STELSKYIMAGETILE_HPP_
00022
00023 #include "StelTextureTypes.hpp"
00024 #include "StelSphereGeometry.hpp"
00025 #include "MultiLevelJsonBase.hpp"
00026
00027 #include <QTimeLine>
00028
00029
00030
00031 class QIODevice;
00032 class StelCore;
00033 class StelPainter;
00034
00036 class ServerCredits
00037 {
00038 public:
00040 QString shortCredits;
00041
00043 QString fullCredits;
00044
00046 QString infoURL;
00047 };
00048
00050 class DataSetCredits
00051 {
00052 public:
00054 QString shortCredits;
00055
00057 QString fullCredits;
00058
00060 QString infoURL;
00061 };
00062
00064 class StelSkyImageTile : public MultiLevelJsonBase
00065 {
00066 Q_OBJECT
00067
00068 friend class StelSkyLayerMgr;
00069
00070 public:
00072 StelSkyImageTile();
00073
00075 StelSkyImageTile(const QString& url, StelSkyImageTile* parent=NULL);
00077 StelSkyImageTile(const QVariantMap& map, StelSkyImageTile* parent);
00078
00080 ~StelSkyImageTile();
00081
00083 void draw(StelCore* core, StelPainter& sPainter, float opacity=1.);
00084
00086 DataSetCredits getDataSetCredits() const {return dataSetCredits;}
00087
00089 ServerCredits getServerCredits() const {return serverCredits;}
00090
00092 bool isReadyToDisplay() const;
00093
00096 QVariantMap toQVariantMap() const;
00097
00099 QString getAbsoluteImageURI() const {return absoluteImageURI;}
00100
00102 virtual QString getLayerDescriptionHtml() const {return htmlDescription;}
00103
00104 protected:
00107 virtual void loadFromQVariantMap(const QVariantMap& map);
00108
00110 ServerCredits serverCredits;
00111
00113 DataSetCredits dataSetCredits;
00114
00116 QString absoluteImageURI;
00117
00119 float luminance;
00120
00122 bool alphaBlend;
00123
00125 bool noTexture;
00126
00128 QList<SphericalRegionP> skyConvexPolygons;
00129
00131 StelTextureSP tex;
00132
00134 float minResolution;
00135
00136 private:
00138 void initCtor();
00139
00142 void getTilesToDraw(QMultiMap<double, StelSkyImageTile*>& result, StelCore* core, const SphericalRegionP& viewPortPoly, float limitLuminance, bool recheckIntersect=true);
00143
00146 bool drawTile(StelCore* core, StelPainter& sPainter);
00147
00149 double getMinResolution() const {return minResolution;}
00150
00152 QVariantList subTilesUrls;
00153
00154
00155 QTimeLine* texFader;
00156
00157 QString htmlDescription;
00158 };
00159
00160 #endif // _STELSKYIMAGETILE_HPP_