Add a test; make it ork on non-VC++ platforms

This commit is contained in:
Andreas Fabri 2015-06-24 09:34:17 +02:00
parent 3757ca30c6
commit 740479e8f0
3 changed files with 49 additions and 3 deletions

View File

@ -2447,7 +2447,7 @@ namespace CGAL {
typedef typename Kernel_traits<InputPoint>::Kernel InputKernel;
typedef Cartesian_converter<InputKernel,Kernel> CC;
typedef typename Kernel::Point_3 Point_3;
CC cc=CC();
Triangulation_3 dt( boost::make_transform_iterator(b, AFSR::Auto_count_cc<Point_3,CC>(cc)),
boost::make_transform_iterator(e, AFSR::Auto_count_cc<Point_3,CC>(cc) ) );

View File

@ -5,7 +5,6 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Advancing_front_surface_reconstruction.h>
#include <CGAL/tuple.h>
typedef CGAL::Simple_cartesian<double> K;
@ -25,7 +24,7 @@ operator<<(std::ostream& os, const Facet& f)
template <typename K>
void fct(const char* fname)
{
typedef K::Point_3 Point_3;
typedef typename K::Point_3 Point_3;
std::ifstream in(fname);
std::vector<Point_3> points;
std::vector<Facet> facets;

View File

@ -0,0 +1,47 @@
#include <iostream>
#include <fstream>
#include <algorithm>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Advancing_front_surface_reconstruction.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
typedef CGAL::Simple_cartesian<double> K;
typedef K::Point_3 Point_3;
typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef CGAL::cpp11::array<std::size_t,3> Facet;
namespace std {
std::ostream&
operator<<(std::ostream& os, const Facet& f)
{
os << "3 " << f[0] << " " << f[1] << " " << f[2];
return os;
}
}
int main()
{
Polyhedron polyhedron;
std::ifstream in("data.planar.xyz");
std::vector<Point_3> points;
std::vector<Facet> facets;
std::copy(std::istream_iterator<Point_3>(in),
std::istream_iterator<Point_3>(),
std::back_inserter(points));
CGAL::advancing_front_surface_reconstruction(points.begin(),
points.end(),
polyhedron);
std::cout << polyhedron << std::endl;
return 0;
}