Stellarium 0.13.0
MeteorMgr.hpp
1 /*
2  * Stellarium
3  * This file Copyright (C) 2004 Robert Spearman
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 _METEORMGR_HPP_
21 #define _METEORMGR_HPP_
22 
23 #include <vector>
24 #include "StelModule.hpp"
25 
26 class Meteor;
27 
30 class MeteorMgr : public StelModule
31 {
32  Q_OBJECT
33  Q_PROPERTY(int ZHR
34  READ getZHR
35  WRITE setZHR
36  NOTIFY zhrChanged)
37 
38 public:
43  MeteorMgr(int zhr, int maxv);
44  virtual ~MeteorMgr();
45 
47  // Methods defined in the StelModule class
49  virtual void init();
50 
52  virtual void draw(StelCore* core);
53 
58  virtual void update(double deltaTime);
59 
61  virtual double getCallOrder(StelModuleActionName actionName) const;
62 
63 public slots:
65  // Method callable from script and GUI
67  int getZHR(void);
69  void setZHR(int zhr);
70 
72  void setFlagShow(bool b) { flagShow = b; }
74  bool getFlagShow(void) const { return flagShow; }
75 
77  void setMaxVelocity(int maxv);
78 
79 signals:
80  void zhrChanged(int);
81 
82 private:
83  std::vector<Meteor*> active; // Vector containing all active meteors
84  int ZHR;
85  int maxVelocity;
86  double zhrToWsr; // factor to convert from zhr to whole earth per second rate
87  bool flagShow;
88 };
89 
90 
91 #endif // _METEORMGR_HPP_
void setMaxVelocity(int maxv)
Set the maximum velocity in km/s.
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
void setZHR(int zhr)
Set the zenith hourly rate.
virtual void update(double deltaTime)
Update time-dependent parts of the module.
virtual void draw(StelCore *core)
Draw meteors.
MeteorMgr(int zhr, int maxv)
Construct a MeteorMgr object.
bool getFlagShow(void) const
Get value of flag used to turn on and off meteor rendering.
Definition: MeteorMgr.hpp:74
StelModuleActionName
Define the possible action for which an order is defined.
Definition: StelModule.hpp:120
int getZHR(void)
Get the current zenith hourly rate.
Simulates a meteor shower.
Definition: MeteorMgr.hpp:30
Models a single meteor.
Definition: Meteor.hpp:39
This is the common base class for all the main components of stellarium.
Definition: StelModule.hpp:52
virtual double getCallOrder(StelModuleActionName actionName) const
Defines the order in which the various modules are drawn.
void setFlagShow(bool b)
Set flag used to turn on and off meteor rendering.
Definition: MeteorMgr.hpp:72
virtual void init()
Initialize the MeteorMgr object.