Stellarium 0.11.2
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
core/modules/MeteorMgr.hpp
00001 /*
00002  * Stellarium
00003  * This file Copyright (C) 2004 Robert Spearman
00004  * 
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
00018  */
00019 
00020 #ifndef _METEORMGR_HPP_
00021 #define _METEORMGR_HPP_
00022 
00023 #include <vector>
00024 #include "StelModule.hpp"
00025 
00026 class Meteor;
00027 
00030 class MeteorMgr : public StelModule
00031 {
00032     Q_OBJECT
00033     Q_PROPERTY(int ZHR READ getZHR WRITE setZHR NOTIFY zhrChanged)
00034 
00035 public:
00040     MeteorMgr(int zhr, int maxv); 
00041     virtual ~MeteorMgr();
00042  
00044     // Methods defined in the StelModule class
00046     virtual void init();
00047     
00049     virtual void draw(StelCore* core);
00050     
00055     virtual void update(double deltaTime);
00056     
00058     virtual double getCallOrder(StelModuleActionName actionName) const;
00059     
00060 public slots:
00062     // Method callable from script and GUI
00064     int getZHR(void);
00066     void setZHR(int zhr);
00067     
00069     void setFlagShow(bool b) { flagShow = b; }
00071     bool getFlagShow(void) const { return flagShow; }
00072     
00074     void setMaxVelocity(int maxv);
00075     
00076 signals:
00077     void zhrChanged(int);
00078     
00079 private:
00080     std::vector<Meteor*> active;        // Vector containing all active meteors
00081     int ZHR;
00082     int maxVelocity;
00083     double zhrToWsr;  // factor to convert from zhr to whole earth per second rate
00084     bool flagShow;
00085 };
00086 
00087 
00088 #endif // _METEORMGR_HPP_