MeteorMgr.hpp   SporadicMeteorMgr.hpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2004 Robert Spearman * Copyright (C) 2015 Marcos Cardinot
* Copyright (C) 2014 Marcos Cardinot
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _METEORMGR_HPP_ #ifndef _SPORADICMETEORMGR_HPP_
#define _METEORMGR_HPP_ #define _SPORADICMETEORMGR_HPP_
#include "SporadicMeteor.hpp"
#include "StelModule.hpp" #include "StelModule.hpp"
#include <vector>
class Meteor; //! @class SporadicMeteorMgr
//! Simulates a sporadic meteor shower, with a random color and a random ra
//! @class MeteorMgr diant.
//! Simulates a meteor shower. //! @author Marcos Cardinot <mcardinot@gmail.com>
class MeteorMgr : public StelModule class SporadicMeteorMgr : public StelModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int ZHR Q_PROPERTY(int zhr READ getZHR WRITE setZHR NOTIFY zhrChanged)
READ getZHR
WRITE setZHR
NOTIFY zhrChanged)
public: public:
//! Construct a MeteorMgr object. //! Constructor
//! @param zhr the base zenith hourly rate - i.e. the rate when ther //! @param zhr Zenith Hourly Rate
e is no //! @param maxv Maximum meteor velocity
//! meteor shower in progress. SporadicMeteorMgr(int zhr, int maxv);
//! @param maxv the initial value of the maximum meteor velocity. virtual ~SporadicMeteorMgr();
MeteorMgr(int zhr, int maxv);
virtual ~MeteorMgr();
//////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
//! Initialize the MeteorMgr object.
virtual void init(); virtual void init();
//! Draw meteors.
virtual void draw(StelCore* core); virtual void draw(StelCore* core);
//! Update time-dependent parts of the module.
//! This function adds new meteors to the list of currently visiable
//! ones based on the current rate, and removes those which have run
their
//! course.
virtual void update(double deltaTime); virtual void update(double deltaTime);
//! Defines the order in which the various modules are drawn.
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
//! Factor to convert from zhr to whole earth per second rate
static const double zhrToWsr;
public slots: public slots:
//////////////////////////////////////////////////////////////////// // Methods callable from script and GUI
///////
// Method callable from script and GUI
//! Get the current zenith hourly rate. //! Get the current zenith hourly rate.
int getZHR(void); int getZHR() { return m_zhr; }
//! Set the zenith hourly rate. //! Set the zenith hourly rate.
void setZHR(int zhr); void setZHR(int zhr);
//! Set flag used to turn on and off meteor rendering. //! Set flag used to turn on and off meteor rendering.
void setFlagShow(bool b) { flagShow = b; } void setFlagShow(bool b) { m_flagShow = b; }
//! Get value of flag used to turn on and off meteor rendering. //! Get value of flag used to turn on and off meteor rendering.
bool getFlagShow(void) const { return flagShow; } bool getFlagShow() const { return m_flagShow; }
//! Set the maximum velocity in km/s //! Set the maximum velocity in km/s
void setMaxVelocity(int maxv); void setMaxVelocity(int maxv) { m_maxVelocity = maxv; }
signals: signals:
void zhrChanged(int); void zhrChanged(int);
private: private:
std::vector<Meteor*> active; // Vector containing all active mete QList<SporadicMeteor*> activeMeteors;
ors StelTextureSP m_bolideTexture;
int ZHR; int m_zhr;
int maxVelocity; int m_maxVelocity;
bool flagShow; bool m_flagShow;
}; };
#endif // _METEORMGR_HPP_ #endif // _SPORADICMETEORMGR_HPP_
 End of changes. 20 change blocks. 
49 lines changed or deleted 25 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/