Stellarium 0.14.3
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 
51  virtual ~MeteorShowers();
52 
55  virtual void update(double deltaTime);
56 
58  virtual void draw(StelCore* core);
59 
62  void loadMeteorShowers(const QVariantMap& map);
63 
68  QList<SearchResult> searchEvents(QDate dateFrom, QDate dateTo) const;
69 
70  //
71  // Methods defined in StelObjectModule class
72  //
73  virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const;
74  virtual StelObjectP searchByNameI18n(const QString& nameI18n) const;
75  virtual StelObjectP searchByName(const QString& name) const;
76  virtual QStringList listMatchingObjectsI18n(const QString& objPrefix, int maxNbItem=5, bool useStartOfWords=false) const;
77  virtual QStringList listMatchingObjects(const QString& objPrefix, int maxNbItem=5, bool useStartOfWords=false) const;
78  virtual QStringList listAllObjects(bool inEnglish) const;
79  virtual QString getName() const { return "Meteor Showers"; }
80 
81 private:
82  MeteorShowersMgr* m_mgr;
83  QList<MeteorShowerP> m_meteorShowers;
84 
86  void drawPointer(StelCore* core);
87 };
88 
89 #endif /*METEORSHOWERS_HPP_*/
virtual ~MeteorShowers()
Destructor.
virtual void update(double deltaTime)
Update.
virtual void draw(StelCore *core)
Draw.
MeteorShowers(MeteorShowersMgr *mgr)
Constructor.
This class manages a collection of MeteorShower objects.
Main class of the Meteor Showers plugin, inherits from StelObjectModule.
QList< SearchResult > searchEvents(QDate dateFrom, QDate dateTo) const
Find all meteor_shower events in a given date interval.
void loadMeteorShowers(const QVariantMap &map)
Loads all meteor showers contained in a QVariantMap.