cgal/Packages/Partition_2/test/Partition_2/test_y_monotone.h

31 lines
1.3 KiB
C++

void test_y_monotone()
{
Polygon_2 polygon;
std::list<Polygon_2> partition_polys;
polygon.erase(polygon.vertices_begin(), polygon.vertices_end());
make_monotone_convex(polygon);
CGAL::y_monotone_partition_2(polygon.vertices_begin(),
polygon.vertices_end(),
std::back_inserter(partition_polys));
assert (partition_polys.size() == 1 &&
partition_polys.front().size() == polygon.size());
assert(CGAL::is_y_monotone_2(partition_polys.front().vertices_begin(),
partition_polys.front().vertices_end()));
partition_polys.clear();
polygon.erase(polygon.vertices_begin(), polygon.vertices_end());
make_monotone_w_collinear_points(polygon);
CGAL::y_monotone_partition_2(polygon.vertices_begin(),
polygon.vertices_end(),
std::back_inserter(partition_polys));
partition_polys.clear();
polygon.erase(polygon.vertices_begin(), polygon.vertices_end());
make_nonmonotone(polygon);
CGAL::y_monotone_partition_2(polygon.vertices_begin(),
polygon.vertices_end(),
std::back_inserter(partition_polys));
}