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

core/StelSkyPolygon.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 #ifndef _STELSKYPOLYGON_HPP_
00020 #define _STELSKYPOLYGON_HPP_
00021 
00022 #include "StelSphereGeometry.hpp"
00023 #include "MultiLevelJsonBase.hpp"
00024 
00025 #include <QTimeLine>
00026 
00027 class StelCore;
00028 
00030 class ServerCredits
00031 {
00032 public:
00034     QString shortCredits;
00035 
00037     QString fullCredits;
00038 
00040     QString infoURL;
00041 };
00042 
00044 class DataSetCredits
00045 {
00046 public:
00048     QString shortCredits;
00049 
00051     QString fullCredits;
00052 
00054     QString infoURL;
00055 };
00056 
00058 class StelSkyPolygon : public MultiLevelJsonBase
00059 {
00060     Q_OBJECT
00061 
00062 public:
00064     StelSkyPolygon() {initCtor();}
00065 
00067     StelSkyPolygon(const QString& url, StelSkyPolygon* parent=NULL);
00069     StelSkyPolygon(const QVariantMap& map, StelSkyPolygon* parent);
00070 
00072     ~StelSkyPolygon();
00073 
00075     void draw(StelCore* core, StelPainter& sPainter, float opacity=1.);
00076 
00078     DataSetCredits getDataSetCredits() const {return dataSetCredits;}
00079 
00081     ServerCredits getServerCredits() const {return serverCredits;}
00082 
00085     QVariantMap toQVariantMap() const;
00086 
00087 protected:
00089     float minResolution;
00090 
00092     ServerCredits serverCredits;
00093 
00095     DataSetCredits dataSetCredits;
00096 
00098     QList<SphericalConvexPolygon> skyConvexPolygons;
00099 
00100 protected:
00101 
00103     virtual void loadFromQVariantMap(const QVariantMap& map);
00104 
00105 private:
00107     QVariantList subTilesUrls;
00108 
00110     void initCtor();
00111 
00114     void getTilesToDraw(QMultiMap<double, StelSkyPolygon*>& result, StelCore* core, const SphericalRegionP& viewPortPoly, bool recheckIntersect=true);
00115 
00118     bool drawTile(StelCore* core);
00119 
00121     double getMinResolution() const {return minResolution;}
00122 
00123     // Used for smooth fade in
00124     QTimeLine* texFader;
00125 };
00126 
00127 #endif // _STELSKYPOLYGON_HPP_
Generated on Thu May 31 10:37:19 2012 for Stellarium by  doxygen 1.6.3