21class voronoiGenerator {
24 typedef double coordinate_type;
25 typedef point_data<coordinate_type> point_type;
30 typedef segment_data<coordinate_type> segment_type;
31 typedef rectangle_data<coordinate_type> rect_type;
32 typedef voronoi_builder<int> VB;
33 typedef voronoi_diagram<coordinate_type> VD;
34 typedef VD::edge_type edge_type;
35 typedef VD::cell_type cell_type;
36 typedef VD::cell_type::source_index_type source_index_type;
37 typedef VD::cell_type::source_category_type source_category_type;
38 typedef VD::cell_container_type cell_container_type;
39 typedef VD::cell_container_type vertex_container_type;
40 typedef VD::edge_container_type edge_container_type;
41 typedef VD::const_cell_iterator const_cell_iterator;
42 typedef VD::const_vertex_iterator const_vertex_iterator;
43 typedef VD::const_edge_iterator const_edge_iterator;
45 std::vector<segment_type> segment_data_;
48 std::vector<point_type> point_data_;
52 static void generateVoronoi(
const QList<QPoint>& points, boost::polygon::voronoi_diagram<double>& vd);
53 static QPoint findIntersection(
const QLineF& line,
double rectX,
double rectY,
double width,
double height);
54 void update_points(
const QList<QPoint>& points);
56 void old_voronoi_plot();
58 void set_brect(QRectF Rect);
61 QPointF calculateIntersection(
const QPointF &point,
const QPointF &direction,
const QRectF &bounds);
62 QPointF calculateIntersectionII(
const QPointF& knownPoint,
const QPointF& midPoint,
const QRectF& bounds);
63 void clip_infinite_edge(
const edge_type &edge, std::vector<point_type> *clipped_edge);
64 point_type retrieve_point(
const cell_type &cell);
66 segment_type retrieve_segment(
const cell_type &cell);