StelSkyImageTile.hpp   StelSkyImageTile.hpp 
skipping to change at line 28 skipping to change at line 28
#ifndef _STELSKYIMAGETILE_HPP_ #ifndef _STELSKYIMAGETILE_HPP_
#define _STELSKYIMAGETILE_HPP_ #define _STELSKYIMAGETILE_HPP_
#include "StelTextureTypes.hpp" #include "StelTextureTypes.hpp"
#include "StelSphereGeometry.hpp" #include "StelSphereGeometry.hpp"
#include "MultiLevelJsonBase.hpp" #include "MultiLevelJsonBase.hpp"
#include <QTimeLine> #include <QTimeLine>
//#define DEBUG_STELSKYIMAGE_TILE //#define DEBUG_STELSKYIMAGE_TILE 1
class QIODevice; class QIODevice;
class StelCore; class StelCore;
class StelPainter; class StelPainter;
//! Contain all the credits for a given server hosting the data //! Contain all the credits for a given server hosting the data
class ServerCredits class ServerCredits
{ {
public: public:
//! Very short credit to display in the loading bar //! Very short credit to display in the loading bar
skipping to change at line 67 skipping to change at line 67
//! The URL where to get more info about the data collection //! The URL where to get more info about the data collection
QString infoURL; QString infoURL;
}; };
//! Base class for any astro image with a fixed position //! Base class for any astro image with a fixed position
class StelSkyImageTile : public MultiLevelJsonBase class StelSkyImageTile : public MultiLevelJsonBase
{ {
Q_OBJECT Q_OBJECT
friend class StelSkyImageMgr; friend class StelSkyLayerMgr;
public: public:
//! Default constructor //! Default constructor
StelSkyImageTile() {initCtor();} StelSkyImageTile();
//! Constructor //! Constructor
StelSkyImageTile(const QString& url, StelSkyImageTile* parent=NULL); StelSkyImageTile(const QString& url, StelSkyImageTile* parent=NULL);
//! Constructor //! Constructor
StelSkyImageTile(const QVariantMap& map, StelSkyImageTile* parent); StelSkyImageTile(const QVariantMap& map, StelSkyImageTile* parent);
//! Destructor //! Destructor
~StelSkyImageTile(); ~StelSkyImageTile();
//! Draw the image on the screen. //! Draw the image on the screen.
void draw(StelCore* core, const StelPainter& sPainter); void draw(StelCore* core, StelPainter& sPainter, float opacity=1.);
//! Return the dataset credits to use in the progress bar //! Return the dataset credits to use in the progress bar
DataSetCredits getDataSetCredits() const {return dataSetCredits;} DataSetCredits getDataSetCredits() const {return dataSetCredits;}
//! Return the server credits to use in the progress bar //! Return the server credits to use in the progress bar
ServerCredits getServerCredits() const {return serverCredits;} ServerCredits getServerCredits() const {return serverCredits;}
//! Return true if the tile is fully loaded and can be displayed //! Return true if the tile is fully loaded and can be displayed
bool isReadyToDisplay() const; bool isReadyToDisplay() const;
//! Convert the image informations to a map following the JSON struc ture. //! Convert the image informations to a map following the JSON struc ture.
//! It can be saved as JSON using the StelJsonParser methods. //! It can be saved as JSON using the StelJsonParser methods.
QVariantMap toQVariantMap() const; QVariantMap toQVariantMap() const;
//! Return the absolute path/URL to the image file //! Return the absolute path/URL to the image file
QString getAbsoluteImageURI() const {return absoluteImageURI;} QString getAbsoluteImageURI() const {return absoluteImageURI;}
//! Return an HTML description of the image to be displayed in the G
UI.
virtual QString getLayerDescriptionHtml() const {return htmlDescript
ion;}
protected: protected:
//! Minimum resolution of the data of the texture in degree/pixel //! Reimplement the abstract method.
float minResolution; //! Load the tile from a valid QVariantMap.
virtual void loadFromQVariantMap(const QVariantMap& map);
//! The credits of the server where this data come from //! The credits of the server where this data come from
ServerCredits serverCredits; ServerCredits serverCredits;
//! The credits for the data set //! The credits for the data set
DataSetCredits dataSetCredits; DataSetCredits dataSetCredits;
//! URL where the image is located //! URL where the image is located
QString absoluteImageURI; QString absoluteImageURI;
//! The image luminance in cd/m^2 //! The image luminance in cd/m^2
float luminance; float luminance;
//! Whether the texture must be blended //! Whether the texture must be blended
bool alphaBlend; bool alphaBlend;
//! True if the tile is just a list of other tiles without texture f or itself //! True if the tile is just a list of other tiles without texture f or itself
bool noTexture; bool noTexture;
//! Direction of the vertices of each polygons in ICRS frame //! list of all the polygons.
QList<StelGeom::ConvexPolygon> skyConvexPolygons; QList<SphericalRegionP> skyConvexPolygons;
//! Positions of the vertex of each convex polygons in texture space
QList< QList<Vec2f> > textureCoords;
//! The texture of the tile //! The texture of the tile
StelTextureSP tex; StelTextureSP tex;
protected: //! Minimum resolution of the data of the texture in degree/pixel
float minResolution;
//! Load the tile from a valid QVariantMap
virtual void loadFromQVariantMap(const QVariantMap& map);
private: private:
//! init the StelSkyImageTile //! init the StelSkyImageTile
void initCtor(); void initCtor();
//! Return the list of tiles which should be drawn. //! Return the list of tiles which should be drawn.
//! @param result a map containing resolution, pointer to the tiles //! @param result a map containing resolution, pointer to the tiles
void getTilesToDraw(QMultiMap<double, StelSkyImageTile*>& result, St elCore* core, const StelGeom::ConvexPolygon& viewPortPoly, float limitLumin ance, bool recheckIntersect=true); void getTilesToDraw(QMultiMap<double, StelSkyImageTile*>& result, St elCore* core, const SphericalRegionP& viewPortPoly, float limitLuminance, b ool recheckIntersect=true);
//! Draw the image on the screen. //! Draw the image on the screen.
//! @return true if the tile was actually displayed //! @return true if the tile was actually displayed
bool drawTile(StelCore* core, const StelPainter& sPainter); bool drawTile(StelCore* core, StelPainter& sPainter);
//! Return the minimum resolution //! Return the minimum resolution
double getMinResolution() const {return minResolution;} double getMinResolution() const {return minResolution;}
//! The list of all the subTiles URL or already loaded JSON map for
this tile
QVariantList subTilesUrls;
// Used for smooth fade in // Used for smooth fade in
QTimeLine* texFader; QTimeLine* texFader;
#ifdef DEBUG_STELSKYIMAGE_TILE QString htmlDescription;
static class StelFont* debugFont;
#endif
}; };
#endif // _STELSKYIMAGETILE_HPP_ #endif // _STELSKYIMAGETILE_HPP_
 End of changes. 12 change blocks. 
20 lines changed or deleted 23 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/