Stellarium 0.15.0
GridLinesMgr.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2007 Fabien Chereau
4  * Copyright (C) 2015 Georg Zotti (more grids to illustrate precession issues)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19  */
20 
21 #ifndef _GRIDLINESMGR_HPP_
22 #define _GRIDLINESMGR_HPP_
23 
24 #include "VecMath.hpp"
25 #include "StelModule.hpp"
26 
27 class SkyGrid;
28 class SkyLine;
29 
34 class GridLinesMgr : public StelModule
35 {
36  Q_OBJECT
37  Q_PROPERTY(bool azimuthalGridDisplayed
40  NOTIFY azimuthalGridDisplayedChanged)
41  Q_PROPERTY(Vec3f azimuthalGridColor
44  NOTIFY azimuthalGridColorChanged)
45 
46  Q_PROPERTY(bool equatorGridDisplayed
48  WRITE setFlagEquatorGrid
49  NOTIFY equatorGridDisplayedChanged)
50  Q_PROPERTY(Vec3f equatorGridColor
53  NOTIFY equatorGridColorChanged)
54 
55  Q_PROPERTY(bool equatorJ2000GridDisplayed
58  NOTIFY equatorJ2000GridDisplayedChanged)
59  Q_PROPERTY(Vec3f equatorJ2000GridColor
62  NOTIFY equatorJ2000GridColorChanged)
63 
64  Q_PROPERTY(bool eclipticJ2000GridDisplayed
67  NOTIFY eclipticJ2000GridDisplayedChanged)
68  Q_PROPERTY(Vec3f eclipticJ2000GridColor
71  NOTIFY eclipticJ2000GridColorChanged)
72  // NEW
73  Q_PROPERTY(bool eclipticGridDisplayed
76  NOTIFY eclipticGridDisplayedChanged)
77  Q_PROPERTY(Vec3f eclipticGridColor
80  NOTIFY eclipticGridColorChanged)
81 
82  Q_PROPERTY(bool galacticGridDisplayed
85  NOTIFY galacticGridDisplayedChanged)
86  Q_PROPERTY(Vec3f galacticGridColor
89  NOTIFY galacticGridColorChanged)
90 
91  Q_PROPERTY(bool equatorLineDisplayed
93  WRITE setFlagEquatorLine
94  NOTIFY equatorLineDisplayedChanged)
95  Q_PROPERTY(Vec3f equatorLineColor
98  NOTIFY equatorLineColorChanged)
99 
100  Q_PROPERTY(bool equatorJ2000LineDisplayed
103  NOTIFY equatorJ2000LineDisplayedChanged)
104  Q_PROPERTY(Vec3f equatorJ2000LineColor
107  NOTIFY equatorJ2000LineColorChanged)
108 
109  // This is now ecl. of date.
110  Q_PROPERTY(bool eclipticLineDisplayed
112  WRITE setFlagEclipticLine
113  NOTIFY eclipticLineDisplayedChanged)
114  Q_PROPERTY(Vec3f eclipticLineColor
117  NOTIFY eclipticLineColorChanged)
118 
119  // new name, but replaces old ecliptic.
120  Q_PROPERTY(bool eclipticJ2000LineDisplayed
123  NOTIFY eclipticJ2000LineDisplayedChanged)
124  Q_PROPERTY(Vec3f eclipticJ2000LineColor
127  NOTIFY eclipticJ2000LineColorChanged)
128 
129  Q_PROPERTY(bool precessionCirclesDisplayed
132  NOTIFY precessionCirclesDisplayedChanged)
133  Q_PROPERTY(Vec3f precessionCirclesColor
136  NOTIFY precessionCirclesColorChanged)
137 
138  Q_PROPERTY(bool meridianLineDisplayed
140  WRITE setFlagMeridianLine
141  NOTIFY meridianLineDisplayedChanged)
142  Q_PROPERTY(Vec3f meridianLineColor
145  NOTIFY meridianLineColorChanged)
146 
147  Q_PROPERTY(bool longitudeLineDisplayed
150  NOTIFY longitudeLineDisplayedChanged)
151  Q_PROPERTY(Vec3f longitudeLineColor
154  NOTIFY longitudeLineColorChanged)
155 
156  Q_PROPERTY(bool horizonLineDisplayed
157  READ getFlagHorizonLine
158  WRITE setFlagHorizonLine
159  NOTIFY horizonLineDisplayedChanged)
160  Q_PROPERTY(Vec3f horizonLineColor
162  WRITE setColorHorizonLine
163  NOTIFY horizonLineColorChanged)
164 
165  Q_PROPERTY(bool galacticEquatorLineDisplayed
168  NOTIFY galacticEquatorLineDisplayedChanged)
169  Q_PROPERTY(Vec3f galacticEquatorLineColor
172  NOTIFY galacticEquatorLineColorChanged)
173 
174 public:
175  GridLinesMgr();
176  virtual ~GridLinesMgr();
177 
179  // Methods defined in the StelModule class
184  virtual void init();
185 
187  virtual QString getModuleID() const {return "GridLinesMgr";}
188 
193  virtual void draw(StelCore* core);
194 
197  virtual void update(double deltaTime);
198 
200  virtual double getCallOrder(StelModuleActionName actionName) const;
201 
203  // Setter and getters
204 public slots:
206  void setFlagAzimuthalGrid(const bool displayed);
208  bool getFlagAzimuthalGrid(void) const;
210  Vec3f getColorAzimuthalGrid(void) const;
217  void setColorAzimuthalGrid(const Vec3f& newColor);
218 
220  void setFlagEquatorGrid(const bool displayed);
222  bool getFlagEquatorGrid(void) const;
224  Vec3f getColorEquatorGrid(void) const;
231  void setColorEquatorGrid(const Vec3f& newColor);
232 
234  void setFlagEquatorJ2000Grid(const bool displayed);
236  bool getFlagEquatorJ2000Grid(void) const;
238  Vec3f getColorEquatorJ2000Grid(void) const;
245  void setColorEquatorJ2000Grid(const Vec3f& newColor);
246 
248  void setFlagEclipticJ2000Grid(const bool displayed);
250  bool getFlagEclipticJ2000Grid(void) const;
252  Vec3f getColorEclipticJ2000Grid(void) const;
259  void setColorEclipticJ2000Grid(const Vec3f& newColor);
260 
262  void setFlagEclipticGrid(const bool displayed);
264  bool getFlagEclipticGrid(void) const;
266  Vec3f getColorEclipticGrid(void) const;
273  void setColorEclipticGrid(const Vec3f& newColor);
274 
276  void setFlagGalacticGrid(const bool displayed);
278  bool getFlagGalacticGrid(void) const;
280  Vec3f getColorGalacticGrid(void) const;
287  void setColorGalacticGrid(const Vec3f& newColor);
288 
290  void setFlagEquatorLine(const bool displayed);
292  bool getFlagEquatorLine(void) const;
294  Vec3f getColorEquatorLine(void) const;
301  void setColorEquatorLine(const Vec3f& newColor);
302 
304  void setFlagEquatorJ2000Line(const bool displayed);
306  bool getFlagEquatorJ2000Line(void) const;
308  Vec3f getColorEquatorJ2000Line(void) const;
315  void setColorEquatorJ2000Line(const Vec3f& newColor);
316 
318  void setFlagEclipticJ2000Line(const bool displayed);
320  bool getFlagEclipticJ2000Line(void) const;
322  Vec3f getColorEclipticJ2000Line(void) const;
329  void setColorEclipticJ2000Line(const Vec3f& newColor);
330 
332  void setFlagEclipticLine(const bool displayed);
334  bool getFlagEclipticLine(void) const;
336  Vec3f getColorEclipticLine(void) const;
343  void setColorEclipticLine(const Vec3f& newColor);
344 
346  void setFlagPrecessionCircles(const bool displayed);
348  bool getFlagPrecessionCircles(void) const;
350  Vec3f getColorPrecessionCircles(void) const;
357  void setColorPrecessionCircles(const Vec3f& newColor);
358 
360  void setFlagMeridianLine(const bool displayed);
362  bool getFlagMeridianLine(void) const;
364  Vec3f getColorMeridianLine(void) const;
371  void setColorMeridianLine(const Vec3f& newColor);
372 
374  void setFlagLongitudeLine(const bool displayed);
376  bool getFlagLongitudeLine(void) const;
378  Vec3f getColorLongitudeLine(void) const;
385  void setColorLongitudeLine(const Vec3f& newColor);
386 
388  void setFlagHorizonLine(const bool displayed);
390  bool getFlagHorizonLine(void) const;
392  Vec3f getColorHorizonLine(void) const;
399  void setColorHorizonLine(const Vec3f& newColor);
400 
402  void setFlagGalacticEquatorLine(const bool displayed);
405  void setFlagGalacticPlaneLine(const bool displayed) { setFlagGalacticEquatorLine(displayed); }
407  bool getFlagGalacticEquatorLine(void) const;
419  void setColorGalacticEquatorLine(const Vec3f& newColor);
420 signals:
421  void azimuthalGridDisplayedChanged(const bool) const;
422  void azimuthalGridColorChanged(const Vec3f & newColor) const;
423  void equatorGridDisplayedChanged(const bool displayed) const;
424  void equatorGridColorChanged(const Vec3f & newColor) const;
425  void equatorJ2000GridDisplayedChanged(const bool displayed) const;
426  void equatorJ2000GridColorChanged(const Vec3f & newColor) const;
427  void eclipticGridDisplayedChanged(const bool displayed) const;
428  void eclipticGridColorChanged(const Vec3f & newColor) const;
429  void eclipticJ2000GridDisplayedChanged(const bool displayed) const;
430  void eclipticJ2000GridColorChanged(const Vec3f & newColor) const;
431  void galacticGridDisplayedChanged(const bool displayed) const;
432  void galacticGridColorChanged(const Vec3f & newColor) const;
433  void equatorLineDisplayedChanged(const bool displayed) const;
434  void equatorLineColorChanged(const Vec3f & newColor) const;
435  void equatorJ2000LineDisplayedChanged(const bool displayed) const;
436  void equatorJ2000LineColorChanged(const Vec3f & newColor) const;
437  void eclipticLineDisplayedChanged(const bool displayed) const;
438  void eclipticLineColorChanged(const Vec3f & newColor) const;
439  void eclipticJ2000LineDisplayedChanged(const bool displayed) const;
440  void eclipticJ2000LineColorChanged(const Vec3f & newColor) const;
441  void precessionCirclesDisplayedChanged(const bool displayed) const;
442  void precessionCirclesColorChanged(const Vec3f & newColor) const;
443  void meridianLineDisplayedChanged(const bool displayed) const;
444  void meridianLineColorChanged(const Vec3f & newColor) const;
445  void longitudeLineDisplayedChanged(const bool displayed) const;
446  void longitudeLineColorChanged(const Vec3f & newColor) const;
447  void horizonLineDisplayedChanged(const bool displayed) const;
448  void horizonLineColorChanged(const Vec3f & newColor) const;
449  void galacticEquatorLineDisplayedChanged(const bool displayed) const;
450  void galacticEquatorLineColorChanged(const Vec3f & newColor) const;
451 
452 
453 private slots:
456  void setStelStyle(const QString& section);
459  void updateLineLabels();
460 
461 private:
462  SkyGrid * equGrid; // Equatorial grid
463  SkyGrid * equJ2000Grid; // Equatorial J2000 grid
464  SkyGrid * galacticGrid; // Galactic grid
465  SkyGrid * eclGrid; // Ecliptic of Date grid
466  SkyGrid * eclJ2000Grid; // Ecliptic J2000 grid
467  SkyGrid * aziGrid; // Azimuthal grid
468  SkyLine * equatorLine; // Celestial Equator line
469  SkyLine * equatorJ2000Line; // Celestial Equator of J2000 line
470  SkyLine * eclipticLine; // Ecliptic line
471  SkyLine * eclipticJ2000Line; // Ecliptic line of J2000
472  SkyLine * precessionCircleN; // Northern precession circle
473  SkyLine * precessionCircleS; // Southern precession circle
474  SkyLine * meridianLine; // Meridian line
475  SkyLine * longitudeLine; // Opposition/conjunction longitude line
476  SkyLine * horizonLine; // Horizon line
477  SkyLine * galacticEquatorLine; // line depicting the Galactic equator as defined by the IAU definition of Galactic coordinates (System II, 1958)
478 };
479 
480 #endif // _GRIDLINESMGR_HPP_
virtual void draw(StelCore *core)
Draw the grids and great circle lines.
bool getFlagEclipticGrid(void) const
Accessor for displaying Ecliptic Grid.
void setColorPrecessionCircles(const Vec3f &newColor)
Set the color of the precession circles.
void setColorEclipticLine(const Vec3f &newColor)
Set the color of the Ecliptic Line.
void setFlagEquatorJ2000Grid(const bool displayed)
Setter for displaying Equatorial J2000 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 getFlagPrecessionCircles(void) const
Accessor for displaying precession circles.
bool getFlagLongitudeLine(void) const
Accessor for displaying opposition/conjunction longitude line.
void setFlagPrecessionCircles(const bool displayed)
Setter for displaying precession circles.
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 of J2000.0.
void setFlagEclipticJ2000Line(const bool displayed)
Setter for displaying Ecliptic of J2000 Line.
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:48
bool getFlagEclipticJ2000Grid(void) const
Accessor for displaying Ecliptic Grid.
Vec3f getColorEclipticJ2000Line(void) const
Get the current color of the Ecliptic of J2000 Line.
void setColorEquatorGrid(const Vec3f &newColor)
Set the color of the Equatorial Grid.
bool getFlagEclipticLine(void) const
Accessor for displaying Ecliptic Line.
void setColorEquatorJ2000Line(const Vec3f &newColor)
Set the color of the J2000 Equator 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, Equatorial, Ecliptical and Galactic Grids...
virtual QString getModuleID() const
Get the module ID, returns "GridLinesMgr".
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 J2000 Grid.
void setFlagEclipticGrid(const bool displayed)
Setter for displaying Ecliptic Grid of Date.
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.
bool getFlagEquatorJ2000Line(void) const
Accessor for displaying J2000 Equatorial 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
bool getFlagEclipticJ2000Line(void) const
Accessor for displaying Ecliptic of J2000 Line.
void setColorEclipticGrid(const Vec3f &newColor)
Set the color of the Ecliptic Grid.
virtual void update(double deltaTime)
Update time-dependent features.
Vec3f getColorEclipticGrid(void) const
Get the current color of the Ecliptic of Date Grid.
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.
void setFlagEquatorJ2000Line(const bool displayed)
Setter for displaying J2000 Equatorial Line.
bool getFlagHorizonLine(void) const
Accessor for displaying Horizon Line.
bool getFlagAzimuthalGrid(void) const
Accessor for displaying Azimuthal Grid.
Vec3f getColorPrecessionCircles(void) const
Get the current color of the precession circles.
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.
Vec3f getColorEquatorJ2000Line(void) const
Get the current color of the J2000 Equatorial 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 setColorEclipticJ2000Line(const Vec3f &newColor)
Set the color of the Ecliptic of J2000 Line.
void setFlagMeridianLine(const bool displayed)
Setter for displaying Meridian Line.