Stellarium 0.14.0
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 longitudeLineDisplayed
98  NOTIFY longitudeLineDisplayedChanged)
99  Q_PROPERTY(Vec3f longitudeLineColor
102  NOTIFY longitudeLineColorChanged)
103  Q_PROPERTY(bool horizonLineDisplayed
104  READ getFlagHorizonLine
105  WRITE setFlagHorizonLine
106  NOTIFY horizonLineDisplayedChanged)
107  Q_PROPERTY(Vec3f horizonLineColor
109  WRITE setColorHorizonLine
110  NOTIFY horizonLineColorChanged)
111  Q_PROPERTY(bool galacticEquatorLineDisplayed
114  NOTIFY galacticEquatorLineDisplayedChanged)
115  Q_PROPERTY(Vec3f galacticEquatorLineColor
118  NOTIFY galacticEquatorLineColorChanged)
119 
120 public:
121  GridLinesMgr();
122  virtual ~GridLinesMgr();
123 
125  // Methods defined in the StelModule class
130  virtual void init();
131 
133  virtual QString getModuleID() const {return "GridLinesMgr";}
134 
139  virtual void draw(StelCore* core);
140 
143  virtual void update(double deltaTime);
144 
146  virtual double getCallOrder(StelModuleActionName actionName) const;
147 
149  // Setter and getters
150 public slots:
152  void setFlagAzimuthalGrid(const bool displayed);
154  bool getFlagAzimuthalGrid(void) const;
156  Vec3f getColorAzimuthalGrid(void) const;
163  void setColorAzimuthalGrid(const Vec3f& newColor);
164 
166  void setFlagEquatorGrid(const bool displayed);
168  bool getFlagEquatorGrid(void) const;
170  Vec3f getColorEquatorGrid(void) const;
177  void setColorEquatorGrid(const Vec3f& newColor);
178 
180  void setFlagEquatorJ2000Grid(const bool displayed);
182  bool getFlagEquatorJ2000Grid(void) const;
184  Vec3f getColorEquatorJ2000Grid(void) const;
191  void setColorEquatorJ2000Grid(const Vec3f& newColor);
192 
194  void setFlagEclipticJ2000Grid(const bool displayed);
196  bool getFlagEclipticJ2000Grid(void) const;
198  Vec3f getColorEclipticJ2000Grid(void) const;
205  void setColorEclipticJ2000Grid(const Vec3f& newColor);
206 
208  void setFlagGalacticGrid(const bool displayed);
210  bool getFlagGalacticGrid(void) const;
212  Vec3f getColorGalacticGrid(void) const;
219  void setColorGalacticGrid(const Vec3f& newColor);
220 
222  void setFlagEquatorLine(const bool displayed);
224  bool getFlagEquatorLine(void) const;
226  Vec3f getColorEquatorLine(void) const;
233  void setColorEquatorLine(const Vec3f& newColor);
234 
236  void setFlagEclipticLine(const bool displayed);
238  bool getFlagEclipticLine(void) const;
240  Vec3f getColorEclipticLine(void) const;
247  void setColorEclipticLine(const Vec3f& newColor);
248 
250  void setFlagMeridianLine(const bool displayed);
252  bool getFlagMeridianLine(void) const;
254  Vec3f getColorMeridianLine(void) const;
261  void setColorMeridianLine(const Vec3f& newColor);
262 
264  void setFlagLongitudeLine(const bool displayed);
266  bool getFlagLongitudeLine(void) const;
268  Vec3f getColorLongitudeLine(void) const;
275  void setColorLongitudeLine(const Vec3f& newColor);
276 
278  void setFlagHorizonLine(const bool displayed);
280  bool getFlagHorizonLine(void) const;
282  Vec3f getColorHorizonLine(void) const;
289  void setColorHorizonLine(const Vec3f& newColor);
290 
292  void setFlagGalacticEquatorLine(const bool displayed);
295  void setFlagGalacticPlaneLine(const bool displayed) { setFlagGalacticEquatorLine(displayed); }
297  bool getFlagGalacticEquatorLine(void) const;
309  void setColorGalacticEquatorLine(const Vec3f& newColor);
310 signals:
311  void azimuthalGridDisplayedChanged(const bool) const;
312  void azimuthalGridColorChanged(const Vec3f & newColor) const;
313  void equatorGridDisplayedChanged(const bool displayed) const;
314  void equatorGridColorChanged(const Vec3f & newColor) const;
315  void equatorJ2000GridDisplayedChanged(const bool displayed) const;
316  void equatorJ2000GridColorChanged(const Vec3f & newColor) const;
317  void eclipticJ2000GridDisplayedChanged(const bool displayed) const;
318  void eclipticJ2000GridColorChanged(const Vec3f & newColor) const;
319  void galacticGridDisplayedChanged(const bool displayed) const;
320  void galacticGridColorChanged(const Vec3f & newColor) const;
321  void equatorLineDisplayedChanged(const bool displayed) const;
322  void equatorLineColorChanged(const Vec3f & newColor) const;
323  void eclipticLineDisplayedChanged(const bool displayed) const;
324  void eclipticLineColorChanged(const Vec3f & newColor) const;
325  void meridianLineDisplayedChanged(const bool displayed) const;
326  void meridianLineColorChanged(const Vec3f & newColor) const;
327  void longitudeLineDisplayedChanged(const bool displayed) const;
328  void longitudeLineColorChanged(const Vec3f & newColor) const;
329  void horizonLineDisplayedChanged(const bool displayed) const;
330  void horizonLineColorChanged(const Vec3f & newColor) const;
331  void galacticEquatorLineDisplayedChanged(const bool displayed) const;
332  void galacticEquatorLineColorChanged(const Vec3f & newColor) const;
333 
334 
335 private slots:
338  void setStelStyle(const QString& section);
341  void updateLineLabels();
342 
343 private:
344  SkyGrid * equGrid; // Equatorial grid
345  SkyGrid * equJ2000Grid; // Equatorial J2000 grid
346  SkyGrid * galacticGrid; // Galactic grid
347  SkyGrid * eclJ2000Grid; // Ecliptic J2000 grid
348  SkyGrid * aziGrid; // Azimuthal grid
349  SkyLine * equatorLine; // Celestial Equator line
350  SkyLine * eclipticLine; // Ecliptic line
351  SkyLine * meridianLine; // Meridian line
352  SkyLine * longitudeLine; // Opposition/conjunction longitude line
353  SkyLine * horizonLine; // Horizon line
354  SkyLine * galacticEquatorLine; // line depicting the Galactic equator as defined by the IAU definition of Galactic coordinates (System II, 1958)
355 };
356 
357 #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 setColorLongitudeLine(const Vec3f &newColor)
Set the color of the opposition/conjunction longitude line.
void setFlagGalacticGrid(const bool displayed)
Setter for displaying Galactic Grid.
bool getFlagLongitudeLine(void) const
Accessor for displaying opposition/conjunction longitude line.
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.
Vec3f getColorLongitudeLine(void) const
Get the current color of the opposition/conjunction longitude line.
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.
void setFlagLongitudeLine(const bool displayed)
Setter for displaying opposition/conjunction longitude line.
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.