Stellarium 0.13.0
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 "StelSphereGeometry.hpp"
23 #include "MultiLevelJsonBase.hpp"
24 #include "StelSkyImageTile.hpp"
25 #include <QTimeLine>
26 #include <QOpenGLFunctions>
27 
28 class StelCore;
29 
31 class StelSkyPolygon : public MultiLevelJsonBase, protected QOpenGLFunctions
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, StelPainter& sPainter, 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(StelCore* core);
92 
94  double getMinResolution() const {return minResolution;}
95 
96  // Used for smooth fade in
97  QTimeLine* texFader;
98 };
99 
100 #endif // _STELSKYPOLYGON_HPP_
DataSetCredits dataSetCredits
The credits for the data set.
Definition: StelSkyPolygon.hpp:68
virtual void loadFromQVariantMap(const QVariantMap &map)
Load the polygon from a valid QVariantMap.
Contain all the credits for a given server hosting the data.
Definition: StelSkyImageTile.hpp:36
Abstract base class for managing multi-level tree objects stored in JSON format.
Definition: MultiLevelJsonBase.hpp:34
A shared pointer on a SphericalRegion.
Definition: StelSphereGeometry.hpp:51
ServerCredits getServerCredits() const
Return the server credits to use in the progress bar.
Definition: StelSkyPolygon.hpp:54
DataSetCredits getDataSetCredits() const
Return the dataset credits to use in the progress bar.
Definition: StelSkyPolygon.hpp:51
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
void draw(StelCore *core, StelPainter &sPainter, float opacity=1.)
Draw the image on the screen.
ServerCredits serverCredits
The credits of the server where this data come from.
Definition: StelSkyPolygon.hpp:65
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:71
Base class for any polygon with a fixed position in the sky.
Definition: StelSkyPolygon.hpp:31
QList< SphericalConvexPolygon > skyConvexPolygons
Direction of the vertices of the convex hull in ICRS frame.
Definition: StelSkyPolygon.hpp:71
StelSkyPolygon()
Default constructor.
Definition: StelSkyPolygon.hpp:37
Contains all the credits for the creator of the image collection.
Definition: StelSkyImageTile.hpp:50
~StelSkyPolygon()
Destructor.
Define all SphericalGeometry primitives as well as the SphericalRegionP type.
QVariantMap toQVariantMap() const
Convert the polygon informations to a map following the JSON structure.
float minResolution
Minimum resolution at which the next level needs to be loaded in degree/pixel.
Definition: StelSkyPolygon.hpp:62