Stellarium 0.13.2
GridLinesMgr.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2007 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef _GRIDLINESMGR_HPP_
21 #define _GRIDLINESMGR_HPP_
22 
23 #include "VecMath.hpp"
24 #include "StelModule.hpp"
25 
26 class SkyGrid;
27 class SkyLine;
28 
32 class GridLinesMgr : public StelModule
33 {
34  Q_OBJECT
35  Q_PROPERTY(bool azimuthalGridDisplayed
38  NOTIFY azimuthalGridDisplayedChanged)
39  Q_PROPERTY(Vec3f azimuthalGridColor
42  NOTIFY azimuthalGridColorChanged)
43  Q_PROPERTY(bool equatorGridDisplayed
45  WRITE setFlagEquatorGrid
46  NOTIFY equatorGridDisplayedChanged)
47  Q_PROPERTY(Vec3f equatorGridColor
50  NOTIFY equatorGridColorChanged)
51  Q_PROPERTY(bool equatorJ2000GridDisplayed
54  NOTIFY equatorJ2000GridDisplayedChanged)
55  Q_PROPERTY(bool eclipticJ2000GridDisplayed
58  NOTIFY eclipticJ2000GridDisplayedChanged)
59  Q_PROPERTY(Vec3f equatorJ2000GridColor
62  NOTIFY equatorJ2000GridColorChanged)
63  Q_PROPERTY(bool galacticGridDisplayed
66  NOTIFY galacticGridDisplayedChanged)
67  Q_PROPERTY(Vec3f galacticGridColor
70  NOTIFY galacticGridColorChanged)
71  Q_PROPERTY(bool equatorLineDisplayed
73  WRITE setFlagEquatorLine
74  NOTIFY equatorLineDisplayedChanged)
75  Q_PROPERTY(Vec3f equatorLineColor
78  NOTIFY equatorLineColorChanged)
79  Q_PROPERTY(bool eclipticLineDisplayed
82  NOTIFY eclipticLineDisplayedChanged)
83  Q_PROPERTY(Vec3f eclipticLineColor
86  NOTIFY eclipticLineColorChanged)
87  Q_PROPERTY(bool meridianLineDisplayed
90  NOTIFY meridianLineDisplayedChanged)
91  Q_PROPERTY(Vec3f meridianLineColor
94  NOTIFY meridianLineColorChanged)
95  Q_PROPERTY(bool horizonLineDisplayed
97  WRITE setFlagHorizonLine
98  NOTIFY horizonLineDisplayedChanged)
99  Q_PROPERTY(Vec3f horizonLineColor
101  WRITE setColorHorizonLine
102  NOTIFY horizonLineColorChanged)
103  Q_PROPERTY(bool galacticEquatorLineDisplayed
106  NOTIFY galacticEquatorLineDisplayedChanged)
107  Q_PROPERTY(Vec3f galacticEquatorLineColor
110  NOTIFY galacticEquatorLineColorChanged)
111 
112 public:
113  GridLinesMgr();
114  virtual ~GridLinesMgr();
115 
117  // Methods defined in the StelModule class
122  virtual void init();
123 
125  virtual QString getModuleID() const {return "GridLinesMgr";}
126 
131  virtual void draw(StelCore* core);
132 
135  virtual void update(double deltaTime);
136 
138  virtual double getCallOrder(StelModuleActionName actionName) const;
139 
141  // Setter and getters
142 public slots:
144  void setFlagAzimuthalGrid(const bool displayed);
146  bool getFlagAzimuthalGrid(void) const;
148  Vec3f getColorAzimuthalGrid(void) const;
155  void setColorAzimuthalGrid(const Vec3f& newColor);
156 
158  void setFlagEquatorGrid(const bool displayed);
160  bool getFlagEquatorGrid(void) const;
162  Vec3f getColorEquatorGrid(void) const;
169  void setColorEquatorGrid(const Vec3f& newColor);
170 
172  void setFlagEquatorJ2000Grid(const bool displayed);
174  bool getFlagEquatorJ2000Grid(void) const;
176  Vec3f getColorEquatorJ2000Grid(void) const;
183  void setColorEquatorJ2000Grid(const Vec3f& newColor);
184 
186  void setFlagEclipticJ2000Grid(const bool displayed);
188  bool getFlagEclipticJ2000Grid(void) const;
190  Vec3f getColorEclipticJ2000Grid(void) const;
197  void setColorEclipticJ2000Grid(const Vec3f& newColor);
198 
200  void setFlagGalacticGrid(const bool displayed);
202  bool getFlagGalacticGrid(void) const;
204  Vec3f getColorGalacticGrid(void) const;
211  void setColorGalacticGrid(const Vec3f& newColor);
212 
214  void setFlagEquatorLine(const bool displayed);
216  bool getFlagEquatorLine(void) const;
218  Vec3f getColorEquatorLine(void) const;
225  void setColorEquatorLine(const Vec3f& newColor);
226 
228  void setFlagEclipticLine(const bool displayed);
230  bool getFlagEclipticLine(void) const;
232  Vec3f getColorEclipticLine(void) const;
239  void setColorEclipticLine(const Vec3f& newColor);
240 
242  void setFlagMeridianLine(const bool displayed);
244  bool getFlagMeridianLine(void) const;
246  Vec3f getColorMeridianLine(void) const;
253  void setColorMeridianLine(const Vec3f& newColor);
254 
256  void setFlagHorizonLine(const bool displayed);
258  bool getFlagHorizonLine(void) const;
260  Vec3f getColorHorizonLine(void) const;
267  void setColorHorizonLine(const Vec3f& newColor);
268 
270  void setFlagGalacticEquatorLine(const bool displayed);
273  void setFlagGalacticPlaneLine(const bool displayed) { setFlagGalacticEquatorLine(displayed); }
275  bool getFlagGalacticEquatorLine(void) const;
287  void setColorGalacticEquatorLine(const Vec3f& newColor);
288 signals:
289  void azimuthalGridDisplayedChanged(const bool) const;
290  void azimuthalGridColorChanged(const Vec3f & newColor) const;
291  void equatorGridDisplayedChanged(const bool displayed) const;
292  void equatorGridColorChanged(const Vec3f & newColor) const;
293  void equatorJ2000GridDisplayedChanged(const bool displayed) const;
294  void equatorJ2000GridColorChanged(const Vec3f & newColor) const;
295  void eclipticJ2000GridDisplayedChanged(const bool displayed) const;
296  void eclipticJ2000GridColorChanged(const Vec3f & newColor) const;
297  void galacticGridDisplayedChanged(const bool displayed) const;
298  void galacticGridColorChanged(const Vec3f & newColor) const;
299  void equatorLineDisplayedChanged(const bool displayed) const;
300  void equatorLineColorChanged(const Vec3f & newColor) const;
301  void eclipticLineDisplayedChanged(const bool displayed) const;
302  void eclipticLineColorChanged(const Vec3f & newColor) const;
303  void meridianLineDisplayedChanged(const bool displayed) const;
304  void meridianLineColorChanged(const Vec3f & newColor) const;
305  void horizonLineDisplayedChanged(const bool displayed) const;
306  void horizonLineColorChanged(const Vec3f & newColor) const;
307  void galacticEquatorLineDisplayedChanged(const bool displayed) const;
308  void galacticEquatorLineColorChanged(const Vec3f & newColor) const;
309 
310 
311 private slots:
314  void setStelStyle(const QString& section);
317  void updateLineLabels();
318 
319 private:
320  SkyGrid * equGrid; // Equatorial grid
321  SkyGrid * equJ2000Grid; // Equatorial J2000 grid
322  SkyGrid * galacticGrid; // Galactic grid
323  SkyGrid * eclJ2000Grid; // Ecliptic J2000 grid
324  SkyGrid * aziGrid; // Azimuthal grid
325  SkyLine * equatorLine; // Celestial Equator line
326  SkyLine * eclipticLine; // Ecliptic line
327  SkyLine * meridianLine; // Meridian line
328  SkyLine * horizonLine; // Horizon line
329  SkyLine * galacticEquatorLine; // line depicting the Galactic equator as defined by the IAU definition of Galactic coordinates (System II, 1958)
330 };
331 
332 #endif // _GRIDLINESMGR_HPP_
virtual void draw(StelCore *core)
Draw the grids and great circle lines.
void setColorEclipticLine(const Vec3f &newColor)
Set the color of the Ecliptic Line.
void setFlagEquatorJ2000Grid(const bool displayed)
Setter for displaying Equatorial Grid.
Vec3f getColorEquatorGrid(void) const
Get the current color of the Equatorial Grid.
Vec3f getColorAzimuthalGrid(void) const
Get the current color of the Azimuthal Grid.
void setColorEquatorLine(const Vec3f &newColor)
Set the color of the Equator Line.
void setFlagGalacticGrid(const bool displayed)
Setter for displaying Galactic Grid.
bool getFlagGalacticPlaneLine(void) const
void setColorEquatorJ2000Grid(const Vec3f &newColor)
Set the color of the Equatorial J2000 Grid.
virtual void init()
Initialize the GridLinesMgr.
void setFlagEclipticJ2000Grid(const bool displayed)
Setter for displaying Ecliptic Grid.
void setFlagGalacticPlaneLine(const bool displayed)
Vec3f getColorHorizonLine(void) const
Get the current color of the Horizon Line.
void setFlagEquatorLine(const bool displayed)
Setter for displaying Equatorial Line.
void setFlagEquatorGrid(const bool displayed)
Setter for displaying Equatorial Grid.
Vec3f getColorEclipticJ2000Grid(void) const
Get the current color of the Ecliptic J2000 Grid.
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
bool getFlagEclipticJ2000Grid(void) const
Accessor for displaying Ecliptic Grid.
void setColorEquatorGrid(const Vec3f &newColor)
Set the color of the Equatorial Grid.
bool getFlagEclipticLine(void) const
Accessor for displaying Ecliptic Line.
void setColorEclipticJ2000Grid(const Vec3f &newColor)
Set the color of the Ecliptic J2000 Grid.
Vec3f getColorGalacticGrid(void) const
Get the current color of the Galactic Grid.
The GridLinesMgr controls the drawing of the Azimuthal and Equatorial Grids, as well as the great cir...
virtual QString getModuleID() const
Get the module ID, returns, "gridlines".
bool getFlagGalacticGrid(void) const
Accessor for displaying Galactic Grid.
void setFlagGalacticEquatorLine(const bool displayed)
Setter for displaying Galactic Equator Line.
void setFlagAzimuthalGrid(const bool displayed)
Setter for displaying Azimuthal Grid.
virtual double getCallOrder(StelModuleActionName actionName) const
Used to determine the order in which the various modules are drawn.
bool getFlagGalacticEquatorLine(void) const
Accessor for displaying Galactic Equator Line.
bool getFlagEquatorJ2000Grid(void) const
Accessor for displaying Equatorial Grid.
Vec3f getColorEquatorJ2000Grid(void) const
Get the current color of the Equatorial J2000 Grid.
void setColorGalacticEquatorLine(const Vec3f &newColor)
Set the color of the Galactic Equator Line.
void setColorMeridianLine(const Vec3f &newColor)
Set the color of the Meridian Line.
Vec3f getColorEclipticLine(void) const
Get the current color of the Ecliptic Line.
void setColorHorizonLine(const Vec3f &newColor)
Set the color of the Horizon Line.
StelModuleActionName
Define the possible action for which an order is defined.
Definition: StelModule.hpp:117
virtual void update(double deltaTime)
Update time-dependent features.
Vec3f getColorMeridianLine(void) const
Get the current color of the Meridian Line.
void setColorGalacticGrid(const Vec3f &newColor)
Set the color of the Galactic Grid.
void setFlagEclipticLine(const bool displayed)
Setter for displaying Ecliptic Line.
bool getFlagHorizonLine(void) const
Accessor for displaying Horizon Line.
bool getFlagAzimuthalGrid(void) const
Accessor for displaying Azimuthal Grid.
Vec3f getColorEquatorLine(void) const
Get the current color of the Equatorial Line.
Vec3f getColorGalacticEquatorLine(void) const
Get the current color of the Galactic Equator Line.
bool getFlagEquatorLine(void) const
Accessor for displaying Equatorial Line.
void setFlagHorizonLine(const bool displayed)
Setter for displaying Horizon Line.
void setColorAzimuthalGrid(const Vec3f &newColor)
Set the color of the Azimuthal Grid.
This is the common base class for all the main components of stellarium.
Definition: StelModule.hpp:49
bool getFlagEquatorGrid(void) const
Accessor for displaying Equatorial Grid.
bool getFlagMeridianLine(void) const
Accessor for displaying Meridian Line.
void setFlagMeridianLine(const bool displayed)
Setter for displaying Meridian Line.