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  Q_PROPERTY(bool primeVerticalLineDisplayed
177  NOTIFY primeVerticalLineDisplayedChanged)
178  Q_PROPERTY(Vec3f primeVerticalLineColor
181  NOTIFY primeVerticalLineColorChanged)
182 
183  Q_PROPERTY(bool colureLinesDisplayed
184  READ getFlagColureLines
185  WRITE setFlagColureLines
186  NOTIFY colureLinesDisplayedChanged)
187  Q_PROPERTY(Vec3f colureLinesColor
189  WRITE setColorColureLines
190  NOTIFY colureLinesColorChanged)
191 
192 public:
193  GridLinesMgr();
194  virtual ~GridLinesMgr();
195 
197  // Methods defined in the StelModule class
202  virtual void init();
203 
205  virtual QString getModuleID() const {return "GridLinesMgr";}
206 
211  virtual void draw(StelCore* core);
212 
215  virtual void update(double deltaTime);
216 
218  virtual double getCallOrder(StelModuleActionName actionName) const;
219 
221  // Setter and getters
222 public slots:
224  void setFlagAzimuthalGrid(const bool displayed);
226  bool getFlagAzimuthalGrid(void) const;
228  Vec3f getColorAzimuthalGrid(void) const;
235  void setColorAzimuthalGrid(const Vec3f& newColor);
236 
238  void setFlagEquatorGrid(const bool displayed);
240  bool getFlagEquatorGrid(void) const;
242  Vec3f getColorEquatorGrid(void) const;
249  void setColorEquatorGrid(const Vec3f& newColor);
250 
252  void setFlagEquatorJ2000Grid(const bool displayed);
254  bool getFlagEquatorJ2000Grid(void) const;
256  Vec3f getColorEquatorJ2000Grid(void) const;
263  void setColorEquatorJ2000Grid(const Vec3f& newColor);
264 
266  void setFlagEclipticJ2000Grid(const bool displayed);
268  bool getFlagEclipticJ2000Grid(void) const;
270  Vec3f getColorEclipticJ2000Grid(void) const;
277  void setColorEclipticJ2000Grid(const Vec3f& newColor);
278 
280  void setFlagEclipticGrid(const bool displayed);
282  bool getFlagEclipticGrid(void) const;
284  Vec3f getColorEclipticGrid(void) const;
291  void setColorEclipticGrid(const Vec3f& newColor);
292 
294  void setFlagGalacticGrid(const bool displayed);
296  bool getFlagGalacticGrid(void) const;
298  Vec3f getColorGalacticGrid(void) const;
305  void setColorGalacticGrid(const Vec3f& newColor);
306 
308  void setFlagEquatorLine(const bool displayed);
310  bool getFlagEquatorLine(void) const;
312  Vec3f getColorEquatorLine(void) const;
319  void setColorEquatorLine(const Vec3f& newColor);
320 
322  void setFlagEquatorJ2000Line(const bool displayed);
324  bool getFlagEquatorJ2000Line(void) const;
326  Vec3f getColorEquatorJ2000Line(void) const;
333  void setColorEquatorJ2000Line(const Vec3f& newColor);
334 
336  void setFlagEclipticJ2000Line(const bool displayed);
338  bool getFlagEclipticJ2000Line(void) const;
340  Vec3f getColorEclipticJ2000Line(void) const;
347  void setColorEclipticJ2000Line(const Vec3f& newColor);
348 
350  void setFlagEclipticLine(const bool displayed);
352  bool getFlagEclipticLine(void) const;
354  Vec3f getColorEclipticLine(void) const;
361  void setColorEclipticLine(const Vec3f& newColor);
362 
364  void setFlagPrecessionCircles(const bool displayed);
366  bool getFlagPrecessionCircles(void) const;
368  Vec3f getColorPrecessionCircles(void) const;
375  void setColorPrecessionCircles(const Vec3f& newColor);
376 
378  void setFlagMeridianLine(const bool displayed);
380  bool getFlagMeridianLine(void) const;
382  Vec3f getColorMeridianLine(void) const;
389  void setColorMeridianLine(const Vec3f& newColor);
390 
392  void setFlagLongitudeLine(const bool displayed);
394  bool getFlagLongitudeLine(void) const;
396  Vec3f getColorLongitudeLine(void) const;
403  void setColorLongitudeLine(const Vec3f& newColor);
404 
406  void setFlagHorizonLine(const bool displayed);
408  bool getFlagHorizonLine(void) const;
410  Vec3f getColorHorizonLine(void) const;
417  void setColorHorizonLine(const Vec3f& newColor);
418 
420  void setFlagGalacticEquatorLine(const bool displayed);
423  void setFlagGalacticPlaneLine(const bool displayed) { setFlagGalacticEquatorLine(displayed); }
425  bool getFlagGalacticEquatorLine(void) const;
437  void setColorGalacticEquatorLine(const Vec3f& newColor);
438 
440  void setFlagPrimeVerticalLine(const bool displayed);
442  bool getFlagPrimeVerticalLine(void) const;
444  Vec3f getColorPrimeVerticalLine(void) const;
451  void setColorPrimeVerticalLine(const Vec3f& newColor);
452 
454  void setFlagColureLines(const bool displayed);
456  bool getFlagColureLines(void) const;
458  Vec3f getColorColureLines(void) const;
465  void setColorColureLines(const Vec3f& newColor);
466 
467 signals:
468  void azimuthalGridDisplayedChanged(const bool) const;
469  void azimuthalGridColorChanged(const Vec3f & newColor) const;
470  void equatorGridDisplayedChanged(const bool displayed) const;
471  void equatorGridColorChanged(const Vec3f & newColor) const;
472  void equatorJ2000GridDisplayedChanged(const bool displayed) const;
473  void equatorJ2000GridColorChanged(const Vec3f & newColor) const;
474  void eclipticGridDisplayedChanged(const bool displayed) const;
475  void eclipticGridColorChanged(const Vec3f & newColor) const;
476  void eclipticJ2000GridDisplayedChanged(const bool displayed) const;
477  void eclipticJ2000GridColorChanged(const Vec3f & newColor) const;
478  void galacticGridDisplayedChanged(const bool displayed) const;
479  void galacticGridColorChanged(const Vec3f & newColor) const;
480  void equatorLineDisplayedChanged(const bool displayed) const;
481  void equatorLineColorChanged(const Vec3f & newColor) const;
482  void equatorJ2000LineDisplayedChanged(const bool displayed) const;
483  void equatorJ2000LineColorChanged(const Vec3f & newColor) const;
484  void eclipticLineDisplayedChanged(const bool displayed) const;
485  void eclipticLineColorChanged(const Vec3f & newColor) const;
486  void eclipticJ2000LineDisplayedChanged(const bool displayed) const;
487  void eclipticJ2000LineColorChanged(const Vec3f & newColor) const;
488  void precessionCirclesDisplayedChanged(const bool displayed) const;
489  void precessionCirclesColorChanged(const Vec3f & newColor) const;
490  void meridianLineDisplayedChanged(const bool displayed) const;
491  void meridianLineColorChanged(const Vec3f & newColor) const;
492  void longitudeLineDisplayedChanged(const bool displayed) const;
493  void longitudeLineColorChanged(const Vec3f & newColor) const;
494  void horizonLineDisplayedChanged(const bool displayed) const;
495  void horizonLineColorChanged(const Vec3f & newColor) const;
496  void galacticEquatorLineDisplayedChanged(const bool displayed) const;
497  void galacticEquatorLineColorChanged(const Vec3f & newColor) const;
498  void primeVerticalLineDisplayedChanged(const bool displayed) const;
499  void primeVerticalLineColorChanged(const Vec3f & newColor) const;
500  void colureLinesDisplayedChanged(const bool displayed) const;
501  void colureLinesColorChanged(const Vec3f & newColor) const;
502 
503 
504 private slots:
507  void updateLineLabels();
508 
509 private:
510  SkyGrid * equGrid; // Equatorial grid
511  SkyGrid * equJ2000Grid; // Equatorial J2000 grid
512  SkyGrid * galacticGrid; // Galactic grid
513  SkyGrid * eclGrid; // Ecliptic of Date grid
514  SkyGrid * eclJ2000Grid; // Ecliptic J2000 grid
515  SkyGrid * aziGrid; // Azimuthal grid
516  SkyLine * equatorLine; // Celestial Equator line
517  SkyLine * equatorJ2000Line; // Celestial Equator of J2000 line
518  SkyLine * eclipticLine; // Ecliptic line
519  SkyLine * eclipticJ2000Line; // Ecliptic line of J2000
520  SkyLine * precessionCircleN; // Northern precession circle
521  SkyLine * precessionCircleS; // Southern precession circle
522  SkyLine * meridianLine; // Meridian line
523  SkyLine * longitudeLine; // Opposition/conjunction longitude line
524  SkyLine * horizonLine; // Horizon line
525  SkyLine * galacticEquatorLine; // line depicting the Galactic equator as defined by the IAU definition of Galactic coordinates (System II, 1958)
526  SkyLine * primeVerticalLine; // Prime Vertical line
527  SkyLine * colureLine_1; // First Colure line (0/12h)
528  SkyLine * colureLine_2; // Second Colure line (6/18h)
529 };
530 
531 #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 setColorColureLines(const Vec3f &newColor)
Set the color of the Colure Lines.
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.
bool getFlagPrimeVerticalLine(void) const
Accessor for displaying Prime Vertical 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.
bool getFlagColureLines(void) const
Accessor for displaying the Colure Lines.
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.
GridLinesMgr.cpp at V0.13.2, but with small-circle drawing.
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.
void setFlagColureLines(const bool displayed)
Setter for displaying the Colure Lines.
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 setColorPrimeVerticalLine(const Vec3f &newColor)
Set the color of the Prime Vertical 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.
Vec3f getColorPrimeVerticalLine(void) const
Get the current color of the Prime Vertical 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.
Vec3f getColorColureLines(void) const
Get the current color of the Colure Lines.
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.
void setFlagPrimeVerticalLine(const bool displayed)
Setter for displaying the Prime Vertical Line.
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.