diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgaladv.cc | 31 | ||||
-rw-r--r-- | src/cgaladv_convexhull2.cc | 4 |
2 files changed, 15 insertions, 20 deletions
diff --git a/src/cgaladv.cc b/src/cgaladv.cc index 48f14c7..45a3bdd 100644 --- a/src/cgaladv.cc +++ b/src/cgaladv.cc @@ -34,7 +34,7 @@ #ifdef ENABLE_CGAL extern CGAL_Nef_polyhedron3 minkowski3(CGAL_Nef_polyhedron3 a, CGAL_Nef_polyhedron3 b); extern CGAL_Nef_polyhedron2 minkowski2(CGAL_Nef_polyhedron2 a, CGAL_Nef_polyhedron2 b); -extern CGAL_Nef_polyhedron2 convexhull2(CGAL_Nef_polyhedron2 a, CGAL_Nef_polyhedron2 b); +extern CGAL_Nef_polyhedron2 convexhull2(CGAL_Nef_polyhedron2 a); #endif enum cgaladv_type_e { @@ -183,24 +183,19 @@ CGAL_Nef_polyhedron CgaladvNode::render_cgal_nef_polyhedron() const if (type == HULL) { - bool first = true; + foreach(AbstractNode * v, children) { - if (v->modinst->tag_background) - continue; - if (first) { - N = v->render_cgal_nef_polyhedron(); - if (N.dim != 0) - first = false; - } else { - CGAL_Nef_polyhedron tmp = v->render_cgal_nef_polyhedron(); - if (N.dim == 3 && tmp.dim == 3) { - - } - if (N.dim == 2 && tmp.dim == 2) { - N.p2 = convexhull2(N.p2, tmp.p2); - } - } - v->progress_report(); + if (v->modinst->tag_background) + continue; + N = v->render_cgal_nef_polyhedron(); + if (N.dim == 3) { + + } + if (N.dim == 2) { + N.p2 = convexhull2(N.p2); + } + v->progress_report(); + break; } } diff --git a/src/cgaladv_convexhull2.cc b/src/cgaladv_convexhull2.cc index 9505e44..1914954 100644 --- a/src/cgaladv_convexhull2.cc +++ b/src/cgaladv_convexhull2.cc @@ -29,7 +29,7 @@ #include "cgal.h" #include <CGAL/convex_hull_2.h> -extern CGAL_Nef_polyhedron2 convexhull2(CGAL_Nef_polyhedron2 a, CGAL_Nef_polyhedron2 b); +extern CGAL_Nef_polyhedron2 convexhull2(CGAL_Nef_polyhedron2 a); extern CGAL_Poly2 nef2p2(CGAL_Nef_polyhedron2 p); static std::list<CGAL_Nef_polyhedron2::Point> p2points(CGAL_Poly2 p2) @@ -44,7 +44,7 @@ static std::list<CGAL_Nef_polyhedron2::Point> p2points(CGAL_Poly2 p2) return points; } -CGAL_Nef_polyhedron2 convexhull2(CGAL_Nef_polyhedron2 a, CGAL_Nef_polyhedron2 b) +CGAL_Nef_polyhedron2 convexhull2(CGAL_Nef_polyhedron2 a) { CGAL_Poly2 ap = nef2p2(a); std::list<CGAL_Nef_polyhedron2::Point> points = p2points(ap), result; |