VisLU Flow 0.1
|
00001 #ifndef STREAMGRID_H 00002 #define STREAMGRID_H 00003 00004 #include "streamline.h" 00005 #include "vec3.h" 00006 00007 #include "FlowGeometry.h" 00008 #include "FlowChannel.h" 00009 00010 #include <queue> 00011 #include <vector> 00012 00013 class StreamGrid 00014 { 00015 friend class Streamline; 00016 00017 public: 00018 StreamGrid(int x, int y, int sep, float test, float step, FlowGeometry geo, FlowChannel* chanX, FlowChannel* chanY, bool rk); 00019 ~StreamGrid(); 00020 00021 void calculateGrid(void); 00022 00023 std::vector<Streamline*> getAllStreamlines(void); 00024 00025 void addStreamline(const vec3& seed); 00026 void addStreamline(Streamline* line); 00027 00028 bool getStreamline(Streamline* line); 00029 00030 void addSample(const vec3& point); 00031 00032 vec3 getVelocity(const vec3& point); 00033 00034 void clear(void); 00035 00036 void setDSep(int sep); 00037 void setDTest(float test); 00038 void setStepSize(float step); 00039 00040 int getDSep(void) { return this->dSep; } 00041 float getDTest(void) { return this->dTest; } 00042 float getStepSize(void) { return this->stepSize; } 00043 00044 void setUseRungeKutta(bool rk) { this->rungeKutta = rk; } 00045 00046 bool useRungeKutta(void) { return this->rungeKutta; } 00047 00048 int getDimX(void) { return this->dimX; } 00049 int getDimY(void) { return this->dimY; } 00050 FlowChannel* getChannelX(void) { return this->channelX; } 00051 FlowChannel* getChannelY(void) { return this->channelY; } 00052 00053 int getMaxX(void) { return this->geometry.getMaxX(); } 00054 int getMaxY(void) { return this->geometry.getMaxY(); } 00055 00056 bool checkDistanceForStop(const vec3& point); 00057 bool checkDistanceForSeed(const vec3& point); 00058 private: 00059 int dSep; 00060 float dTest; 00061 float stepSize; 00062 00063 bool rungeKutta; 00064 00065 FlowGeometry geometry; 00066 FlowChannel* channelX; 00067 FlowChannel* channelY; 00068 00069 int dimX; 00070 int dimY; 00071 00072 int cellsX; 00073 int cellsY; 00074 00075 std::vector<std::vector<vec3>*> cells; 00076 std::vector<Streamline*> streamlines; 00077 std::queue<Streamline*> possibleStreamlines; 00078 00079 bool checkDistance(const vec3& point, float dist); 00080 }; 00081 00082 #endif // STREAMGRID_H