00001
00002
00004
00005
00006 #if !defined(AFX_DSEPGRID_H__31D244F2_E6D7_4CF5_96D7_F12A4D99648F__INCLUDED_)
00007 #define AFX_DSEPGRID_H__31D244F2_E6D7_4CF5_96D7_F12A4D99648F__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012
00014
00020 class CDSepGrid : public CObject
00021 {
00022 public:
00023 bool IsValidIndex();
00024 void Clamp(int &x, int &y, int &z);
00025 bool IsValidIndex(int x, int y, int z);
00026 void Insert(CSamplePoint *samplePoint, int x, int y, int z);
00027 void GetXYZIndex(int &x, int &y, int &z, CPoint3D &pos);
00028 void CreateGrid();
00029 CVectorField * GetVectorField();
00030
00031 void DeleteGrid();
00032
00034 void InitGrid();
00035
00037 float GetDTest();
00039 float GetDSep();
00040
00042 void SetDTest(float dTest);
00044 void SetDSep(float dSep);
00045
00047 int GetXIndex(CSamplePoint *samplePoint);
00049 int GetYIndex(CSamplePoint *samplePoint);
00051 int GetZIndex(CSamplePoint *samplePoint);
00052
00053 void SetVectorField(CVectorField *vectorField);
00054
00056 void Insert(CSamplePoint *samplePoint);
00057
00059 bool TestValid(int type, CSamplePoint *samplePoint);
00060
00062 CDSepGrid& operator=(const CDSepGrid &dSepGrid);
00063
00065 CDSepGrid(const CDSepGrid &dSepGrid);
00066 CDSepGrid();
00067 CDSepGrid(CVectorField * vectorField, float dSep, float dTest);
00068
00069 virtual ~CDSepGrid();
00070
00071 private:
00072 float m_QuadMinDist_line;
00073 float m_QuadMinDist_start;
00074
00075 float m_DSep;
00076 float m_InvDSep;
00077 float m_DTest;
00078 int m_XDim;
00079 int m_YDim;
00080 int m_ZDim;
00081 int m_MaxXIndex;
00082 int m_MaxYIndex;
00083 int m_MaxZIndex;
00084 CPoint3D m_MinPos;
00085 CPoint3D m_MaxPos;
00086
00087 CVectorField *m_VectorField;
00089 CObList *** m_DSepGrid;
00090 };
00091
00092 #endif // !defined(AFX_DSEPGRID_H__31D244F2_E6D7_4CF5_96D7_F12A4D99648F__INCLUDED_)