00001 #ifndef SCATTERPLOT_H
00002 #define SCATTERPLOT_H
00003
00004
00005 #include "il.h"
00006 #include "glew.h"
00007 #include <QGLWidget>
00008 #include <QColorDialog>
00009 #include <string>
00010 #include <commdlg.h>
00011 #include <stdlib.h>
00012 #include <iostream>
00013 #include <sstream>
00014 #include <vector>
00015 #include <algorithm>
00016
00017 #include "Color.h"
00018 #include "glwidget.h"
00019 #include "States.h"
00020 #include "vec3.h"
00021
00022
00023
00024 struct scatterPoint{
00025 float x;
00026 float y;
00027 float intens;
00028 };
00029
00030 struct selectPoint{
00031 float x;
00032 float y;
00033 };
00034
00036
00043 class ScatterPlot : public QGLWidget
00044 {
00045 Q_OBJECT
00046
00047 public:
00048
00052 ScatterPlot(QWidget *parent = 0);
00053
00057 ~ScatterPlot(void);
00058
00060
00063 int initLibs();
00064 void initializeGL();
00065 void paintGL();
00066 void resizeGL(int width, int height);
00067 void mousePressEvent(QMouseEvent *event);
00068 void mouseMoveEvent(QMouseEvent *event);
00069 void mouseReleaseEvent(QMouseEvent *event);
00070 std::vector<Texture*> textureSc;
00071
00072 QSize sizeHint() const;
00073 scatterPoint pointsChannelOne[10];
00074 scatterPoint pointsChannelTwo[10];
00075 scatterPoint pointsChannelThree[10];
00076 scatterPoint pointsChannelFour[10];
00077
00078 selectPoint selectingMask[4];
00079 void datafile(std::vector<Texture*> texture);
00080
00081 int time;
00082 int channel;
00083
00084 QColor maxColor;
00085 QColor minColor;
00086 QColor areaColor;
00087 vec3 colormax;
00088 vec3 colormin;
00089 vec3 colorarea;
00090
00091 bool areaDrawn;
00092 bool outside;
00093
00094
00095 public slots:
00096 void receiveData(std::vector<Texture*> texture);
00097 void updateTime(int time);
00098 void changeChannel(int channel);
00099 void openColorMax();
00100 void openColorMin();
00101 void openColorChoose();
00102 void reset();
00103
00104 signals:
00105 void receiveDataChanged(std::vector<Texture*> texture);
00106 void updateChanged(int time);
00107 void changeChannelChanged(int channel);
00108
00109 void createdTexture(const vec3 pos1, vec3 pos2, bool update);
00110
00111
00112
00113 private:
00114 QColor qtPurple;
00115 int globWidth;
00116 int globHeight;
00117
00118 };
00119
00120 #endif