Stellarium 0.15.2
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 listMatchingObjects(const QString& objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=true) const;
77  virtual QStringList listAllObjects(bool inEnglish) const;
78  virtual QString getName() const { return "Meteor Showers"; }
79 
80 private:
81  MeteorShowersMgr* m_mgr;
82  QList<MeteorShowerP> m_meteorShowers;
83 
85  void drawPointer(StelCore* core);
86 };
87 
88 #endif /*METEORSHOWERS_HPP_*/
virtual ~MeteorShowers()
Destructor.
virtual void update(double deltaTime)
Update.
virtual void draw(StelCore *core)
Draw.
virtual StelObjectP searchByName(const QString &name) const
Return the matching StelObject if exists or the empty StelObject if not found.
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 StelObjectModule.
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 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.