typename K::Obj rather than Obj<K> since we don't control the traits in theory

This commit is contained in:
Mael Rouxel-Labbé 2023-02-16 15:05:10 +01:00
parent 15c674d5c9
commit 4dfd622a64
5 changed files with 35 additions and 35 deletions

View File

@ -2,7 +2,7 @@
#include <CGAL/Polygon_with_holes_2.h>
template<class K>
void print_point ( CGAL::Point_2<K> const& p )
void print_point ( typename K::Point_2 const& p )
{
std::cout << "(" << p.x() << "," << p.y() << ")" ;
}

View File

@ -32,18 +32,19 @@ namespace CGAL_SS_i {
// POSTCONDITION: In case of overflow an empty optional is returned.
//
template<class K, class CoeffCache>
boost::optional< Point_2<K> > construct_offset_pointC2 ( typename K::FT const& t,
Segment_2_with_ID<K> const& e0,
typename K::FT const& weight0,
Segment_2_with_ID<K> const& e1,
typename K::FT const& weight1,
boost::intrusive_ptr< Trisegment_2<K, Segment_2_with_ID<K> > > const& tri,
CoeffCache& aCoeff_cache)
boost::optional< typename K::Point_2 >
construct_offset_pointC2 ( typename K::FT const& t,
Segment_2_with_ID<K> const& e0,
typename K::FT const& weight0,
Segment_2_with_ID<K> const& e1,
typename K::FT const& weight1,
boost::intrusive_ptr< Trisegment_2<K, Segment_2_with_ID<K> > > const& tri,
CoeffCache& aCoeff_cache)
{
typedef typename K::FT FT ;
typedef Point_2<K> Point_2 ;
typedef Line_2<K> Line_2 ;
typedef typename K::Point_2 Point_2 ;
typedef typename K::Line_2 Line_2 ;
typedef boost::optional<Point_2> Optional_point_2 ;
typedef boost::optional<Line_2> Optional_line_2 ;

View File

@ -366,8 +366,9 @@ compute_normal_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2<K,
// POSTCONDITION: In case of overflow an empty optional is returned.
//
template<class K>
boost::optional< Point_2<K> > compute_oriented_midpoint ( Segment_2_with_ID<K> const& e0,
Segment_2_with_ID<K> const& e1 )
boost::optional< typename K::Point_2 >
compute_oriented_midpoint ( Segment_2_with_ID<K> const& e0,
Segment_2_with_ID<K> const& e1 )
{
bool ok = false ;
@ -426,12 +427,12 @@ boost::optional< Point_2<K> > compute_oriented_midpoint ( Segment_2_with_ID<K> c
// If you request the point of such degenerate pseudo seed the oriented midpoint between e0 and e2 is returned.
//
template <class K, class CoeffCache>
boost::optional< Point_2<K> >
boost::optional< typename K::Point_2 >
compute_seed_pointC2 ( boost::intrusive_ptr< Trisegment_2<K, Segment_2_with_ID<K> > > const& tri,
typename Trisegment_2<K, Segment_2_with_ID<K> >::SEED_ID sid,
CoeffCache& aCoeff_cache)
{
boost::optional< Point_2<K> > p ;
boost::optional< typename K::Point_2 > p ;
typedef Trisegment_2<K, Segment_2_with_ID<K> > Trisegment_2 ;
@ -465,7 +466,7 @@ compute_seed_pointC2 ( boost::intrusive_ptr< Trisegment_2<K, Segment_2_with_ID<K
// of the degenerate seed.
// A normal collinearity occurs when e0,e1 or e1,e2 are collinear.
template <class K, class CoeffCache>
boost::optional< Point_2<K> >
boost::optional< typename K::Point_2 >
compute_degenerate_seed_pointC2 ( boost::intrusive_ptr< Trisegment_2<K, Segment_2_with_ID<K> > > const& tri,
CoeffCache& aCoeff_cache )
{
@ -489,8 +490,8 @@ compute_degenerate_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2
{
typedef typename K::FT FT ;
typedef Point_2<K> Point_2 ;
typedef Line_2 <K> Line_2 ;
typedef typename K::Point_2 Point_2 ;
typedef typename K::Line_2 Line_2 ;
typedef boost::optional<Point_2> Optional_point_2 ;
typedef boost::optional<Line_2> Optional_line_2 ;
@ -667,17 +668,17 @@ compute_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2<K, Segment
// POSTCONDITION: In case of overflow an empty optional is returned.
//
template<class K, class CoeffCache>
boost::optional< Point_2<K> >
boost::optional< typename K::Point_2 >
construct_normal_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2<K, Segment_2_with_ID<K> > > const& tri,
CoeffCache& aCoeff_cache)
{
typedef typename K::FT FT ;
typedef Line_2<K> Line_2 ;
typedef typename K::Line_2 Line_2 ;
typedef boost::optional<Line_2> Optional_line_2 ;
CGAL_STSKEL_TRAITS_TRACE("Computing normal offset lines isec point for: " << tri ) ;
CGAL_STSKEL_TRAITS_TRACE("Computing normal offset lines isec point for:" << tri ) ;
FT x(0), y(0) ;
@ -728,14 +729,14 @@ construct_normal_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2<K, Seg
//
// See detailed computations in compute_degenerate_offset_lines_isec_timeC2()
template <class K, class CoeffCache>
boost::optional< Point_2<K> >
boost::optional< typename K::Point_2 >
construct_degenerate_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2<K, Segment_2_with_ID<K> > > const& tri,
CoeffCache& aCoeff_cache)
{
typedef typename K::FT FT ;
typedef Point_2<K> Point_2 ;
typedef Line_2<K> Line_2 ;
typedef typename K::Point_2 Point_2 ;
typedef typename K::Line_2 Line_2 ;
typedef boost::optional<Point_2> Optional_point_2 ;
typedef boost::optional<Line_2> Optional_line_2 ;
@ -841,7 +842,7 @@ construct_degenerate_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2<K,
// Calls the appropriate function depending on the collinearity of the edges.
//
template <class K, class CoeffCache>
boost::optional< Point_2<K> >
boost::optional< typename K::Point_2 >
construct_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2<K, Segment_2_with_ID<K> > > const& tri,
CoeffCache& aCoeff_cache)
{

View File

@ -37,10 +37,9 @@ namespace CGAL_SS_i {
// the three points are along the same line, in any order.
template<class K>
inline
Uncertain<bool> certified_collinearC2( Point_2<K> const& p
, Point_2<K> const& q
, Point_2<K> const& r
)
Uncertain<bool> certified_collinearC2( typename K::Point_2 const& p,
typename K::Point_2 const& q,
typename K::Point_2 const& r )
{
return CGAL_NTS certified_is_equal( ( q.x() - p.x() ) * ( r.y() - p.y() )
, ( r.x() - p.x() ) * ( q.y() - p.y() )
@ -52,10 +51,9 @@ Uncertain<bool> certified_collinearC2( Point_2<K> const& p
// q is in the closed segment [p,r].
template<class K>
inline
Uncertain<bool> certified_collinear_are_ordered_along_lineC2( Point_2<K> const& p
, Point_2<K> const& q
, Point_2<K> const& r
)
Uncertain<bool> certified_collinear_are_ordered_along_lineC2( typename K::Point_2 const& p,
typename K::Point_2 const& q,
typename K::Point_2 const& r )
{
if ( CGAL_NTS certainly(p.x() < q.x()) ) return !(r.x() < q.x());
if ( CGAL_NTS certainly(q.x() < p.x()) ) return !(q.x() < r.x());
@ -305,7 +303,7 @@ Uncertain<Comparison_result> compare_isec_anglesC2 ( Vector_2<K> const& aBV1
// Returns true if the point aP is on the positive side of the line supporting the edge
//
template<class K>
Uncertain<bool> is_edge_facing_pointC2 ( boost::optional< Point_2<K> > const& aP,
Uncertain<bool> is_edge_facing_pointC2 ( boost::optional< typename K::Point_2 > const& aP,
Segment_2_with_ID<K> const& aEdge )
{
typedef typename K::FT FT ;
@ -528,7 +526,7 @@ Uncertain<bool> are_events_simultaneousC2 ( boost::intrusive_ptr< Trisegment_2<K
{
typedef typename K::FT FT ;
typedef Point_2<K> Point_2 ;
typedef typename K::Point_2 Point_2 ;
typedef Rational<FT> Rational ;
typedef Quotient<FT> Quotient ;

View File

@ -4,7 +4,7 @@
#include <CGAL/Straight_skeleton_2.h>
template<class K>
void print_point ( CGAL::Point_2<K> const& p )
void print_point ( typename K::Point_2 const& p )
{
std::cout << p.x() << " " << p.y();
}