Stellarium 0.13.0
MeteorMgr.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2004 Robert Spearman
4  * Copyright (C) 2014 Marcos Cardinot
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19  */
20 
21 #ifndef _METEORMGR_HPP_
22 #define _METEORMGR_HPP_
23 
24 #include "StelModule.hpp"
25 #include <vector>
26 
27 class Meteor;
28 
31 class MeteorMgr : public StelModule
32 {
33  Q_OBJECT
34  Q_PROPERTY(int ZHR
35  READ getZHR
36  WRITE setZHR
37  NOTIFY zhrChanged)
38 
39 public:
44  MeteorMgr(int zhr, int maxv);
45  virtual ~MeteorMgr();
46 
48  // Methods defined in the StelModule class
50  virtual void init();
51 
53  virtual void draw(StelCore* core);
54 
59  virtual void update(double deltaTime);
60 
62  virtual double getCallOrder(StelModuleActionName actionName) const;
63 
65  static const double zhrToWsr;
66 
67 public slots:
69  // Method callable from script and GUI
71  int getZHR(void);
73  void setZHR(int zhr);
74 
76  void setFlagShow(bool b) { flagShow = b; }
78  bool getFlagShow(void) const { return flagShow; }
79 
81  void setMaxVelocity(int maxv);
82 
83 signals:
84  void zhrChanged(int);
85 
86 private:
87  std::vector<Meteor*> active; // Vector containing all active meteors
88  int ZHR;
89  int maxVelocity;
90  bool flagShow;
91 };
92 
93 
94 #endif // _METEORMGR_HPP_
void setMaxVelocity(int maxv)
Set the maximum velocity in km/s.
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
static const double zhrToWsr
Factor to convert from zhr to whole earth per second rate.
Definition: MeteorMgr.hpp:65
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:78
StelModuleActionName
Define the possible action for which an order is defined.
Definition: StelModule.hpp:119
int getZHR(void)
Get the current zenith hourly rate.
Simulates a meteor shower.
Definition: MeteorMgr.hpp:31
Models a single meteor.
Definition: Meteor.hpp:44
This is the common base class for all the main components of stellarium.
Definition: StelModule.hpp:51
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:76
virtual void init()
Initialize the MeteorMgr object.