add a test to ensure projection_traits is working

This commit is contained in:
Sébastien Loriot 2012-05-28 07:51:18 +00:00
parent 19857458b6
commit 2bd87a7c7a
2 changed files with 26 additions and 0 deletions

1
.gitattributes vendored
View File

@ -1427,6 +1427,7 @@ Convex_decomposition_3/test/Convex_decomposition_3/star.nef3 -text
Convex_hull_2/demo/Convex_hull_2/help/index.html svneol=native#text/html
Convex_hull_2/doc_tex/Convex_hull_2/convex_hull.png -text
Convex_hull_2/doc_tex/Convex_hull_2/saarhull.png -text svneol=unset#image/png
Convex_hull_2/test/Convex_hull_2/ch2_projection_3.cpp -text
Convex_hull_3/benchmark/Convex_hull_3/compare_different_approach.cpp -text
Convex_hull_3/benchmark/Convex_hull_3/is_on_positive_side.cpp -text
Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt -text

View File

@ -0,0 +1,25 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/convex_hull_2.h>
#include <CGAL/Projection_traits_xy_3.h>
#include <iostream>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Projection_traits_xy_3<Kernel> Traits;
typedef Traits::Point_2 Point_2;
int main(){
std::vector<Point_2> points;
std::ifstream input("data/CD500");
double x,y;
while (input >> x >> y){
points.push_back(Point_2(x,y,3.));
}
std::vector<Point_2> ch2;
CGAL::convex_hull_2(points.begin(),points.end(),std::back_inserter(ch2),Traits());
std::cout << ch2.size() << std::endl;
}