Updraft  1.0
Open source glider flight visualisation tool.
igcviewer.h
Go to the documentation of this file.
00001 #ifndef UPDRAFT_SRC_PLUGINS_IGCVIEWER_IGCVIEWER_H_
00002 #define UPDRAFT_SRC_PLUGINS_IGCVIEWER_IGCVIEWER_H_
00003 
00004 #include <QColor>
00005 #include <QList>
00006 #include <QPair>
00007 #include "../../pluginbase.h"
00008 #include "../../mapobject.h"
00009 
00010 namespace Updraft {
00011 namespace IgcViewer {
00012 
00013 class OpenedFile;
00014 
00016 class IGCMapObject : public MapObject {
00017  private:
00018   OpenedFile* file;
00019  public:
00020   IGCMapObject(QString objectName_, OpenedFile* file_);
00021   IGCMapObject() {}
00022 
00023   // Use this method for comparing class name.
00024   // \return Name of this class.
00025   static QString getClassName() { return "IGCMapObject"; }
00026 
00027   QString getObjectTypeName() { return getClassName(); }
00028 
00029   OpenedFile* getFile();
00030 };
00031 
00033 class Q_DECL_EXPORT IgcViewer: public QObject, public PluginBase {
00034   Q_OBJECT
00035   Q_INTERFACES(Updraft::PluginBase)
00036 
00037  public:
00038   QString getName();
00039 
00040   void initialize(CoreInterface *coreInterface);
00041 
00042   void deinitialize();
00043 
00044   bool fileOpen(const QString &filename, int roleId);
00045   void fileIdentification(QStringList *roles,
00046     QString *importDirectory, const QString &filename);
00047 
00049   bool wantsToHandleClick(MapObject* obj);
00050 
00052   void handleClick(MapObject* obj, const EventInfo* evt);
00053 
00054  private slots:
00057   void coloringChanged(int i);
00058 
00059  private:
00062   void fileClose(OpenedFile* f);
00063 
00065   QColor findAutomaticColor();
00066 
00068   void freeAutomaticColor(QColor c);
00069 
00071   int currentColoring;
00072 
00073   QList<QPair<QColor, int> > automaticColors;
00074 
00075   QMap<QString, OpenedFile*> opened;
00076   MapLayerGroupInterface* mapLayerGroup;
00077   QVector<MapObject*> mapObjects;
00078 
00079   friend class OpenedFile;
00080 };
00081 
00082 }  // End namespace IgcViewer
00083 }  // End namespace Updraft
00084 
00085 #endif  // UPDRAFT_SRC_PLUGINS_IGCVIEWER_IGCVIEWER_H_
00086 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines