Updraft  1.0
Open source glider flight visualisation tool.
tpfilecupadapter.h
Go to the documentation of this file.
00001 #ifndef UPDRAFT_SRC_PLUGINS_TURNPOINTS_TPFILECUPADAPTER_H_
00002 #define UPDRAFT_SRC_PLUGINS_TURNPOINTS_TPFILECUPADAPTER_H_
00003 
00004 #include <QtGui>
00005 #include <QString>
00006 #include "../../libraries/cup/cup.h"
00007 #include "tpfile.h"
00008 #include "../../libraries/util/units.h"
00009 
00010 namespace Updraft {
00011 
00014 class TPFileCupAdapter : public TPFile {
00015  public:
00016   virtual ~TPFileCupAdapter();
00017 
00018   // Implementation of TPFile interface.
00019   QString getFileName() const;
00020   QString getFilePath() const;
00021   const TTPList& getTurnPoints() const;
00022 
00027   static TPFileCupAdapter* load(const QString &filename);
00028 
00029  private:
00030   const Cup::CupFile *cupFile;
00031   TTPList tpList;
00032 
00034   explicit TPFileCupAdapter(const Cup::CupFile *cup);
00035   TPFileCupAdapter(const TPFileCupAdapter&) {}
00036 
00040   void convertCupTPEntry(TurnPoint *tp, const Cup::TPEntry &tpEntry);
00041 
00044   float parseLength(const QString& text);
00045 };
00046 
00047 }  // End namespace Updraft
00048 
00049 #endif  // UPDRAFT_SRC_PLUGINS_TURNPOINTS_TPFILECUPADAPTER_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines