Updraft  1.0
Open source glider flight visualisation tool.
openedfile.h
Go to the documentation of this file.
00001 #ifndef UPDRAFT_SRC_PLUGINS_IGCVIEWER_OPENEDFILE_H_
00002 #define UPDRAFT_SRC_PLUGINS_IGCVIEWER_OPENEDFILE_H_
00003 
00004 #include <QObject>
00005 #include <QFileInfo>
00006 #include <QList>
00007 #include <QTextEdit>
00008 
00009 #include <osg/Geometry>
00010 #include <osg/Geode>
00011 #include <osg/AutoTransform>
00012 
00013 #include "colorings.h"
00014 #include "igcinfo.h"
00015 #include "igcviewer.h"
00016 #include "plotwidget.h"
00017 #include "../../eventinfo.h"
00018 
00019 class IGCViewer;
00020 
00021 namespace Updraft {
00022 namespace IgcViewer {
00023 
00025 class OpenedFile: public QObject {
00026   Q_OBJECT
00027 
00028  public:
00031   ~OpenedFile();
00032 
00038   bool init(IgcViewer* viewer, const QString& filename, QColor color);
00039 
00041   void redraw();
00042 
00044   void resetScales();
00045 
00047   void updateScales(const OpenedFile* other);
00048 
00049   QColor getAutomaticColor() {
00050     return automaticColor;
00051   }
00052 
00053   void selectTab();
00054 
00056   QString fileName();
00057 
00059   void coloringChanged();
00060 
00061   osg::Node* getNode();
00062 
00066   void trackClicked(const EventInfo* eventInfo);
00067 
00068  public slots:
00072   void fixPicked(int index);
00073 
00077   void fixIsPointedAt(int index);
00078 
00080   void clearMarkers();
00081 
00082  private slots:
00085   void close();
00086 
00087  private:
00090   bool loadIgc(const QString& filename);
00091 
00093   void createGroup();
00094 
00096   osg::Node* createTrack();
00097 
00099   osg::Node* createSkirt();
00100 
00102   void setColors(Coloring* coloring);
00103 
00104   osg::Geode* createMarker(qreal scale);
00105 
00106   QFileInfo fileInfo;
00107 
00108   QComboBox *colorsCombo;
00109   IgcTextWidget* textBox;
00110   PlotWidget* plotWidget;
00111 
00112   TabInterface *tab;
00113   MapLayerInterface* track;
00114   IgcViewer *viewer;
00115 
00116   QColor automaticColor;
00117 
00120   osg::Geometry* geom;
00121   osg::Group* sceneRoot;
00122   osg::Geode* trackGeode;
00123 
00125   osg::ref_ptr<osg::Geode> trackPositionMarker;
00126 
00129   QList<osg::AutoTransform*> pickedMarkers;
00130 
00134   osg::AutoTransform* currentMarker;
00135 
00136   Coloring* currentColoring;
00137 
00139   QList<TrackFix> fixList;
00140 
00141   QList<Coloring*> colorings;
00142 
00146   QList<FixInfo*> fixInfo;
00147 
00148   FixInfo* altitudeInfo;
00149   FixInfo* verticalSpeedInfo;
00150   FixInfo* groundSpeedInfo;
00151   FixInfo* timeInfo;
00152 
00153   Util::Gradient gradient;
00154 };
00155 
00156 }  // End namespace IgcViewer
00157 }  // End namespace Updraft
00158 
00159 #endif  // UPDRAFT_SRC_PLUGINS_IGCVIEWER_OPENEDFILE_H_
00160 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines