Stellarium 0.12.4
StelSkyPolygon.hpp
1 /*
2  * Copyright (C) 2008 Fabien Chereau
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17  */
18 
19 #ifndef _STELSKYPOLYGON_HPP_
20 #define _STELSKYPOLYGON_HPP_
21 
22 #include "MultiLevelJsonBase.hpp"
23 #include "StelSphereGeometry.hpp"
24 #include "StelSkyImageTile.hpp"
25 
26 #include <QTimeLine>
27 
28 class StelCore;
29 
32 {
33  Q_OBJECT
34 
35 public:
37  StelSkyPolygon() {initCtor();}
38 
40  StelSkyPolygon(const QString& url, StelSkyPolygon* parent=NULL);
42  StelSkyPolygon(const QVariantMap& map, StelSkyPolygon* parent);
43 
46 
48  void draw(StelCore* core, class StelRenderer* renderer, StelProjectorP projector, float opacity=1.);
49 
52 
55 
58  QVariantMap toQVariantMap() const;
59 
60 protected:
63 
66 
69 
71  QList<SphericalConvexPolygon> skyConvexPolygons;
72 
73 protected:
74 
76  virtual void loadFromQVariantMap(const QVariantMap& map);
77 
78 private:
80  QVariantList subTilesUrls;
81 
83  void initCtor();
84 
87  void getTilesToDraw(QMultiMap<double, StelSkyPolygon*>& result, StelCore* core, const SphericalRegionP& viewPortPoly, bool recheckIntersect=true);
88 
91  bool drawTile(class StelRenderer* renderer, StelProjectorP projector);
92 
94  double getMinResolution() const {return minResolution;}
95 
96  // Used for smooth fade in
97  QTimeLine* texFader;
98 };
99 
100 #endif // _STELSKYPOLYGON_HPP_