MeteorMgr.hpp   MeteorMgr.hpp 
/* /*
* Stellarium * Stellarium
* This file Copyright (C) 2004 Robert Spearman * Copyright (C) 2004 Robert Spearman
* 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 _METEORMGR_HPP_
#define _METEORMGR_HPP_ #define _METEORMGR_HPP_
#include <vector>
#include "StelModule.hpp" #include "StelModule.hpp"
#include <vector>
class Meteor; class Meteor;
//! @class MeteorMgr //! @class MeteorMgr
//! Simulates a meteor shower. //! Simulates a meteor shower.
class MeteorMgr : public StelModule class MeteorMgr : public StelModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int ZHR Q_PROPERTY(int ZHR
READ getZHR READ getZHR
skipping to change at line 52 skipping to change at line 53
//! @param maxv the initial value of the maximum meteor velocity. //! @param maxv the initial value of the maximum meteor velocity.
MeteorMgr(int zhr, int maxv); MeteorMgr(int zhr, int maxv);
virtual ~MeteorMgr(); virtual ~MeteorMgr();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
//! Initialize the MeteorMgr object. //! Initialize the MeteorMgr object.
virtual void init(); virtual void init();
//! Draw meteors. //! Draw meteors.
virtual void draw(StelCore* core, class StelRenderer* renderer); virtual void draw(StelCore* core);
//! Update time-dependent parts of the module. //! Update time-dependent parts of the module.
//! This function adds new meteors to the list of currently visiable //! This function adds new meteors to the list of currently visiable
//! ones based on the current rate, and removes those which have run their //! ones based on the current rate, and removes those which have run their
//! course. //! course.
virtual void update(double deltaTime); virtual void update(double deltaTime);
//! Defines the order in which the various modules are drawn. //! 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:
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Method 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(void);
//! 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) { 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(void) const { return flagShow; }
//! Set the maximum velocity in km/s //! Set the maximum velocity in km/s
void setMaxVelocity(int maxv); void setMaxVelocity(int maxv);
signals: signals:
void zhrChanged(int); void zhrChanged(int);
private: private:
std::vector<Meteor*> active; // Vector containing all act ive meteors std::vector<Meteor*> active; // Vector containing all active mete ors
int ZHR; int ZHR;
int maxVelocity; int maxVelocity;
double zhrToWsr; // factor to convert from zhr to whole earth per s econd rate
bool flagShow; bool flagShow;
}; };
#endif // _METEORMGR_HPP_ #endif // _METEORMGR_HPP_
 End of changes. 7 change blocks. 
5 lines changed or deleted 8 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/