StelSkyImageTile.hpp
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 <QTimeLine>
00024
00025 #include "MultiLevelJsonBase.hpp"
00026 #include "StelSphereGeometry.hpp"
00027
00028
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
00158 QTimeLine* texFader;
00159
00160 QString htmlDescription;
00161 };
00162
00163 #endif // _STELSKYIMAGETILE_HPP_