32 #ifndef SWEEP_CONTEXT_H
33 #define SWEEP_CONTEXT_H
43 const double kAlpha = 0.3;
59 void set_head(
Point* p1);
63 void set_tail(
Point* p1);
67 size_t point_count()
const;
71 void RemoveNode(
Node* node);
73 void CreateAdvancingFront(
const std::vector<Node*>& nodes);
80 Point* GetPoint(
size_t index);
84 void RemoveFromMap(
Triangle* triangle);
86 void AddHole(
const std::vector<Point*>& polyline);
88 void AddPoint(
Point* point);
94 std::vector<Triangle*> &GetTriangles();
95 std::list<Triangle*> &GetMap();
97 std::vector<Edge*> edge_list;
106 Basin() : left_node(NULL), bottom_node(NULL), right_node(NULL), width(0.0), left_highest(false)
116 left_highest =
false;
121 Edge* constrained_edge;
124 EdgeEvent() : constrained_edge(NULL), right(false)
130 EdgeEvent edge_event;
136 std::vector<Triangle*> triangles_;
137 std::list<Triangle*> map_;
138 std::vector<Point*> points_;
141 AdvancingFront* front_;
147 Node *af_head_, *af_middle_, *af_tail_;
149 void InitTriangulation();
150 void InitEdges(
const std::vector<Point*>& polyline);
154 inline AdvancingFront* SweepContext::front()
const
159 inline size_t SweepContext::point_count()
const
161 return points_.size();
164 inline void SweepContext::set_head(Point* p1)
169 inline Point* SweepContext::head()
const
174 inline void SweepContext::set_tail(Point* p1)
179 inline Point* SweepContext::tail()
const