//! Initialize an arrangement void init_arr(Arrangement& arr, int verbose_level) { // Initialize the data of the halfedges of the arrangement. Halfedge_iterator heit; for (heit = arr.halfedges_begin(); heit != arr.halfedges_end(); ++heit) heit->set_data(heit->curve().data() * ((heit->direction() == CGAL::ARR_LEFT_TO_RIGHT) ? 1 : 2)); // Initialize the data of the faces of the arrangement. Face_iterator fit; for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) { unsigned int count = 0; // Outer ccb Outer_ccb_iterator ocit; for (ocit = fit->outer_ccbs_begin(); ocit != fit->outer_ccbs_end(); ++ocit) { Ccb_halfedge_circulator curr = *ocit; do count += curr->data() * 2; while (++curr != *ocit); } // Inner ccbs Inner_ccb_iterator icit; for (icit = fit->inner_ccbs_begin(); icit != fit->inner_ccbs_end(); ++icit) { Ccb_halfedge_circulator curr = *icit; do count += curr->data(); while (++curr != *icit); } fit->set_data(count); } // Initialize the data of the vertices of the arrangement. Vertex_iterator vit; for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) { unsigned int count = 0; if (vit->is_isolated()) count = vit->face()->data(); else { Halfedge_around_vertex_const_circulator curr = vit->incident_halfedges(); do count += curr->data(); while (++curr != vit->incident_halfedges()); } vit->set_data(count); } if (verbose_level > 0) std::cout << "Arrangement Input: " << std::endl; if (verbose_level > 1) { std::cout << "Halfedge Data: " << std::endl; Halfedge_iterator heit; for (heit = arr.halfedges_begin(); heit != arr.halfedges_end(); ++heit) std::cout << heit->source()->point() << " " << heit->target()->point() << " " << heit->data() << std::endl; } if (verbose_level > 0) { std::cout << "Face Data: " << std::endl; Face_iterator fit; for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) std::cout << fit->data() << std::endl; } }