Stellarium 0.13.2
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 
33 public:
34  MilkyWay();
35  virtual ~MilkyWay();
36 
38  // Methods defined in the StelModule class
42  virtual void init();
43 
45  virtual void draw(StelCore* core);
46 
49  virtual void update(double deltaTime);
50 
52  virtual double getCallOrder(StelModuleActionName actionName) const {Q_UNUSED(actionName); return 1.;}
53 
55  // Setter and getters
56 public slots:
58  double getIntensity() const {return intensity;}
60  void setIntensity(double aintensity) {intensity = aintensity;}
61 
63  Vec3f getColor() const {return color;}
65  void setColor(const Vec3f& c) {color=c;}
66 
68  void setFlagShow(bool b);
70  bool getFlagShow(void) const;
71 
72 private:
73  StelTextureSP tex;
74  Vec3f color; // global color
75  float intensity;
76  class LinearFader* fader;
77 
78  struct StelVertexArray* vertexArray;
79 };
80 
81 #endif // _MILKYWAY_HPP_
Vec3f getColor() const
Get the color used for rendering the milky way.
Definition: MilkyWay.hpp:63
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:65
double getIntensity() const
Get Milky Way intensity.
Definition: MilkyWay.hpp:58
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:52
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:60
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.