Stellarium 0.15.2
SporadicMeteorMgr.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2015 Marcos Cardinot
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 _SPORADICMETEORMGR_HPP_
21 #define _SPORADICMETEORMGR_HPP_
22 
23 #include "SporadicMeteor.hpp"
24 #include "StelModule.hpp"
25 
30 {
31  Q_OBJECT
32  Q_PROPERTY(int zhr READ getZHR WRITE setZHR NOTIFY zhrChanged)
33 public:
37  SporadicMeteorMgr(int zhr, int maxv);
38  virtual ~SporadicMeteorMgr();
39 
40  // Methods defined in the StelModule class
41  virtual void init();
42  virtual void draw(StelCore* core);
43  virtual void update(double deltaTime);
44  virtual double getCallOrder(StelModuleActionName actionName) const;
45 
46 public slots:
47  // Methods callable from script and GUI
49  int getZHR() { return m_zhr; }
51  void setZHR(int zhr);
52 
54  void setFlagShow(bool b) { m_flagShow = b; }
56  bool getFlagShow() const { return m_flagShow; }
57 
59  void setMaxVelocity(int maxv) { m_maxVelocity = maxv; }
60 
61 signals:
62  void zhrChanged(int);
63 
64 private:
65  QList<SporadicMeteor*> activeMeteors;
66  StelTextureSP m_bolideTexture;
67  int m_zhr;
68  int m_maxVelocity;
69  bool m_flagShow;
70 };
71 
72 #endif // _SPORADICMETEORMGR_HPP_
virtual double getCallOrder(StelModuleActionName actionName) const
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual void update(double deltaTime)
Update the module with respect to the time.
Simulates a sporadic meteor shower, with a random color and a random radiant.
SporadicMeteorMgr(int zhr, int maxv)
Constructor.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
void setMaxVelocity(int maxv)
Set the maximum velocity in km/s.
int getZHR()
Get the current zenith hourly rate.
virtual void init()
Initialize itself.
StelModuleActionName
Define the possible action for which an order is defined.
Definition: StelModule.hpp:121
bool getFlagShow() const
Get value of flag used to turn on and off meteor rendering.
void setZHR(int zhr)
Set the zenith hourly rate.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
void setFlagShow(bool b)
Set flag used to turn on and off meteor rendering.
This is the common base class for all the main components of stellarium.
Definition: StelModule.hpp:49