Stellarium 0.14.3
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 
27 class StelCore;
28 
31 {
32  Q_OBJECT
33 
34 public:
36  StelSkyPolygon() {initCtor();}
37 
39  StelSkyPolygon(const QString& url, StelSkyPolygon* parent=NULL);
41  StelSkyPolygon(const QVariantMap& map, StelSkyPolygon* parent);
42 
45 
47  void draw(StelCore* core, StelPainter& sPainter, float opacity=1.);
48 
51 
54 
57  QVariantMap toQVariantMap() const;
58 
59 protected:
62 
65 
68 
70  QList<SphericalConvexPolygon> skyConvexPolygons;
71 
72 protected:
73 
75  virtual void loadFromQVariantMap(const QVariantMap& map);
76 
77 private:
79  QVariantList subTilesUrls;
80 
82  void initCtor();
83 
86  void getTilesToDraw(QMultiMap<double, StelSkyPolygon*>& result, StelCore* core, const SphericalRegionP& viewPortPoly, bool recheckIntersect=true);
87 
90  bool drawTile(StelCore* core);
91 
93  double getMinResolution() const {return minResolution;}
94 
95  // Used for smooth fade in
96  QTimeLine* texFader;
97 };
98 
99 #endif // _STELSKYPOLYGON_HPP_
DataSetCredits dataSetCredits
The credits for the data set.
virtual void loadFromQVariantMap(const QVariantMap &map)
Load the polygon from a valid QVariantMap.
Contain all the credits for a given server hosting the data.
Abstract base class for managing multi-level tree objects stored in JSON format.
A shared pointer on a SphericalRegion.
ServerCredits getServerCredits() const
Return the server credits to use in the progress bar.
DataSetCredits getDataSetCredits() const
Return the dataset credits to use in the progress bar.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
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.
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
Base class for any polygon with a fixed position in the sky.
QList< SphericalConvexPolygon > skyConvexPolygons
Direction of the vertices of the convex hull in ICRS frame.
StelSkyPolygon()
Default constructor.
Contains all the credits for the creator of the image collection.
~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.