int main() { std::vector< std::pair<Wpoint,unsigned> > points; points.push_back( std::make_pair(Wpoint(Point(0,0),2),0) ); points.push_back( std::make_pair(Wpoint(Point(1,0),2),1) ); points.push_back( std::make_pair(Wpoint(Point(0,1),2),2) ); points.push_back( std::make_pair(Wpoint(Point(-4,54),2),3) ); points.push_back( std::make_pair(Wpoint(Point(2,2),2),4) ); points.push_back( std::make_pair(Wpoint(Point(-1,0),2),5) ); Regular rt; rt.insert( points.begin(),points.end() ); CGAL_assertion( rt.number_of_vertices() == 6 ); // check that the info was correctly set. Regular::Finite_vertices_iterator vit; for (vit = rt.finite_vertices_begin(); vit != rt.finite_vertices_end(); ++vit) if( points[ vit->info() ].first != vit->point() ){ std::cerr << "Error different info" << std::endl; exit(EXIT_FAILURE); } std::cout << "OK" << std::endl; return 0; }
void UnionOfBallsView::draw(QPainter &painter, const Regular ®ular, Regular::Finite_vertices_iterator &vit) { std::list<Segment> segments; generate_circle(vit->point(), segments); if (regular.dimension() > 0) { Weighted_point wp = vit->point(); const Regular::Geom_traits > = regular.geom_traits(); Regular::Vertex_circulator adj_vit = regular.incident_vertices(vit); Regular::Vertex_circulator adj_vit_start = adj_vit; do { if (!regular.is_infinite(adj_vit)) { Line l = gt.construct_radical_axis_2_object()(wp, adj_vit->point()); clip(segments, l); } } while (++adj_vit != adj_vit_start); } painter << segments; }