Stellarium 0.11.2
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
core/modules/GridLinesMgr.hpp
00001 /*
00002  * Stellarium
00003  * Copyright (C) 2007 Fabien Chereau
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
00018  */
00019 
00020 #ifndef _GRIDLINESMGR_HPP_
00021 #define _GRIDLINESMGR_HPP_
00022 
00023 #include "VecMath.hpp"
00024 #include "StelModule.hpp"
00025 
00026 class SkyGrid;
00027 class SkyLine;
00028 
00032 class GridLinesMgr : public StelModule
00033 {
00034     Q_OBJECT
00035     Q_PROPERTY(bool azimuthalGridDisplayed
00036                READ getFlagAzimuthalGrid
00037                WRITE setFlagAzimuthalGrid
00038                NOTIFY azimuthalGridDisplayedChanged)
00039     Q_PROPERTY(Vec3f azimuthalGridColor
00040                READ getColorAzimuthalGrid
00041                WRITE setColorAzimuthalGrid
00042                NOTIFY azimuthalGridColorChanged)
00043     Q_PROPERTY(bool equatorGridDisplayed
00044                READ getFlagEquatorGrid
00045                WRITE setFlagEquatorGrid
00046                NOTIFY equatorGridDisplayedChanged)
00047     Q_PROPERTY(Vec3f equatorGridColor
00048                READ getColorEquatorGrid
00049                WRITE setColorEquatorGrid
00050                NOTIFY equatorGridColorChanged)
00051     Q_PROPERTY(bool equatorJ2000GridDisplayed
00052                READ getFlagEquatorJ2000Grid
00053                WRITE setFlagEquatorJ2000Grid
00054                NOTIFY equatorJ2000GridDisplayedChanged)
00055     Q_PROPERTY(Vec3f equatorJ2000GridColor
00056                READ getColorEquatorJ2000Grid
00057                WRITE setColorEquatorJ2000Grid
00058                NOTIFY equatorJ2000GridColorChanged)
00059     Q_PROPERTY(bool galacticGridDisplayed
00060                READ getFlagGalacticGrid
00061                WRITE setFlagGalacticGrid
00062                NOTIFY galacticGridDisplayedChanged)
00063     Q_PROPERTY(Vec3f galacticGridColor
00064                READ getColorGalacticGrid
00065                WRITE setColorGalacticGrid
00066                NOTIFY galacticGridColorChanged)
00067     Q_PROPERTY(bool equatorLineDisplayed
00068                READ getFlagEquatorLine
00069                WRITE setFlagEquatorLine
00070                NOTIFY equatorLineDisplayedChanged)
00071     Q_PROPERTY(Vec3f equatorLineColor
00072                READ getColorEquatorLine
00073                WRITE setColorEquatorLine
00074                NOTIFY equatorLineColorChanged)
00075     Q_PROPERTY(bool eclipticLineDisplayed
00076                READ getFlagEclipticLine
00077                WRITE setFlagEclipticLine
00078                NOTIFY eclipticLineDisplayedChanged)
00079     Q_PROPERTY(Vec3f eclipticLineColor
00080                READ getColorEclipticLine
00081                WRITE setColorEclipticLine
00082                NOTIFY eclipticLineColorChanged)
00083     Q_PROPERTY(bool meridianLineDisplayed
00084                READ getFlagMeridianLine
00085                WRITE setFlagMeridianLine
00086                NOTIFY meridianLineDisplayedChanged)
00087     Q_PROPERTY(Vec3f meridianLineColor
00088                READ getColorMeridianLine
00089                WRITE setColorMeridianLine
00090                NOTIFY meridianLineColorChanged)
00091     Q_PROPERTY(bool horizonLineDisplayed
00092                READ getFlagHorizonLine
00093                WRITE setFlagHorizonLine
00094                NOTIFY horizonLineDisplayedChanged)
00095     Q_PROPERTY(Vec3f horizonLineColor
00096                READ getColorHorizonLine
00097                WRITE setColorHorizonLine
00098                NOTIFY horizonLineColorChanged)
00099     Q_PROPERTY(bool galacticPlaneLineDisplayed
00100                READ getFlagGalacticPlaneLine
00101                WRITE setFlagGalacticPlaneLine
00102                NOTIFY galacticPlaneLineDisplayedChanged)
00103     Q_PROPERTY(Vec3f galacticPlaneLineColor
00104                READ getColorGalacticPlaneLine
00105                WRITE setColorGalacticPlaneLine
00106                NOTIFY galacticPlaneLineColorChanged)
00107 
00108 public:
00109     GridLinesMgr();
00110     virtual ~GridLinesMgr();
00111 
00113     // Methods defined in the StelModule class
00118     virtual void init();
00119 
00121     virtual QString getModuleID() const {return "GridLinesMgr";}
00122 
00127     virtual void draw(StelCore* core);
00128 
00131     virtual void update(double deltaTime);
00132 
00134     virtual double getCallOrder(StelModuleActionName actionName) const;
00135 
00137     // Setter and getters
00138 public slots:
00140     void setFlagAzimuthalGrid(const bool displayed);
00142     bool getFlagAzimuthalGrid(void) const;
00144     Vec3f getColorAzimuthalGrid(void) const;
00146     void setColorAzimuthalGrid(const Vec3f& newColor);
00147 
00149     void setFlagEquatorGrid(const bool displayed);
00151     bool getFlagEquatorGrid(void) const;
00153     Vec3f getColorEquatorGrid(void) const;
00155     void setColorEquatorGrid(const Vec3f& newColor);
00156 
00158     void setFlagEquatorJ2000Grid(const bool displayed);
00160     bool getFlagEquatorJ2000Grid(void) const;
00162     Vec3f getColorEquatorJ2000Grid(void) const;
00164     void setColorEquatorJ2000Grid(const Vec3f& newColor);
00165 
00167     void setFlagGalacticGrid(const bool displayed);
00169     bool getFlagGalacticGrid(void) const;
00171     Vec3f getColorGalacticGrid(void) const;
00173     void setColorGalacticGrid(const Vec3f& newColor);
00174 
00176     void setFlagEquatorLine(const bool displayed);
00178     bool getFlagEquatorLine(void) const;
00180     Vec3f getColorEquatorLine(void) const;
00182     void setColorEquatorLine(const Vec3f& newColor);
00183 
00185     void setFlagEclipticLine(const bool displayed);
00187     bool getFlagEclipticLine(void) const;
00189     Vec3f getColorEclipticLine(void) const;
00191     void setColorEclipticLine(const Vec3f& newColor);
00192 
00194     void setFlagMeridianLine(const bool displayed);
00196     bool getFlagMeridianLine(void) const;
00198     Vec3f getColorMeridianLine(void) const;
00200     void setColorMeridianLine(const Vec3f& newColor);
00201 
00203     void setFlagHorizonLine(const bool displayed);
00205     bool getFlagHorizonLine(void) const;
00207     Vec3f getColorHorizonLine(void) const;
00209     void setColorHorizonLine(const Vec3f& newColor);
00210 
00212     void setFlagGalacticPlaneLine(const bool displayed);
00214     bool getFlagGalacticPlaneLine(void) const;
00216     Vec3f getColorGalacticPlaneLine(void) const;
00218     void setColorGalacticPlaneLine(const Vec3f& newColor);
00219 signals:
00220     void azimuthalGridDisplayedChanged(const bool) const;
00221     void azimuthalGridColorChanged(const Vec3f & newColor) const;
00222     void equatorGridDisplayedChanged(const bool displayed) const;
00223     void equatorGridColorChanged(const Vec3f & newColor) const;
00224     void equatorJ2000GridDisplayedChanged(const bool displayed) const;
00225     void equatorJ2000GridColorChanged(const Vec3f & newColor) const;
00226     void galacticGridDisplayedChanged(const bool displayed) const;
00227     void galacticGridColorChanged(const Vec3f & newColor) const;
00228     void equatorLineDisplayedChanged(const bool displayed) const;
00229     void equatorLineColorChanged(const Vec3f & newColor) const;
00230     void eclipticLineDisplayedChanged(const bool displayed) const;
00231     void eclipticLineColorChanged(const Vec3f & newColor) const;
00232     void meridianLineDisplayedChanged(const bool displayed) const;
00233     void meridianLineColorChanged(const Vec3f & newColor) const;
00234     void horizonLineDisplayedChanged(const bool displayed) const;
00235     void horizonLineColorChanged(const Vec3f & newColor) const;
00236     void galacticPlaneLineDisplayedChanged(const bool displayed) const;
00237     void galacticPlaneLineColorChanged(const Vec3f & newColor) const;
00238 
00239 
00240 private slots:
00243     void setStelStyle(const QString& section);
00246     void updateLineLabels();
00247 
00248 private:
00249     SkyGrid * equGrid;          // Equatorial grid
00250     SkyGrid * equJ2000Grid;     // Equatorial J2000 grid
00251     SkyGrid * galacticGrid;     // Galactic grid
00252     SkyGrid * aziGrid;          // Azimuthal grid
00253     SkyLine * equatorLine;      // Celestial Equator line
00254     SkyLine * eclipticLine;     // Ecliptic line
00255     SkyLine * meridianLine;     // Meridian line
00256     SkyLine * horizonLine;      // Horizon line
00257     SkyLine * galacticPlaneLine;    // line depciting the Galacitc plane as defined by the IAU definition of Galactic coordinates
00258 };
00259 
00260 #endif // _GRIDLINESMGR_HPP_