mirror of https://github.com/CGAL/cgal
Merge branch 'Convex_hull_3-fix_2dhull_4.5-local' into releases/CGAL-4.5-branch
Tested in master in 4.6-Ic-99 Approved by the release manager
This commit is contained in:
commit
6b9945c271
|
|
@ -41,11 +41,6 @@ typedef unspecified_type Plane_3;
|
|||
|
||||
/*!
|
||||
|
||||
*/
|
||||
typedef R::Vector_3 Vector_3;
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
typedef Polyhedron_3<R> 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;
|
||||
|
||||
/*!
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Point_3>::Kernel >.`
|
||||
automatically use `CGAL::Projection_traits_xy< CGAL::Kernel_traits<Point_3>::%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
|
||||
|
|
|
|||
|
|
@ -312,12 +312,8 @@ struct Projection_traits<T,true>{
|
|||
template <class InputIterator, class Point_3, class Polyhedron_3, class Traits>
|
||||
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<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<Point_3> CH_2;
|
||||
typedef typename std::list<Point_3>::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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue