CGAL 6.1.2 - 2D Triangulations on the Sphere

Loading...
Searching...
No Matches
Triangulation_on_sphere_2/triang_on_sphere_range.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_on_sphere_2.h>
#include <CGAL/Projection_on_sphere_traits_3.h>
#include <iostream>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_on_sphere_traits_3<K> Traits;
typedef CGAL::Delaunay_triangulation_on_sphere_2<Traits> DToS2;
typedef DToS2::Point_3 Point;
int main(int argc, char** argv)
{
std::cout.precision(17);
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/radar.xyz");
std::vector<Point> points;
double x, y, z;
std::ifstream in(filename);
if(!in)
{
std::cerr << "Invalid input file: " << filename << std::endl;
return EXIT_FAILURE;
}
while(in >> x >> y >> z)
points.emplace_back(x, y, z);
std::cout << points.size() << " points in input" << std::endl;
Traits traits(Point(0, 0, 0), 100);
DToS2 dtos(points.begin(), points.end(), traits);
std::cout << dtos.number_of_vertices() << " vertices" << std::endl;
std::cout << dtos.number_of_solid_faces() << " solid faces" << std::endl;
CGAL::IO::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17));
return EXIT_SUCCESS;
}
CGAL::Delaunay_triangulation_on_sphere_2
The class Delaunay_triangulation_on_sphere_2 is designed to represent the Delaunay triangulation of a...
Definition: Delaunay_triangulation_on_sphere_2.h:32
CGAL::Exact_predicates_inexact_constructions_kernel
CGAL::Projection_on_sphere_traits_3
The class Projection_on_sphere_traits_3 is a model of the concept DelaunayTriangulationOnSphereTraits...
Definition: Projection_on_sphere_traits_3.h:23
CGAL::IO::write_OFF
bool write_OFF(std::ostream &os, const PointRange &points, const PolygonRange &polygons, const NamedParameters &np=parameters::default_values())