Stellarium 0.12.4
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 <QObject>
23 #include <QString>
24 #include <QSharedPointer>
25 #include "StelCore.hpp"
26 
27 #include "StelProjectorType.hpp"
28 
29 class StelCore;
30 
34 class StelSkyLayer : public QObject
35 {
36  Q_OBJECT
37 public:
38  StelSkyLayer(QObject* parent=NULL) : QObject(parent), frameType(StelCore::FrameUninitialized) {;}
39 
41  virtual void draw(StelCore* core, class StelRenderer* renderer, StelProjectorP projector, 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