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  Q_PROPERTY(bool circumpolarCirclesDisplayed
195  NOTIFY circumpolarCirclesDisplayedChanged)
196  Q_PROPERTY(Vec3f circumpolarCirclesColor
199  NOTIFY circumpolarCirclesColorChanged)
200 
201 public:
202  GridLinesMgr();
203  virtual ~GridLinesMgr();
204 
206  // Methods defined in the StelModule class
211  virtual void init();
212 
214  virtual QString getModuleID() const {return "GridLinesMgr";}
215 
220  virtual void draw(StelCore* core);
221 
224  virtual void update(double deltaTime);
225 
227  virtual double getCallOrder(StelModuleActionName actionName) const;
228 
230  // Setter and getters
231 public slots:
233  void setFlagAzimuthalGrid(const bool displayed);
235  bool getFlagAzimuthalGrid(void) const;
237  Vec3f getColorAzimuthalGrid(void) const;
244  void setColorAzimuthalGrid(const Vec3f& newColor);
245 
247  void setFlagEquatorGrid(const bool displayed);
249  bool getFlagEquatorGrid(void) const;
251  Vec3f getColorEquatorGrid(void) const;
258  void setColorEquatorGrid(const Vec3f& newColor);
259 
261  void setFlagEquatorJ2000Grid(const bool displayed);
263  bool getFlagEquatorJ2000Grid(void) const;
265  Vec3f getColorEquatorJ2000Grid(void) const;
272  void setColorEquatorJ2000Grid(const Vec3f& newColor);
273 
275  void setFlagEclipticJ2000Grid(const bool displayed);
277  bool getFlagEclipticJ2000Grid(void) const;
279  Vec3f getColorEclipticJ2000Grid(void) const;
286  void setColorEclipticJ2000Grid(const Vec3f& newColor);
287 
289  void setFlagEclipticGrid(const bool displayed);
291  bool getFlagEclipticGrid(void) const;
293  Vec3f getColorEclipticGrid(void) const;
300  void setColorEclipticGrid(const Vec3f& newColor);
301 
303  void setFlagGalacticGrid(const bool displayed);
305  bool getFlagGalacticGrid(void) const;
307  Vec3f getColorGalacticGrid(void) const;
314  void setColorGalacticGrid(const Vec3f& newColor);
315 
317  void setFlagEquatorLine(const bool displayed);
319  bool getFlagEquatorLine(void) const;
321  Vec3f getColorEquatorLine(void) const;
328  void setColorEquatorLine(const Vec3f& newColor);
329 
331  void setFlagEquatorJ2000Line(const bool displayed);
333  bool getFlagEquatorJ2000Line(void) const;
335  Vec3f getColorEquatorJ2000Line(void) const;
342  void setColorEquatorJ2000Line(const Vec3f& newColor);
343 
345  void setFlagEclipticJ2000Line(const bool displayed);
347  bool getFlagEclipticJ2000Line(void) const;
349  Vec3f getColorEclipticJ2000Line(void) const;
356  void setColorEclipticJ2000Line(const Vec3f& newColor);
357 
359  void setFlagEclipticLine(const bool displayed);
361  bool getFlagEclipticLine(void) const;
363  Vec3f getColorEclipticLine(void) const;
370  void setColorEclipticLine(const Vec3f& newColor);
371 
373  void setFlagPrecessionCircles(const bool displayed);
375  bool getFlagPrecessionCircles(void) const;
377  Vec3f getColorPrecessionCircles(void) const;
384  void setColorPrecessionCircles(const Vec3f& newColor);
385 
387  void setFlagMeridianLine(const bool displayed);
389  bool getFlagMeridianLine(void) const;
391  Vec3f getColorMeridianLine(void) const;
398  void setColorMeridianLine(const Vec3f& newColor);
399 
401  void setFlagLongitudeLine(const bool displayed);
403  bool getFlagLongitudeLine(void) const;
405  Vec3f getColorLongitudeLine(void) const;
412  void setColorLongitudeLine(const Vec3f& newColor);
413 
415  void setFlagHorizonLine(const bool displayed);
417  bool getFlagHorizonLine(void) const;
419  Vec3f getColorHorizonLine(void) const;
426  void setColorHorizonLine(const Vec3f& newColor);
427 
429  void setFlagGalacticEquatorLine(const bool displayed);
432  void setFlagGalacticPlaneLine(const bool displayed) { setFlagGalacticEquatorLine(displayed); }
434  bool getFlagGalacticEquatorLine(void) const;
446  void setColorGalacticEquatorLine(const Vec3f& newColor);
447 
449  void setFlagPrimeVerticalLine(const bool displayed);
451  bool getFlagPrimeVerticalLine(void) const;
453  Vec3f getColorPrimeVerticalLine(void) const;
460  void setColorPrimeVerticalLine(const Vec3f& newColor);
461 
463  void setFlagColureLines(const bool displayed);
465  bool getFlagColureLines(void) const;
467  Vec3f getColorColureLines(void) const;
474  void setColorColureLines(const Vec3f& newColor);
475 
477  void setFlagCircumpolarCircles(const bool displayed);
479  bool getFlagCircumpolarCircles(void) const;
481  Vec3f getColorCircumpolarCircles(void) const;
488  void setColorCircumpolarCircles(const Vec3f& newColor);
489 
490 
491 signals:
492  void azimuthalGridDisplayedChanged(const bool) const;
493  void azimuthalGridColorChanged(const Vec3f & newColor) const;
494  void equatorGridDisplayedChanged(const bool displayed) const;
495  void equatorGridColorChanged(const Vec3f & newColor) const;
496  void equatorJ2000GridDisplayedChanged(const bool displayed) const;
497  void equatorJ2000GridColorChanged(const Vec3f & newColor) const;
498  void eclipticGridDisplayedChanged(const bool displayed) const;
499  void eclipticGridColorChanged(const Vec3f & newColor) const;
500  void eclipticJ2000GridDisplayedChanged(const bool displayed) const;
501  void eclipticJ2000GridColorChanged(const Vec3f & newColor) const;
502  void galacticGridDisplayedChanged(const bool displayed) const;
503  void galacticGridColorChanged(const Vec3f & newColor) const;
504  void equatorLineDisplayedChanged(const bool displayed) const;
505  void equatorLineColorChanged(const Vec3f & newColor) const;
506  void equatorJ2000LineDisplayedChanged(const bool displayed) const;
507  void equatorJ2000LineColorChanged(const Vec3f & newColor) const;
508  void eclipticLineDisplayedChanged(const bool displayed) const;
509  void eclipticLineColorChanged(const Vec3f & newColor) const;
510  void eclipticJ2000LineDisplayedChanged(const bool displayed) const;
511  void eclipticJ2000LineColorChanged(const Vec3f & newColor) const;
512  void precessionCirclesDisplayedChanged(const bool displayed) const;
513  void precessionCirclesColorChanged(const Vec3f & newColor) const;
514  void meridianLineDisplayedChanged(const bool displayed) const;
515  void meridianLineColorChanged(const Vec3f & newColor) const;
516  void longitudeLineDisplayedChanged(const bool displayed) const;
517  void longitudeLineColorChanged(const Vec3f & newColor) const;
518  void horizonLineDisplayedChanged(const bool displayed) const;
519  void horizonLineColorChanged(const Vec3f & newColor) const;
520  void galacticEquatorLineDisplayedChanged(const bool displayed) const;
521  void galacticEquatorLineColorChanged(const Vec3f & newColor) const;
522  void primeVerticalLineDisplayedChanged(const bool displayed) const;
523  void primeVerticalLineColorChanged(const Vec3f & newColor) const;
524  void colureLinesDisplayedChanged(const bool displayed) const;
525  void colureLinesColorChanged(const Vec3f & newColor) const;
526  void circumpolarCirclesDisplayedChanged(const bool displayed) const;
527  void circumpolarCirclesColorChanged(const Vec3f & newColor) const;
528 
529 private slots:
532  void updateLineLabels();
533 
534 private:
535  SkyGrid * equGrid; // Equatorial grid
536  SkyGrid * equJ2000Grid; // Equatorial J2000 grid
537  SkyGrid * galacticGrid; // Galactic grid
538  SkyGrid * eclGrid; // Ecliptic of Date grid
539  SkyGrid * eclJ2000Grid; // Ecliptic J2000 grid
540  SkyGrid * aziGrid; // Azimuthal grid
541  SkyLine * equatorLine; // Celestial Equator line
542  SkyLine * equatorJ2000Line; // Celestial Equator of J2000 line
543  SkyLine * eclipticLine; // Ecliptic line
544  SkyLine * eclipticJ2000Line; // Ecliptic line of J2000
545  SkyLine * precessionCircleN; // Northern precession circle
546  SkyLine * precessionCircleS; // Southern precession circle
547  SkyLine * meridianLine; // Meridian line
548  SkyLine * longitudeLine; // Opposition/conjunction longitude line
549  SkyLine * horizonLine; // Horizon line
550  SkyLine * galacticEquatorLine; // line depicting the Galactic equator as defined by the IAU definition of Galactic coordinates (System II, 1958)
551  SkyLine * primeVerticalLine; // Prime Vertical line
552  SkyLine * colureLine_1; // First Colure line (0/12h)
553  SkyLine * colureLine_2; // Second Colure line (6/18h)
554  SkyLine * circumpolarCircleN; // Northern circumpolar circle
555  SkyLine * circumpolarCircleS; // Southern circumpolar circle
556 };
557 
558 #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 setFlagCircumpolarCircles(const bool displayed)
Setter for displaying circumpolar circles.
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.
void setColorCircumpolarCircles(const Vec3f &newColor)
Set the color of the circumpolar circles.
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.
Vec3f getColorCircumpolarCircles(void) const
Get the current color of the circumpolar circles.
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 getFlagCircumpolarCircles(void) const
Accessor for displaying circumpolar circles.
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.