Stellarium 0.13.3
MilkyWay.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2002 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 _MILKYWAY_HPP_
21 #define _MILKYWAY_HPP_
22 
23 #include "StelModule.hpp"
24 #include "VecMath.hpp"
25 #include "StelTextureTypes.hpp"
26 
29 class MilkyWay : public StelModule
30 {
31  Q_OBJECT
32  Q_PROPERTY(bool flagMilkyWayDisplayed
33  READ getFlagShow
34  WRITE setFlagShow
35  NOTIFY milkyWayDisplayedChanged)
36 
37 public:
38  MilkyWay();
39  virtual ~MilkyWay();
40 
42  // Methods defined in the StelModule class
46  virtual void init();
47 
49  virtual void draw(StelCore* core);
50 
53  virtual void update(double deltaTime);
54 
56  virtual double getCallOrder(StelModuleActionName actionName) const {Q_UNUSED(actionName); return 1.;}
57 
59  // Setter and getters
60 public slots:
62  double getIntensity() const {return intensity;}
64  void setIntensity(double aintensity) {intensity = aintensity;}
65 
67  Vec3f getColor() const {return color;}
69  void setColor(const Vec3f& c) {color=c;}
70 
72  void setFlagShow(bool b);
74  bool getFlagShow(void) const;
75 
76 signals:
77  void milkyWayDisplayedChanged(const bool displayed);
78 
79 private:
80  StelTextureSP tex;
81  Vec3f color; // global color
82  float intensity;
83  class LinearFader* fader;
84 
85  struct StelVertexArray* vertexArray;
86 };
87 
88 #endif // _MILKYWAY_HPP_
Vec3f getColor() const
Get the color used for rendering the milky way.
Definition: MilkyWay.hpp:67
bool getFlagShow(void) const
Gets whether the Milky Way is displayed.
Implementation of StelFader which implements a linear transition.
Definition: StelFader.hpp:77
Define the StelTextureSP type.
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
void setColor(const Vec3f &c)
Sets the color to use for rendering the milky way.
Definition: MilkyWay.hpp:69
double getIntensity() const
Get Milky Way intensity.
Definition: MilkyWay.hpp:62
virtual void init()
Initialize the class.
void setFlagShow(bool b)
Sets whether to show the Milky Way.
StelModuleActionName
Define the possible action for which an order is defined.
Definition: StelModule.hpp:117
virtual double getCallOrder(StelModuleActionName actionName) const
Used to determine the order in which the various modules are drawn.
Definition: MilkyWay.hpp:56
virtual void update(double deltaTime)
Update and time-dependent state.
Manages the displaying of the Milky Way.
Definition: MilkyWay.hpp:29
void setIntensity(double aintensity)
Set Milky Way intensity.
Definition: MilkyWay.hpp:64
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
This is the common base class for all the main components of stellarium.
Definition: StelModule.hpp:49
virtual void draw(StelCore *core)
Draw the Milky Way.