00001 // vim:set ts=4 sw=4 noet cin: 00002 00003 #ifndef FLOWVISMAINUI_H 00004 #define FLOWVISMAINUI_H 00005 00006 #include <memory> 00007 00008 #include <QApplication> 00009 //#include <QColorDialog> 00010 #include <QFileDialog> 00011 #include <QFile> 00012 #include <QFileInfo> 00013 00014 #include "ui_mainUI.h" 00015 00016 #include "renderPicUI.h" 00017 #include "statusbarUI.h" 00018 00019 #include <Data.h> 00020 #include <ARender.h> 00021 #include <ArrowRenderer.h> 00022 #include <StreamlineRenderer.h> 00023 #include <BackgroundRenderer.h> 00024 00025 #include "ClickableLabel.h" 00026 00027 class FlowVisMainUI : public QMainWindow, public ClickHandler, public MoveHandler { 00028 Q_OBJECT 00029 00030 enum StreamLineType{ 00031 Euler, 00032 RK2, 00033 RK4 00034 }; 00035 00036 public: 00037 FlowVisMainUI(QWidget *parent = 0); 00038 00039 public slots: 00040 00041 void openFileClicked(); 00042 void newWindowClicked(); 00043 00044 //background section 00045 void backgroundClicked(int newState); 00046 void dataIndexChanged(int newIndex); 00047 void statusbarClicked(int newState); 00048 00049 //arrows section 00050 void arrowsClicked(int newState); 00051 void arrowDistanceChanged(double newValue); 00052 void arrowSizeChanged (double newValue); 00053 void scaleArrowsClicked(int newState); 00054 void scaleArrowsIndexChanged(int newIndex); 00055 void scaleArrowsMaxChanged(double newVal); 00056 void scaleArrowsMinChanged(double newVal); 00057 00058 00059 //streamlines section 00060 void streamlinesClicked(int newState); 00061 00062 void streamlineTypeChanged(int index); 00063 void dTChanged(double newVal); 00064 00065 void seedingChanged(int index); 00066 void dSepChanged(double newVal); 00067 void dTestMoved(int newVal); 00068 00069 void renderImage(); 00070 void promptFile(); 00071 00072 void statusbarDeleted(){ 00073 mStatusbarUI = std::auto_ptr<StatusbarUI>(new StatusbarUI(mBackgroundRenderer.get(),this)); 00074 if (ui.statusbar->checkState()==Qt::Checked) mStatusbarUI->show(); 00075 } 00076 protected: 00077 virtual void clickEvent(QPoint pos, bool rightButton); 00078 virtual void moveEvent(QPoint pos); 00079 00080 private: 00081 00082 void updateScaleArrowsGUI(int newIndex); 00083 00084 Ui::MainWindow ui; 00085 00086 RenderPicUI* mRenderPicUI; 00087 std::auto_ptr<StatusbarUI> mStatusbarUI; 00088 00089 std::auto_ptr<Data> mData; 00090 std::auto_ptr<ArrowRenderer> mArrowRenderer; 00091 std::auto_ptr<StreamlineRenderer> mStreamlineRenderer; 00092 std::auto_ptr<BackgroundRenderer> mBackgroundRenderer; 00093 00094 std::auto_ptr<QPixmap> mPixmap; 00095 00096 QString mCurrentFileName; 00097 }; 00098 00099 00100 00101 #endif