Skip to content

Instantly share code, notes, and snippets.

@afabri
Created January 23, 2017 07:42
Show Gist options
  • Save afabri/1c12a9c0c32fd6cbe22fee72e4a10984 to your computer and use it in GitHub Desktop.
Save afabri/1c12a9c0c32fd6cbe22fee72e4a10984 to your computer and use it in GitHub Desktop.
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Projection_traits_xy_3.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K> Gt;
typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned int, Gt> Vb;
typedef CGAL::Triangulation_data_structure_2<Vb> Tds;
typedef CGAL::Delaunay_triangulation_2<Gt,Tds> Delaunay;
typedef K::Point_3 Point;
int main()
{
std::ifstream in("data/terrain.cin");
std::istream_iterator<Point> begin(in);
std::istream_iterator<Point> end;
Delaunay dt(begin, end);
std::cout << dt.number_of_vertices() << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment