diff --git a/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_traits_3.h b/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_traits_3.h index fc7c70bfe46..c4c59b2141d 100644 --- a/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_traits_3.h +++ b/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_traits_3.h @@ -41,11 +41,6 @@ typedef unspecified_type Plane_3; /*! -*/ -typedef R::Vector_3 Vector_3; - -/*! - */ typedef Polyhedron_3 Polyhedron_3; @@ -72,16 +67,7 @@ typedef R::Construct_triangle_3 Construct_triangle_3; /*! */ -typedef R::Construct_centroid_3 Construct_centroid_3; - -/*! - -*/ -typedef R::Construct_vector_3 Construct_vector_3; -/*! - -*/ -typedef R::Orientation_3 Orientation_3; +typedef R::Construct_centroid_3 Construct_centroid_3; /*! diff --git a/Convex_hull_3/doc/Convex_hull_3/Concepts/ConvexHullTraits_3.h b/Convex_hull_3/doc/Convex_hull_3/Concepts/ConvexHullTraits_3.h index 4dc9f0a9d84..9b857d2165c 100644 --- a/Convex_hull_3/doc/Convex_hull_3/Concepts/ConvexHullTraits_3.h +++ b/Convex_hull_3/doc/Convex_hull_3/Concepts/ConvexHullTraits_3.h @@ -34,11 +34,6 @@ a 3D triangle */ typedef unspecified_type Triangle_3; -/*! -a 3D vector -*/ -typedef unspecified_type Vector_3; - /*! Function object type that provides `Plane_3 operator()(Point_3 p, Point_3 q, Point_3 r)`, which constructs @@ -114,7 +109,7 @@ the 2D convex hull function `CGAL::ch_bykat()` such that `Traits::Point_2` is `Point_3`, and the 2D points considered in the algorithm are the projections of the 3D points in the `xy`-plane. If this type is not available, the function `CGAL::convex_hull_3()` will -automatically use `CGAL::Projection_traits_xy< CGAL::Kernel_traits::Kernel >.` +automatically use `CGAL::Projection_traits_xy< CGAL::Kernel_traits::%Kernel >.` */ typedef unspecified_type Traits_xy_3; @@ -128,24 +123,6 @@ Same as above but in the `xz`-plane */ typedef unspecified_type Traits_xz_3; -/*! -Function object type that provides -`Vector_3 operator()(Point_3 p1, Point_3 p2)`, which -constructs and returns the vector `p1p2`, and -`Vector_3 operator()(int x,int y,int z)` which constructs and returns -a vector with integer Cartesian coordinates. -*/ -typedef unspecified_type Construct_vector_3; - -/*! -Predicate object type that -provides `CGAL::Orientation operator()(Vector_3 u, Vector_3 v, Vector_3 w)` -which returns `CGAL::NEGATIVE` if u, v and w are negatively oriented, -`CGAL::POSITIVE` if u, v and w are positively oriented and -`CGAL::COPLANAR` if u, v and w are coplanar. -*/ -typedef unspecified_type Orientation_3; - /// @} /// \name Creation diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 4056ed21ce3..4f6c7b7cb0e 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -312,12 +312,8 @@ struct Projection_traits{ template void coplanar_3_hull(InputIterator first, InputIterator beyond, const Point_3& p1, const Point_3& p2, const Point_3& p3, - Polyhedron_3& P, const Traits& traits) + Polyhedron_3& P, const Traits& /* traits */) { - typedef typename Traits::Vector_3 Vector_3; - typedef typename Traits::Construct_vector_3 Construct_vector_3; - typedef typename Traits::Orientation_3 Orientation_3; - typedef typename internal::Convex_hull_3::Projection_traits PTraits; typedef typename PTraits::Traits_xy_3 Traits_xy_3; typedef typename PTraits::Traits_yz_3 Traits_yz_3; @@ -326,31 +322,26 @@ void coplanar_3_hull(InputIterator first, InputIterator beyond, std::list CH_2; typedef typename std::list::iterator CH_2_iterator; - Construct_vector_3 vector_3 = traits.construct_vector_3_object(); - Orientation_3 orientation = traits.orientation_3_object(); - Vector_3 v1 = vector_3(p1,p2); - Vector_3 v2 = vector_3(p1,p3); - - Vector_3 vx = vector_3(1,0,0); - - - - if ( orientation(v1, v2, vx) != COPLANAR ) + Traits_xy_3 traits_xy; + typename Traits_xy_3::Left_turn_2 left_turn_in_xy = traits_xy.left_turn_2_object(); + if ( left_turn_in_xy(p1,p2,p3) || left_turn_in_xy(p2,p1,p3) ) convex_hull_points_2( first, beyond, std::back_inserter(CH_2), - Traits_yz_3() ); + traits_xy ); else{ - Vector_3 vy = vector_3(0,1,0); - if ( orientation(v1,v2,vy) != COPLANAR ) + Traits_yz_3 traits_yz; + typename Traits_yz_3::Left_turn_2 left_turn_in_yz = traits_yz.left_turn_2_object(); + if ( left_turn_in_yz(p1,p2,p3) || left_turn_in_yz(p2,p1,p3) ) convex_hull_points_2( first, beyond, std::back_inserter(CH_2), - Traits_xz_3() ); + traits_yz ); else{ - CGAL_assertion_code( Vector_3 vz = vector_3(0,0,1); ) - CGAL_assertion( orientation(v1,v2,vz) != COPLANAR ); - convex_hull_points_2( first, beyond, - std::back_inserter(CH_2), - Traits_xy_3() ); + Traits_xz_3 traits_xz; + CGAL_assertion_code( typename Traits_xz_3::Left_turn_2 left_turn_in_xz = traits_xz.left_turn_2_object(); ) + CGAL_assertion( left_turn_in_xz(p1,p2,p3) || left_turn_in_xz(p2,p1,p3) ); + convex_hull_points_2( first, beyond, + std::back_inserter(CH_2), + traits_xz ); } }