#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/CGAL_Ipelet_base.h>
namespace my_triangulation{
typedef CGAL::Delaunay_triangulation_2<Kernel> Delaunay;
const std::string labels[] = { "Delaunay","Help" };
const std::string hmsg[] = {
"Draw a Delaunay triangulation of a set of points"
};
class Triangulation_ipelet
public:
Triangulation_ipelet()
void protected_run(int);
};
void Triangulation_ipelet::protected_run(int fn)
{
switch (fn){
case 1:
show_help();
return;
default:
std::list<Point_2> pt_lst;
read_active_objects(
CGAL::dispatch_or_drop_output<Point_2>(std::back_inserter(pt_lst))
);
if (pt_lst.empty()) {
print_error_message("No mark selected");
return;
}
Delaunay dt;
dt.insert(pt_lst.begin(),pt_lst.end());
draw_in_ipe(dt);
};
}
}