Stellarium  0.90.0
MeteorShowers.hpp
1 /*
2  * Stellarium: Meteor Showers Plug-in
3  * Copyright (C) 2013-2015 Marcos Cardinot
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 METEORSHOWERS_HPP_
21 #define METEORSHOWERS_HPP_
22 
23 #include "MeteorShower.hpp"
24 #include "MeteorShowersMgr.hpp"
25 
26 typedef QSharedPointer<MeteorShower> MeteorShowerP;
27 
35 {
36  Q_OBJECT
37 public:
39  typedef struct
40  {
41  QString name;
42  QString zhr;
43  QString type;
44  QDate peak;
45  } SearchResult;
46 
49 
50  virtual void init(void) {}
51 
53  virtual ~MeteorShowers();
54 
57  virtual void update(double deltaTime);
58 
60  virtual void draw(StelCore* core);
61 
64  void loadMeteorShowers(const QVariantMap& map);
65 
70  QList<SearchResult> searchEvents(QDate dateFrom, QDate dateTo) const;
71 
72  //
73  // Methods defined in StelObjectModule class
74  //
75  virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const;
76  virtual StelObjectP searchByNameI18n(const QString& nameI18n) const;
77  virtual StelObjectP searchByName(const QString& name) const;
78  virtual StelObjectP searchByID(const QString &id) const;
79  virtual QStringList listMatchingObjects(const QString& objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=true) const;
80  virtual QStringList listAllObjects(bool inEnglish) const;
81  virtual QString getName() const { return "Meteor Showers"; }
82  virtual QString getStelObjectType() const { return MeteorShower::METEORSHOWER_TYPE; }
83 
84 private:
85  MeteorShowersMgr* m_mgr;
86  QList<MeteorShowerP> m_meteorShowers;
87 
89  void drawPointer(StelCore* core);
90 };
91 
92 #endif /*METEORSHOWERS_HPP_*/
virtual void init(void)
Initialize itself.
virtual ~MeteorShowers()
Destructor.
virtual void update(double deltaTime)
Update.
virtual void draw(StelCore *core)
Draw.
virtual StelObjectP searchByID(const QString &id) const
Return the StelObject with the given ID if exists or the empty StelObject if not found.
virtual StelObjectP searchByName(const QString &name) const
Return the matching StelObject if exists or the empty StelObject if not found.
virtual QString getStelObjectType() const
Returns the name that will be returned by StelObject::getType() for the objects this module manages...
MeteorShowers(MeteorShowersMgr *mgr)
Constructor.
This class manages a collection of MeteorShower objects.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
Main class of the Meteor Showers plugin, inherits from StelModule.
Specialization of StelModule which manages a collection of StelObject.
QList< SearchResult > searchEvents(QDate dateFrom, QDate dateTo) const
Find all meteor_shower events in a given date interval.
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const
Find a StelObject by name.
virtual QString getName() const
Gets a user-displayable name of the object category.
virtual QStringList listAllObjects(bool inEnglish) const
List all StelObjects.
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=true) const
Find and return the list of at most maxNbItem objects auto-completing passed object name...
void loadMeteorShowers(const QVariantMap &map)
Loads all meteor showers contained in a QVariantMap.
virtual QList< StelObjectP > searchAround(const Vec3d &v, double limitFov, const StelCore *core) const
Search for StelObject in an area around a specifid point.