diff --git a/Minkowski_sum_2/new/mink.cpp b/Minkowski_sum_2/new/mink.cpp deleted file mode 100644 index 2288b47599e..00000000000 --- a/Minkowski_sum_2/new/mink.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// Global counters -int _my_global_counter =0; -double rc_time =0; -double arr_build_time =0; -double final_stage_time =0; -double degenerate_stage =0; - -#include "MyMink.h" - -#include -#include -//#include -#include -#include -#include - -#include -#include "SweepCollisionDetection.h" -//#include -using namespace std; -using namespace CGAL; -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -//typedef CGAL::Filtered_kernel Kernel; -typedef CGAL::Polygon_2 Polygon; -typedef CGAL::Arr_segment_traits_2 Segment_traits_2; -typedef Segment_traits_2::Point_2 Point; - -typedef CGAL::Polygon_with_holes_2 PolygonWithHoles; -std::istream &operator>>(std::istream & is, Polygon& pl) -{ - pl.clear(); - int size; - is >> size; - for (int i=0; i> p; - pl.push_back(p); - } - - - return is; -} - -int main(int argc,char* argv[]){ - Polygon a; - Polygon b; - PolygonWithHoles sum; - - - if (argc < 3) - { - cout<< "Usage: mink.exe file1 file2" <> a >> b; - fstream data1(argv[1]); - data1 >> a; - fstream data2(argv[2]); - data2 >> b; - if (a.is_clockwise_oriented()) - a.reverse_orientation(); - if (b.is_clockwise_oriented()) - b.reverse_orientation(); - if (!a.is_simple ()) - { - cout<< "a is not simple" <x())+CGAL::to_double(b.bottom_vertex()->x())); - double bottomy = (CGAL::to_double(a.bottom_vertex()->y())+CGAL::to_double(b.bottom_vertex()->y())); - double leftx = (CGAL::to_double(a.left_vertex()->x())+CGAL::to_double(b.left_vertex()->x())); - //double lefty = (CGAL::to_double(a.bottom_vertex()->x())+CGAL::to_double(b.bottom_vertex()->x())); - //double topx = (CGAL::to_double(a.bottom_vertex()->x())+CGAL::to_double(b.bottom_vertex()->x())); - double topy = (CGAL::to_double(a.top_vertex()->y())+CGAL::to_double(b.top_vertex()->y())); - double rightx = (CGAL::to_double(a.right_vertex()->x())+CGAL::to_double(b.right_vertex()->x())); - //double righty = (CGAL::to_double(a.bottom_vertex()->x())+CGAL::to_double(b.bottom_vertex()->x())); - /* - global_graphics = new Graphics(0,0,leftx,rightx,bottomy,topy); - QColor c(0,255,0); - -if (SHOW_STAGES) -{ - - - global_graphics->draw_polygon(a,c); - global_graphics->display(); - global_graphics->clear(); - global_graphics->draw_polygon(b,c); - global_graphics->display(); - global_graphics->clear(); -} -*/ -//#endif - - - /*a.push_back(Point(0.197005,0.504386)); - a.push_back(Point(0.199309,0.384503)); - a.push_back(Point(0.800691,0.375731)); - a.push_back(Point(0.796083,0.500000));*/ - -/* a.push_back(Point(0.5,0.7)); - a.push_back(Point(0.2,0.2)); - a.push_back(Point(0.5,0.4)); - a.push_back(Point(0.8,0.2)); - */ -/* - b.push_back(Point(0,0)); - b.push_back(Point(1,0)); - //b.push_back(Point(2,0)); - b.push_back(Point(1,1)); - - */ - - /*b.push_back(Point(0.906682,0.890351)); - b.push_back(Point(0.261521,0.896199)); - b.push_back(Point(0.256912,0.703216)); - b.push_back(Point(0.839862,0.711988)); - b.push_back(Point(0.849078,0.583333)); - b.push_back(Point(0.236175,0.606725)); - b.push_back(Point(0.240783,0.472222)); - b.push_back(Point(0.879032,0.472222)); - b.push_back(Point(0.892857,0.311404)); - b.push_back(Point(0.164747,0.270468)); - b.push_back(Point(0.169355,0.156433)); - b.push_back(Point(0.975806,0.179825));*/ - - - /*b.push_back(Point(0.307604,0.899123)); - b.push_back(Point(0.100230,0.878655)); - b.push_back(Point(0.102535,0.097953)); - b.push_back(Point(0.899770,0.118421)); - b.push_back(Point(0.899770,0.896199)); - b.push_back(Point(0.809908,0.896199)); - b.push_back(Point(0.802995,0.796784)); - b.push_back(Point(0.853687,0.796784)); - b.push_back(Point(0.849078,0.200292)); - b.push_back(Point(0.148618,0.200292)); - b.push_back(Point(0.148618,0.711988)); - b.push_back(Point(0.300000,0.703216));*/ - - //// test collision detection. - //SweepCollisionDetector coll; - //bool collide = coll.checkCollision(a,b); - - //cout << "collide: " << collide << "\n"; - - double timer_end; - - //Polygon sum_bound; - boost::timer t; - //cout<< "before"; - try{ - sum = minkowski_sum_2_(a,b); -/* global_graphics->draw_polygon(sum,c); - global_graphics->display(); - global_graphics->clear();*/ - } - catch(exception ex) - { - cout <> e; -/* global_graphics->draw_polygon(sum.outer_boundary(),c); - PolygonWithHoles::Hole_iterator itr = sum.holes_begin(); - for (;itr != sum.holes_end();++itr) - { - global_graphics->draw_polygon(*itr,c); - } - global_graphics->display(); - global_graphics->clear();*/ - //std::list sum_holes; - //Minkowski_sum_by_convolution_lien_2 /tmp/cgal-test - else - /usr/bin/time -f "%e %M" ./test $algo tests/$test/a.dat tests/$test/b.dat 2> /tmp/cgal-test - fi - RESULT="$?" - cat /tmp/cgal-test | tail -1 | head -c -1 -q - echo -e "\t$RESULT" - done -done diff --git a/Minkowski_sum_2/new/test.cpp b/Minkowski_sum_2/new/test.cpp deleted file mode 100644 index e75c4c630f2..00000000000 --- a/Minkowski_sum_2/new/test.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include - -#include -#include -#include -using namespace std; - -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef CGAL::Polygon_2 Polygon_2; -typedef CGAL::Point_2 Point_2; -typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - -// Check if two polygons with holes are the same. -bool are_equal(const Polygon_with_holes_2& ph1, const Polygon_with_holes_2& ph2) -{ - list sym_diff; - - CGAL::symmetric_difference(ph1, ph2, std::back_inserter(sym_diff)); - - return (sym_diff.empty()); -} - - -int main(int argc, char* argv[]) { - if (argc < 4) { - cerr << "Usage: (0=old|1=new) polygon-file polygon-file [result-file]" << endl; - return 0; - } - - Polygon_2 a, b; - Polygon_with_holes_2 c; - - Polygon_with_holes_2 (*algo)(const Polygon_2&, const Polygon_2&); - switch (atoi(argv[1])) { - case 0: - algo = &CGAL::minkowski_sum_2; - break; - case 1: - algo = &CGAL::minkowski_sum_2_new; - break; - default: - cerr << "Unknown algorithm" << endl; - return 1; - } - - fstream data1(argv[2]); - data1 >> a; - fstream data2(argv[3]); - data2 >> b; - - bool verify = argc > 4; - if (verify) { - fstream data3(argv[4]); - data3 >> c; - } - - Polygon_with_holes_2 sum2 = algo(a, b); - - if (verify) { - if (!are_equal(sum2, c)) { - cerr << "Expected:" << endl; - cerr << c; - cerr << "Got:" << endl; - cerr << sum2; - return 1; - } - } else { - return 2; - } - - return 0; -} diff --git a/Minkowski_sum_2/new/tests/bowl_with_hole/a.dat b/Minkowski_sum_2/new/tests/bowl_with_hole/a.dat deleted file mode 100644 index be6ac764b67..00000000000 --- a/Minkowski_sum_2/new/tests/bowl_with_hole/a.dat +++ /dev/null @@ -1,13 +0,0 @@ -12 -0 0 -6 0 -6 6 -4 6 -4 5 -5 5 -5 1 -1 1 -1 5 -3 5 -3 6 -0 6 diff --git a/Minkowski_sum_2/new/tests/bowl_with_hole/b.dat b/Minkowski_sum_2/new/tests/bowl_with_hole/b.dat deleted file mode 100644 index 65447293ca0..00000000000 --- a/Minkowski_sum_2/new/tests/bowl_with_hole/b.dat +++ /dev/null @@ -1,5 +0,0 @@ -4 --1 -1 -1 -1 -1 1 --1 1 diff --git a/Minkowski_sum_2/new/tests/bowl_with_hole/result.dat b/Minkowski_sum_2/new/tests/bowl_with_hole/result.dat deleted file mode 100644 index b3c41190dcb..00000000000 --- a/Minkowski_sum_2/new/tests/bowl_with_hole/result.dat +++ /dev/null @@ -1,11 +0,0 @@ -4 --1 -1 -7 -1 -7 7 --1 7 -1 -4 -2 2 -2 4 -4 4 -4 2 diff --git a/Minkowski_sum_2/new/tests/dangling_edge/a.dat b/Minkowski_sum_2/new/tests/dangling_edge/a.dat deleted file mode 100644 index f686629f170..00000000000 --- a/Minkowski_sum_2/new/tests/dangling_edge/a.dat +++ /dev/null @@ -1,13 +0,0 @@ -12 -0 0 -6 0 -6 6 -4 6 -4 5 -5 5 -5 1 -1 1 -1 5 -2 5 -2 6 -0 6 diff --git a/Minkowski_sum_2/new/tests/dangling_edge/b.dat b/Minkowski_sum_2/new/tests/dangling_edge/b.dat deleted file mode 100644 index 65447293ca0..00000000000 --- a/Minkowski_sum_2/new/tests/dangling_edge/b.dat +++ /dev/null @@ -1,5 +0,0 @@ -4 --1 -1 -1 -1 -1 1 --1 1 diff --git a/Minkowski_sum_2/new/tests/dangling_edge/result.dat b/Minkowski_sum_2/new/tests/dangling_edge/result.dat deleted file mode 100644 index b3c41190dcb..00000000000 --- a/Minkowski_sum_2/new/tests/dangling_edge/result.dat +++ /dev/null @@ -1,11 +0,0 @@ -4 --1 -1 -7 -1 -7 7 --1 7 -1 -4 -2 2 -2 4 -4 4 -4 2 diff --git a/Minkowski_sum_2/new/tests/isolated_vertex/a.dat b/Minkowski_sum_2/new/tests/isolated_vertex/a.dat deleted file mode 100644 index 066bbceeb0b..00000000000 --- a/Minkowski_sum_2/new/tests/isolated_vertex/a.dat +++ /dev/null @@ -1,13 +0,0 @@ -12 -0 0 -6 0 -6 6 -3 6 -3 4 -4 4 -4 2 -2 2 -2 4 -3 4 -3 6 -0 6 diff --git a/Minkowski_sum_2/new/tests/isolated_vertex/b.dat b/Minkowski_sum_2/new/tests/isolated_vertex/b.dat deleted file mode 100644 index 65447293ca0..00000000000 --- a/Minkowski_sum_2/new/tests/isolated_vertex/b.dat +++ /dev/null @@ -1,5 +0,0 @@ -4 --1 -1 -1 -1 -1 1 --1 1 diff --git a/Minkowski_sum_2/new/tests/isolated_vertex/result.dat b/Minkowski_sum_2/new/tests/isolated_vertex/result.dat deleted file mode 100644 index 155fa7f7706..00000000000 --- a/Minkowski_sum_2/new/tests/isolated_vertex/result.dat +++ /dev/null @@ -1,5 +0,0 @@ -4 --1 -1 -7 -1 -7 7 --1 7