#include <CGAL/basic.h>
#include <CGAL/Arr_extended_dcel.h>
#include <CGAL/Arr_observer.h>
#include "arr_exact_construction_segments.h"
private:
size_t n_faces;
public:
Face_index_observer(Ex_arrangement& arr) :
{
CGAL_precondition (arr.is_empty());
arr.unbounded_face()->set_data (0);
}
{
new_face->set_data(++n_faces);
}
};
int main() {
Ex_arrangement arr;
Face_index_observer obs(arr);
insert(arr, Segment(Point(1, 3), Point(7, 3)));
insert(arr, Segment(Point(1, 3), Point(4, 8)));
insert(arr, Segment(Point(4, 8), Point(7, 3)));
std::cout << arr.number_of_faces() << " faces:\n";
for (auto fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) {
std::cout << "Face no. " << fit->data() << ": ";
if (fit->is_unbounded()) std::cout << "Unbounded.\n";
else {
auto curr = fit->outer_ccb();
std::cout << curr->source()->point();
do std::cout << " --> " << curr->target()->point();
while (++curr != fit->outer_ccb());
std::cout << std::endl;
}
}
return 0;
}