00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00025 #ifndef _DELAUNAY_TEST_LOGIC_H_ 00026 #define _DELAUNAY_TEST_LOGIC_H_ 00027 00028 #include "Point.h" 00029 #include "Line.h" 00030 #include "Circle.h" 00031 00032 #include <vector> 00033 #include <map> 00034 00035 namespace EdgeAlgebra 00036 { 00037 class Site; 00038 class QuadEdge; 00039 class DelaunayTriangulation; 00040 } 00041 00042 namespace DelaunayTest 00043 { 00044 00048 class DelaunayTestLogic 00049 { 00050 public: 00052 DelaunayTestLogic(void); 00053 00055 ~DelaunayTestLogic(void); 00056 00058 void Triangulate(void); 00059 00061 void Reset(void); 00062 00065 void AddSites(void); 00066 00069 void RemoveSites(void); 00070 00073 void EnableCircles(void); 00074 00077 const std::vector<Point>& GetPoints(void) const; 00078 00081 const std::vector<Line>& GetLines(void) const; 00082 00085 const std::vector<Circle>& GetCircles(void) const; 00086 00089 bool IsCirclesEnabled(void); 00090 00093 bool IsTriangulated(void); 00094 00095 private: 00097 const int m_pointsCount; 00098 00100 const float m_minRange; 00101 00103 const float m_maxRange; 00104 00106 const int m_points2AddCount; 00107 00109 const int m_maxPoints2Add; 00110 00112 std::vector<Point> m_points; 00113 00115 std::vector<Line> m_lines; 00116 00118 std::vector<Circle> m_circles; 00119 00121 bool m_isTriangulated; 00122 00124 bool m_circlesEnabled; 00125 00127 DelaunayTestLogic(const DelaunayTestLogic&); 00128 00130 DelaunayTestLogic& operator=(const DelaunayTestLogic&); 00131 00135 void AddRandomPoints(int pointsCount); 00136 00139 void TriangulatePoints(void); 00140 00144 void CreateLines(const std::map<EdgeAlgebra::QuadEdge*, char>& edges); 00145 00150 void CreateCircles(const std::map<EdgeAlgebra::QuadEdge*, char>& edges); 00151 00156 void CreateCircle(EdgeAlgebra::QuadEdge* edge, EdgeAlgebra::QuadEdge* xnext); 00157 }; 00158 00159 } 00160 00161 #endif