C:/Projekte/C++/FlowVIS_107/src/StreamLineGrid.h

Go to the documentation of this file.
00001 #ifndef STREAMLINEGRID_H
00002 #define STREAMLINEGRID_H
00003 
00004 #include "common.h"
00005 #include <vector>
00006 
00007 using namespace std;
00008 
00009 
00010 #define NUM_NEIGHBORS 3   // number of neighbor-cell to test (value for one dimension), i.e. 3 == get 9 cells
00011 
00012 
00013 struct slgGridCell
00014 {  
00015   vector<vec3> points;  // SL-sample-points in this cell
00016 };
00017 
00018 
00019 class StreamLineGrid
00020 {
00021 
00022 public:
00023   StreamLineGrid( float dSep );
00024 
00025   ~StreamLineGrid();
00026 
00028   bool addPoint( vec3 point );
00029 
00034   float getMinimalDistance( vec3 point, vec3 exceptionPoint );
00035 
00037   //bool isValidPoint( vec3 point );
00038 
00040   void printGrid();
00041 
00042 
00043 private:
00044 
00046   int getCellIndex( vec3 point );
00047 
00049   int getCellIndex( int idxX, int idxY );
00050 
00052   int getCellIndexX( vec3 point );
00053 
00055   int getCellIndexY( vec3 point );
00056 
00058   slgGridCell getCell( int cellIdx );
00059 
00061   //vector<vec3> getCellPoints( int cellIdx );
00062 
00064   slgGridCell* getSurroundingCells( vec3 point );
00065 
00066 
00067 private:
00068 
00069   // gv Regular grid for fast sample-points-lookup
00070   slgGridCell *m_grid; 
00071 
00073   int m_dim;
00074 
00076   float m_cellSize;
00077 
00078 };
00079 
00080 #endif

Generated on Mon Jan 21 14:50:12 2008 for VisLU by  doxygen 1.5.4