Stellarium  0.90.0
CompassMarks.hpp
1 /*
2  * Copyright (C) 2009 Matthew Gates
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 COMPASSMARKS_HPP_
20 #define COMPASSMARKS_HPP_
21 
22 #include "VecMath.hpp"
23 #include "StelModule.hpp"
24 #include "StelFader.hpp"
25 #include <QFont>
26 
27 class StelButton;
28 
38 class CompassMarks : public StelModule
44 {
45  Q_OBJECT
46  Q_PROPERTY(bool marksVisible READ getCompassMarks WRITE setCompassMarks NOTIFY compassMarksChanged)
47 public:
48  CompassMarks();
49  virtual ~CompassMarks();
50 
52  // Methods defined in the StelModule class
53  virtual void init();
54  virtual void update(double deltaTime);
55  virtual void draw(StelCore* core);
56  virtual double getCallOrder(StelModuleActionName actionName) const;
57 
63  void loadConfiguration();
64 
65  void restoreDefaultConfiguration();
66 
67 public slots:
69  bool getCompassMarks() const {return markFader;}
70 
73  void setCompassMarks(bool b);
74 
75 signals:
76  void compassMarksChanged(bool);
77 
78 private slots:
79  void cardinalPointsChanged(bool b);
80 
81 private:
82  QSettings* conf;
84  bool displayedAtStartup;
86  QFont font;
87  Vec3f markColor;
88  LinearFader markFader;
89  StelButton* toolbarButton;
90  bool cardinalPointsState;
91 };
92 
93 
94 #include <QObject>
95 #include "StelPluginInterface.hpp"
96 
99 {
100  Q_OBJECT
101  Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
102  Q_INTERFACES(StelPluginInterface)
103 public:
104  virtual StelModule* getStelModule() const;
105  virtual StelPluginInfo getPluginInfo() const;
106  virtual QObjectList getExtensionList() const { return QObjectList(); }
107 };
108 
109 #endif /*COMPASSMARKS_HPP_*/
void loadConfiguration()
Load the plug-in&#39;s settings from the configuration file.
Define the interface to implement when creating a plugin.
Implementation of StelFader which implements a linear transition.
Definition: StelFader.hpp:77
virtual double getCallOrder(StelModuleActionName actionName) const
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
virtual QObjectList getExtensionList() const
A mechanism to provide abitrary QObjects to the StelModuleMgr.
A Button Graphicsitem for use in Stellarium&#39;s graphic widgets.
bool getCompassMarks() const
Get flag for displaying a ring of marks indicating azimuth on the horizon.
StelModuleActionName
Define the possible action for which an order is defined.
Definition: StelModule.hpp:121
Main class of the Compass Marks plug-in.
This class is used by Qt to manage a plug-in interface.
virtual void init()
Initialize itself.
void setCompassMarks(bool b)
Define whether a ring of azimuth marks on the horizon should be visible.
virtual void update(double deltaTime)
Update the module with respect to the time.
This is the common base class for all the main components of stellarium.
Definition: StelModule.hpp:49
Contains information about a Stellarium plugin.