• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

renderingview.h

Go to the documentation of this file.
00001 #ifndef RenderingView_H
00002 #define RenderingView_H
00003 
00004 #include <QtGui>
00005 #include <QtOpenGL>
00006 #include <QGLWidget>
00007 
00008 #include "mainwindow.h"
00009 
00010 #include "FlowData.h"
00011 
00012 const double PI = 3.14159265358979323846;
00013 
00018 class RenderingView
00019         //     : public QGLWidget
00020     : public QWidget
00021 {
00022     Q_OBJECT
00023 
00024 public:
00031     RenderingView(Ui::MainWindow *ui, QWidget *parent = 0);
00032 
00037     ~RenderingView();
00038 
00044     void paintEvent(QPaintEvent *e);
00045 
00046     QSize minimumSizeHint() const;
00047     QSize sizeHint() const;
00048 
00049 
00050 
00051 public:
00056     void setDataset(FlowData* dataset);
00057 
00062     QRgb normValueToRGB(float normValue);
00063 
00064 public slots:
00068     void updateDerivedChannels();
00072     void updateColorCoding();
00076     void updateArrowPlot();
00080     void updateStreamlines();
00081 
00082 protected:
00083 
00084 private:
00085     Ui::MainWindow *ui;
00086 
00087     FlowData *flowData;
00088 
00089     int channelVectorLength;
00090 
00091     bool colorCodingNeedsUpdate, arrowPlotNeedsUpdate, streamlinesNeedsUpdate;
00092 
00093     QImage colorCodingImage, arrowPlotImage, streamlinesImage;
00094 
00095     typedef QList<vec3> Streamline;
00096     Streamline computeStreamline(vec3 p, int w, int h, bool lookup=true); // lookup: use lookup structure and check against dSep/dTest (yes/no)
00097     vec3 selectSeedPoint(Streamline streamLine, bool& valid);
00098     bool isPointValid(vec3 p, int testDistance);
00099     void addPointToLookup(vec3 p);
00100     vec3 integratePoint(vec3 pos, FlowChannel* channelX, FlowChannel* channelY, float dt, float direction);
00101     void drawStreamline(const Streamline& streamline, QPainter& painter, int w, int h);
00102 
00103     QList<vec3>* lookupGrid; // two-dimensional cartesian lookup structure. each cell stores a list of points (x,y); z is ignored
00104     int lookupW, lookupH; // dimensions of cartesian grid
00105     int dSep, dTest;
00106 };
00107 
00108 #endif // RenderingView_H

Generated on Wed Jan 19 2011 13:25:19 for LU Visualisierung WS2010 - Beispiel 1 by  doxygen 1.7.2