00001 #pragma once 00002 00003 #include "Texture.h" 00004 #include "StreamlineObj.h" 00005 #include <vector> 00006 #include "States.h" 00007 00008 #include <QMutex> 00009 #include <QSize> 00010 #include <QThread> 00011 #include <QImage> 00012 #include <QWaitCondition> 00013 #include <iostream> 00014 #include <sstream> 00015 #include <string> 00016 #include <string> 00017 #include <vector> 00018 #include <QReadWriteLock> 00019 00021 00026 class ThreadQTImplementation : public QThread 00027 { 00028 Q_OBJECT 00029 00030 public: 00036 ThreadQTImplementation(QObject *parent, QReadWriteLock* mutex); 00040 ~ThreadQTImplementation(void); 00041 00054 void RunThread(vec3 startp, Texture* grid, Texture* tex, int numsteps, float stepsize, float dsep, float dtest, float dt, States::StreamlineIntMode intmode); 00058 void run(); 00059 int timestep; 00060 bool stopped; 00061 bool getStop(); 00062 00063 QReadWriteLock* m_mutex; 00064 00065 protected: 00077 virtual void perform(vec3 startpos, Texture* gridtexture, Texture* texture, int numsteps, float stepsize, float dsep, float dtest, float dt, States::StreamlineIntMode intmode)=0; 00078 std::vector<std::vector<StreamlineObj*>> values; 00079 00080 00081 00082 private: 00083 Texture* texture; 00084 Texture* gridtexture; 00085 vec3 startpoint; 00086 QReadWriteLock* mutex; 00087 bool stop; 00088 int numsteps; 00089 float stepsize; 00090 float dsep; 00091 float dtest; 00092 float dt; 00093 States::StreamlineIntMode intmode; 00094 00095 signals: 00102 void renderedImage(StreamlineObj* streamv, int index1, int index2); 00103 00104 public slots: 00105 void stopSignal(); 00106 void startSignal(vec3 startp, Texture* grid, Texture* tex, int numsteps, float stepsize, float dsep, float dtest, float dt, States::StreamlineIntMode intmode); 00107 00108 };