Stellarium 0.15.2
StelSkyLayer.hpp
1 /*
2  * Copyright (C) 2009 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 STELSKYLAYER_HPP
20 #define STELSKYLAYER_HPP
21 
22 #include "StelCore.hpp"
23 
24 #include <QObject>
25 #include <QString>
26 #include <QSharedPointer>
27 
28 class StelCore;
29 class StelPainter;
30 
34 class StelSkyLayer : public QObject
35 {
36  Q_OBJECT
37 public:
38  StelSkyLayer(QObject* parent=NULL) : QObject(parent), frameType(StelCore::FrameJ2000) {;}
39 
41  virtual void draw(StelCore* core, StelPainter& sPainter, float opacity=1.)=0;
42 
44  virtual QString getShortName() const =0;
45 
47  virtual QString getShortServerCredits() const {return QString();}
48 
51  virtual QString getKeyHint() const {return getShortName();}
52 
55  virtual QString getLayerDescriptionHtml() const {return "No description.";}
56 
58  void setFrameType(StelCore::FrameType ft) {frameType = ft;}
59 
61  StelCore::FrameType getFrameType() {return frameType;}
62 
63 signals:
66  void loadingStateChanged(bool b);
67 
70  void percentLoadedChanged(int percentage);
71 private:
73  StelCore::FrameType frameType;
74 };
75 
78 
81 typedef QSharedPointer<StelSkyLayer> StelSkyLayerP;
82 
83 #endif // STELSKYLAYER_HPP
void percentLoadedChanged(int percentage)
Emitted when the percentage of loading tiles/tiles to be displayed changed.
virtual QString getLayerDescriptionHtml() const
Return a human readable description of the layer with e.g.
Equatorial reference frame at the J2000 equinox centered on the observer. This is also the ICRS refer...
Definition: StelCore.hpp:79
StelCore::FrameType getFrameType()
Get the reference frame type.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual QString getKeyHint() const
Return a hint on which key to use for referencing this layer.
FrameType
Supported reference frame types.
Definition: StelCore.hpp:69
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
virtual QString getShortName() const =0
Return the short name to display in the loading bar.
void loadingStateChanged(bool b)
Emitted when loading of data started or stopped.
Abstract class defining the API to implement for all sky layer.
virtual QString getShortServerCredits() const
Return the short server name to display in the loading bar.
virtual void draw(StelCore *core, StelPainter &sPainter, float opacity=1.)=0
Draws the content of the layer.
void setFrameType(StelCore::FrameType ft)
Set the reference frame type.