mirror of https://github.com/CGAL/cgal
Removed Has_construct_x_monotone_curve_from_two_points_category
This commit is contained in:
parent
28ac7a8d94
commit
2ebc9965fd
|
|
@ -14,8 +14,8 @@
|
|||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Iddo Hanniel <iddoh@cs.technion.ac.il>
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
#define CGAL_ARR_BEZIER_CURVE_TRAITS_2_H
|
||||
|
||||
/*! \file
|
||||
* Definition of the Arr_Bezier_curve_traits_2 class.
|
||||
* Definition of the Arr_Bezier_curve_traits_2 class.
|
||||
*/
|
||||
|
||||
#include <CGAL/tags.h>
|
||||
|
|
@ -40,7 +40,7 @@ namespace CGAL {
|
|||
* A traits class for maintaining an arrangement of Bezier curves with
|
||||
* rational control points.
|
||||
*
|
||||
* The class is templated with four parameters:
|
||||
* The class is templated with four parameters:
|
||||
* Rat_kernel A kernel that defines the type of control points.
|
||||
* Alg_kernel A geometric kernel, where Alg_kernel::FT is the number type
|
||||
* for the coordinates of arrangement vertices and is used to
|
||||
|
|
@ -54,7 +54,7 @@ namespace CGAL {
|
|||
*/
|
||||
template <class RatKernel_, class AlgKernel_, class NtTraits_,
|
||||
class BoundingTraits_ = Bezier_bounding_rational_traits<RatKernel_> >
|
||||
class Arr_Bezier_curve_traits_2
|
||||
class Arr_Bezier_curve_traits_2
|
||||
{
|
||||
public:
|
||||
|
||||
|
|
@ -66,19 +66,18 @@ public:
|
|||
Alg_kernel,
|
||||
Nt_traits,
|
||||
Bounding_traits> Self;
|
||||
|
||||
|
||||
typedef typename Nt_traits::Integer Integer;
|
||||
typedef typename Rat_kernel::FT Rational;
|
||||
typedef typename Alg_kernel::FT Algebraic;
|
||||
|
||||
typedef typename Rat_kernel::Point_2 Rat_point_2;
|
||||
typedef typename Alg_kernel::Point_2 Alg_point_2;
|
||||
|
||||
|
||||
// Category tags:
|
||||
typedef Tag_true Has_left_category;
|
||||
typedef Tag_true Has_merge_category;
|
||||
typedef Tag_false Has_do_intersect_category;
|
||||
typedef Tag_true Has_construct_x_monotone_curve_from_two_points_category;
|
||||
|
||||
typedef Arr_oblivious_side_tag Left_side_category;
|
||||
typedef Arr_oblivious_side_tag Bottom_side_category;
|
||||
|
|
@ -340,7 +339,7 @@ public:
|
|||
Comparison_result operator() (const Point_2& p,
|
||||
const X_monotone_curve_2& cv) const
|
||||
{
|
||||
return (cv.point_position (p,
|
||||
return (cv.point_position (p,
|
||||
const_cast<Bezier_cache&> (*p_cache)));
|
||||
}
|
||||
};
|
||||
|
|
@ -544,7 +543,7 @@ public:
|
|||
|
||||
if (bound.type == Bounding_traits::Bez_point_bound::RATIONAL_PT)
|
||||
{
|
||||
CGAL_assertion (CGAL::compare (bound.t_min, bound.t_max) == EQUAL);
|
||||
CGAL_assertion (CGAL::compare (bound.t_min, bound.t_max) == EQUAL);
|
||||
Rational t0 = bound.t_min;
|
||||
|
||||
pt = Point_2 (B, t0);
|
||||
|
|
@ -727,7 +726,7 @@ public:
|
|||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
|
|
@ -749,7 +748,7 @@ public:
|
|||
X_monotone_curve_2& c) const
|
||||
{
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1));
|
||||
|
||||
|
||||
c = cv1.merge (cv2);
|
||||
return;
|
||||
}
|
||||
|
|
@ -802,7 +801,7 @@ public:
|
|||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
|
|
@ -812,7 +811,7 @@ public:
|
|||
Nt_traits, Bounding_traits>;
|
||||
/*!\brief
|
||||
* Returns a trimmed version of an arc
|
||||
*
|
||||
*
|
||||
* \param xcv The arc
|
||||
* \param src the new first endpoint
|
||||
* \param tgt the new second endpoint
|
||||
|
|
@ -823,7 +822,7 @@ public:
|
|||
*/
|
||||
public:
|
||||
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv,
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv,
|
||||
const Point_2& src,
|
||||
const Point_2& tgt)const
|
||||
{
|
||||
|
|
@ -840,10 +839,10 @@ public:
|
|||
if( xcv.is_directed_right() && compare_x_2(src, tgt) == LARGER )
|
||||
return ( xcv.trim(tgt, src) );
|
||||
|
||||
else if( ! xcv.is_directed_right() && compare_x_2(src, tgt) == SMALLER )
|
||||
else if( ! xcv.is_directed_right() && compare_x_2(src, tgt) == SMALLER )
|
||||
return ( xcv.trim(tgt, src) );
|
||||
|
||||
else
|
||||
else
|
||||
return (xcv.trim(src, tgt));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
|
|
@ -40,7 +40,7 @@ namespace CGAL {
|
|||
* A traits class for maintaining an arrangement of circles.
|
||||
*/
|
||||
template <class Kernel_, bool Filter = true>
|
||||
class Arr_circle_segment_traits_2
|
||||
class Arr_circle_segment_traits_2
|
||||
{
|
||||
public:
|
||||
|
||||
|
|
@ -60,14 +60,12 @@ public:
|
|||
typedef Tag_true Has_left_category;
|
||||
typedef Tag_true Has_merge_category;
|
||||
typedef Tag_false Has_do_intersect_category;
|
||||
typedef Tag_false Has_construct_x_monotone_curve_from_two_points_category;
|
||||
//typedef boost::false_type Has_construct_x_monotone_curve_from_two_points_category;
|
||||
|
||||
typedef Arr_oblivious_side_tag Left_side_category;
|
||||
typedef Arr_oblivious_side_tag Bottom_side_category;
|
||||
typedef Arr_oblivious_side_tag Top_side_category;
|
||||
typedef Arr_oblivious_side_tag Right_side_category;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Type definition for the intersection points mapping.
|
||||
|
|
@ -85,7 +83,7 @@ public:
|
|||
{}
|
||||
|
||||
/*! Get the next curve index. */
|
||||
static unsigned int get_index ()
|
||||
static unsigned int get_index ()
|
||||
{
|
||||
static unsigned int index = 0;
|
||||
return (++index);
|
||||
|
|
@ -400,7 +398,7 @@ public:
|
|||
{}
|
||||
|
||||
/*!
|
||||
* Cut the given conic curve (ocv.is_in_x_range (p)r conic arc) into x-monotone subcurves
|
||||
* Cut the given conic curve (ocv.is_in_x_range (p)r conic arc) into x-monotone subcurves
|
||||
* and insert them to the given output iterator.
|
||||
* \param cv The curve.
|
||||
* \param oi The output iterator, whose value-type is Object. The returned
|
||||
|
|
@ -430,7 +428,7 @@ public:
|
|||
const typename Kernel::Circle_2& circ = cv.supporting_circle();
|
||||
CGAL::Sign sign_rad = CGAL::sign (circ.squared_radius());
|
||||
CGAL_precondition (sign_rad != NEGATIVE);
|
||||
|
||||
|
||||
if (sign_rad == ZERO)
|
||||
{
|
||||
// Create an isolated point.
|
||||
|
|
@ -438,7 +436,7 @@ public:
|
|||
++oi;
|
||||
return (oi);
|
||||
}
|
||||
|
||||
|
||||
// The curve is circular: compute the to vertical tangency points
|
||||
// of the supporting circle.
|
||||
Point_2 vpts[2];
|
||||
|
|
@ -454,7 +452,7 @@ public:
|
|||
cv.orientation(),
|
||||
index));
|
||||
++oi;
|
||||
|
||||
|
||||
*oi = make_object (X_monotone_curve_2 (circ,
|
||||
vpts[1], vpts[0],
|
||||
cv.orientation(),
|
||||
|
|
@ -472,7 +470,7 @@ public:
|
|||
cv.orientation(),
|
||||
index));
|
||||
++oi;
|
||||
|
||||
|
||||
*oi = make_object (X_monotone_curve_2 (circ,
|
||||
vpts[0], vpts[1],
|
||||
cv.orientation(),
|
||||
|
|
@ -493,7 +491,7 @@ public:
|
|||
cv.orientation(),
|
||||
index));
|
||||
++oi;
|
||||
|
||||
|
||||
*oi = make_object (X_monotone_curve_2 (circ,
|
||||
vpts[0], cv.target(),
|
||||
cv.orientation(),
|
||||
|
|
@ -512,7 +510,7 @@ public:
|
|||
++oi;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (oi);
|
||||
}
|
||||
};
|
||||
|
|
@ -623,7 +621,7 @@ public:
|
|||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
|
|
@ -697,7 +695,7 @@ public:
|
|||
Construct_opposite_2 construct_opposite_2_object() const
|
||||
{
|
||||
return Construct_opposite_2();
|
||||
}
|
||||
}
|
||||
|
||||
class Trim_2
|
||||
{
|
||||
|
|
@ -707,7 +705,7 @@ public:
|
|||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
|
|
@ -718,7 +716,7 @@ public:
|
|||
public:
|
||||
/*!\brief
|
||||
* Returns a trimmed version of an arc
|
||||
*
|
||||
*
|
||||
* \param xcv The arc
|
||||
* \param src the new first endpoint
|
||||
* \param tgt the new second endpoint
|
||||
|
|
@ -727,7 +725,7 @@ public:
|
|||
* \pre src != tgt
|
||||
* \pre both points must be interior and must lie on \c cv
|
||||
*/
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv,
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv,
|
||||
const Point_2& src,
|
||||
const Point_2& tgt)const
|
||||
{
|
||||
|
|
@ -745,7 +743,7 @@ public:
|
|||
(! xcv.is_directed_right() && compare_x_2(src, tgt) == SMALLER) )
|
||||
return ( xcv.trim(tgt, src) );
|
||||
|
||||
else
|
||||
else
|
||||
return (xcv.trim(src, tgt));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Waqar Khan <wkhan@mpi-inf.mpg.de>
|
||||
|
|
@ -40,17 +40,17 @@ namespace CGAL {
|
|||
* \class A traits class for maintaining an arrangement of conic arcs (bounded
|
||||
* segments of algebraic curves of degree 2 at most).
|
||||
*
|
||||
* The class is templated with two parameters:
|
||||
* The class is templated with two parameters:
|
||||
* Rat_kernel A kernel that provides the input objects or coefficients.
|
||||
* Rat_kernel::FT should be an integral or a rational type.
|
||||
* Alg_kernel A geometric kernel, where Alg_kernel::FT is the number type
|
||||
* for the coordinates of arrangement vertices, which are algebraic
|
||||
* numbers of degree up to 4 (preferably it is CORE::Expr).
|
||||
* Nt_traits A traits class for performing various operations on the integer,
|
||||
* rational and algebraic types.
|
||||
* rational and algebraic types.
|
||||
*/
|
||||
template <class Rat_kernel_, class Alg_kernel_, class Nt_traits_>
|
||||
class Arr_conic_traits_2
|
||||
class Arr_conic_traits_2
|
||||
{
|
||||
public:
|
||||
|
||||
|
|
@ -75,7 +75,6 @@ public:
|
|||
typedef Tag_true Has_merge_category;
|
||||
typedef Tag_false Has_do_intersect_category;
|
||||
//typedef boost::true_type Has_line_segment_constructor;
|
||||
typedef Tag_true Has_construct_x_monotone_curve_from_two_points_category;
|
||||
|
||||
typedef Arr_oblivious_side_tag Left_side_category;
|
||||
typedef Arr_oblivious_side_tag Bottom_side_category;
|
||||
|
|
@ -108,7 +107,7 @@ public:
|
|||
{}
|
||||
|
||||
/*! Get the next conic index. */
|
||||
static unsigned int get_index ()
|
||||
static unsigned int get_index ()
|
||||
{
|
||||
static unsigned int index = 0;
|
||||
return (++index);
|
||||
|
|
@ -261,7 +260,7 @@ public:
|
|||
return (EQUAL);
|
||||
|
||||
// Get a point q on the x-monotone arc with the same x coordinate as p.
|
||||
Comparison_result x_res;
|
||||
Comparison_result x_res;
|
||||
Point_2 q;
|
||||
|
||||
if ((x_res = ker.compare_x_2_object() (p, cv.left())) == EQUAL)
|
||||
|
|
@ -321,7 +320,7 @@ public:
|
|||
CGAL_precondition_code (
|
||||
Alg_kernel ker;
|
||||
);
|
||||
CGAL_precondition (ker.compare_xy_2_object() (p,
|
||||
CGAL_precondition (ker.compare_xy_2_object() (p,
|
||||
cv1.left()) == LARGER &&
|
||||
ker.compare_xy_2_object() (p,
|
||||
cv2.left()) == LARGER);
|
||||
|
|
@ -378,7 +377,7 @@ public:
|
|||
Alg_kernel ker;
|
||||
);
|
||||
|
||||
CGAL_precondition (ker.compare_xy_2_object() (p,
|
||||
CGAL_precondition (ker.compare_xy_2_object() (p,
|
||||
cv1.right()) == SMALLER &&
|
||||
ker.compare_xy_2_object() (p,
|
||||
cv2.right()) == SMALLER);
|
||||
|
|
@ -458,7 +457,7 @@ public:
|
|||
public:
|
||||
|
||||
/*!
|
||||
* Cut the given conic curve (or conic arc) into x-monotone subcurves
|
||||
* Cut the given conic curve (or conic arc) into x-monotone subcurves
|
||||
* and insert them to the given output iterator.
|
||||
* \param cv The curve.
|
||||
* \param oi The output iterator, whose value-type is Object. The returned
|
||||
|
|
@ -472,7 +471,7 @@ public:
|
|||
// unique identifier.
|
||||
unsigned int index = Self::get_index();
|
||||
Conic_id conic_id (index);
|
||||
|
||||
|
||||
// Find the points of vertical tangency to cv and act accordingly.
|
||||
typename Curve_2::Point_2 vtan_ps[2];
|
||||
int n_vtan_ps;
|
||||
|
|
@ -480,14 +479,14 @@ public:
|
|||
n_vtan_ps = cv.vertical_tangency_points (vtan_ps);
|
||||
|
||||
if (n_vtan_ps == 0)
|
||||
{
|
||||
{
|
||||
// In case the given curve is already x-monotone:
|
||||
*oi = make_object (X_monotone_curve_2 (cv, conic_id));
|
||||
++oi;
|
||||
return (oi);
|
||||
}
|
||||
|
||||
// Split the conic arc into x-monotone sub-curves.
|
||||
// Split the conic arc into x-monotone sub-curves.
|
||||
if (cv.is_full_conic())
|
||||
{
|
||||
// Make sure we have two vertical tangency points.
|
||||
|
|
@ -496,10 +495,10 @@ public:
|
|||
// In case the curve is a full conic, split it into two x-monotone
|
||||
// arcs, one going from ps[0] to ps[1], and the other from ps[1] to
|
||||
// ps[0].
|
||||
*oi = make_object (X_monotone_curve_2 (cv, vtan_ps[0], vtan_ps[1],
|
||||
*oi = make_object (X_monotone_curve_2 (cv, vtan_ps[0], vtan_ps[1],
|
||||
conic_id));
|
||||
++oi;
|
||||
*oi = make_object (X_monotone_curve_2 (cv, vtan_ps[1], vtan_ps[0],
|
||||
*oi = make_object (X_monotone_curve_2 (cv, vtan_ps[1], vtan_ps[0],
|
||||
conic_id));
|
||||
++oi;
|
||||
}
|
||||
|
|
@ -509,10 +508,10 @@ public:
|
|||
{
|
||||
// Split the arc into two x-monotone sub-curves: one going from the
|
||||
// arc source to ps[0], and the other from ps[0] to the target.
|
||||
*oi = make_object (X_monotone_curve_2 (cv, cv.source(), vtan_ps[0],
|
||||
*oi = make_object (X_monotone_curve_2 (cv, cv.source(), vtan_ps[0],
|
||||
conic_id));
|
||||
++oi;
|
||||
*oi = make_object (X_monotone_curve_2 (cv, vtan_ps[0], cv.target(),
|
||||
*oi = make_object (X_monotone_curve_2 (cv, vtan_ps[0], cv.target(),
|
||||
conic_id));
|
||||
++oi;
|
||||
}
|
||||
|
|
@ -550,17 +549,17 @@ public:
|
|||
|
||||
// Split the arc into three x-monotone sub-curves.
|
||||
*oi = make_object (X_monotone_curve_2 (cv,
|
||||
cv.source(),
|
||||
vtan_ps[ind_first],
|
||||
cv.source(),
|
||||
vtan_ps[ind_first],
|
||||
conic_id));
|
||||
++oi;
|
||||
|
||||
|
||||
*oi = make_object (X_monotone_curve_2 (cv,
|
||||
vtan_ps[ind_first],
|
||||
vtan_ps[ind_second],
|
||||
vtan_ps[ind_first],
|
||||
vtan_ps[ind_second],
|
||||
conic_id));
|
||||
++oi;
|
||||
|
||||
|
||||
*oi = make_object (X_monotone_curve_2 (cv,
|
||||
vtan_ps[ind_second],
|
||||
cv.target(),
|
||||
|
|
@ -674,7 +673,7 @@ public:
|
|||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
|
|
@ -722,7 +721,7 @@ public:
|
|||
* \param p The exact point.
|
||||
* \param i The coordinate index (either 0 or 1).
|
||||
* \pre i is either 0 or 1.
|
||||
* \return An approximation of p's x-coordinate (if i == 0), or an
|
||||
* \return An approximation of p's x-coordinate (if i == 0), or an
|
||||
* approximation of p's y-coordinate (if i == 1).
|
||||
*/
|
||||
Approximate_number_type operator() (const Point_2& p,
|
||||
|
|
@ -770,7 +769,7 @@ public:
|
|||
|
||||
/// \name Functor definitions for the Boolean set-operation traits.
|
||||
//@{
|
||||
|
||||
|
||||
class Compare_endpoints_xy_2
|
||||
{
|
||||
public:
|
||||
|
|
@ -825,18 +824,18 @@ public:
|
|||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Trim_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
friend class Arr_conic_traits_2<Rat_kernel, Alg_kernel, Nt_traits>;
|
||||
/*!\brief
|
||||
* Returns a trimmed version of an arc
|
||||
*
|
||||
*
|
||||
* \param xcv The arc
|
||||
* \param src the new first endpoint
|
||||
* \param tgt the new second endpoint
|
||||
|
|
@ -845,7 +844,7 @@ public:
|
|||
* \pre src != tgt
|
||||
* \pre both points must be interior and must lie on \c cv
|
||||
*/
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv,
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv,
|
||||
const Point_2& src,
|
||||
const Point_2& tgt)const
|
||||
{
|
||||
|
|
@ -863,7 +862,7 @@ public:
|
|||
(! xcv.is_directed_right() && compare_x_2(src, tgt) == SMALLER) )
|
||||
return ( xcv.trim(tgt, src) );
|
||||
|
||||
else
|
||||
else
|
||||
return (xcv.trim(src, tgt));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
|
||||
|
|
@ -50,20 +50,19 @@ public:
|
|||
typedef Kernel_ Kernel;
|
||||
typedef typename Kernel::FT FT;
|
||||
|
||||
typedef typename Algebraic_structure_traits<FT>::Is_exact
|
||||
typedef typename Algebraic_structure_traits<FT>::Is_exact
|
||||
Has_exact_division;
|
||||
|
||||
// Category tags:
|
||||
typedef Tag_true Has_left_category;
|
||||
typedef Tag_true Has_merge_category;
|
||||
typedef Tag_false Has_do_intersect_category;
|
||||
typedef Tag_true Has_construct_x_monotone_curve_from_two_points_category;
|
||||
|
||||
typedef Arr_open_side_tag Left_side_category;
|
||||
typedef Arr_open_side_tag Bottom_side_category;
|
||||
typedef Arr_open_side_tag Top_side_category;
|
||||
typedef Arr_open_side_tag Right_side_category;
|
||||
|
||||
|
||||
typedef typename Kernel::Line_2 Line_2;
|
||||
typedef typename Kernel::Ray_2 Ray_2;
|
||||
typedef typename Kernel::Segment_2 Segment_2;
|
||||
|
|
@ -164,7 +163,7 @@ public:
|
|||
has_target = true;
|
||||
|
||||
Comparison_result res = kernel.compare_xy_2_object()(ps, pt);
|
||||
|
||||
|
||||
CGAL_assertion (res != EQUAL);
|
||||
is_degen = false;
|
||||
is_right = (res == SMALLER);
|
||||
|
|
@ -284,7 +283,7 @@ public:
|
|||
{
|
||||
if (is_right)
|
||||
return (has_source);
|
||||
else
|
||||
else
|
||||
return (has_target);
|
||||
}
|
||||
|
||||
|
|
@ -320,8 +319,8 @@ public:
|
|||
CGAL_precondition_code (
|
||||
Kernel kernel;
|
||||
);
|
||||
CGAL_precondition
|
||||
(Segment_assertions::_assert_is_point_on (p, l,
|
||||
CGAL_precondition
|
||||
(Segment_assertions::_assert_is_point_on (p, l,
|
||||
Has_exact_division()) &&
|
||||
(! check_validity || ! has_right() ||
|
||||
kernel.compare_xy_2_object() (p, right()) == SMALLER));
|
||||
|
|
@ -396,7 +395,7 @@ public:
|
|||
{
|
||||
if (is_right)
|
||||
return (has_target);
|
||||
else
|
||||
else
|
||||
return (has_source);
|
||||
}
|
||||
|
||||
|
|
@ -421,8 +420,8 @@ public:
|
|||
CGAL_precondition_code (
|
||||
Kernel kernel;
|
||||
);
|
||||
CGAL_precondition
|
||||
(Segment_assertions::_assert_is_point_on (p, l,
|
||||
CGAL_precondition
|
||||
(Segment_assertions::_assert_is_point_on (p, l,
|
||||
Has_exact_division()) &&
|
||||
(! check_validity || ! has_left() ||
|
||||
kernel.compare_xy_2_object() (p, left()) == LARGER));
|
||||
|
|
@ -529,7 +528,7 @@ public:
|
|||
else
|
||||
{
|
||||
// p is obviously to the right.
|
||||
res2 = SMALLER;
|
||||
res2 = SMALLER;
|
||||
}
|
||||
|
||||
return (res2 != LARGER);
|
||||
|
|
@ -632,7 +631,7 @@ public:
|
|||
|
||||
//! Allow its functor obtaining function calling the private constructor.
|
||||
friend class Arr_linear_traits_2<Kernel>;
|
||||
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Compare the x-coordinates of two points.
|
||||
|
|
@ -660,7 +659,7 @@ public:
|
|||
//waqar add functor start()
|
||||
class Compare_endpoints_xy_2{
|
||||
public:
|
||||
|
||||
|
||||
Comparison_result operator() (const X_monotone_curve_2& xcv) const
|
||||
{
|
||||
return (xcv.is_directed_right()) ? (SMALLER) : (LARGER);
|
||||
|
|
@ -689,19 +688,19 @@ public:
|
|||
|
||||
//! Allow its functor obtaining function calling the private constructor.
|
||||
friend class Arr_linear_traits_2<Kernel>;
|
||||
|
||||
|
||||
public:
|
||||
X_monotone_curve_2 operator()( const X_monotone_curve_2 xcv,
|
||||
const Point_2 src,
|
||||
X_monotone_curve_2 operator()( const X_monotone_curve_2 xcv,
|
||||
const Point_2 src,
|
||||
const Point_2 tgt )
|
||||
{
|
||||
/*
|
||||
* "Line_segment, line, and ray" will become line segments
|
||||
* when trimmed.
|
||||
* when trimmed.
|
||||
*/
|
||||
Equal_2 equal = Equal_2();
|
||||
Compare_y_at_x_2 compare_y_at_x = m_traits->compare_y_at_x_2_object();
|
||||
|
||||
|
||||
//preconditions
|
||||
//check if source and taget are two distinct points and they lie on the line.
|
||||
CGAL_precondition(!equal(src, tgt));
|
||||
|
|
@ -713,14 +712,14 @@ public:
|
|||
|
||||
if( xcv.is_directed_right() && tgt.x() < src.x() )
|
||||
trimmed_segment = Segment_2(tgt, src);
|
||||
|
||||
|
||||
|
||||
else if( !xcv.is_directed_right() && tgt.x() > src.x())
|
||||
trimmed_segment = Segment_2(tgt, src);
|
||||
|
||||
else
|
||||
trimmed_segment = Segment_2(src, tgt);
|
||||
|
||||
|
||||
return trimmed_segment;
|
||||
}
|
||||
|
||||
|
|
@ -749,7 +748,7 @@ public:
|
|||
|
||||
//! Allow its functor obtaining function calling the private constructor.
|
||||
friend class Arr_linear_traits_2<Kernel>;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv)const
|
||||
|
|
@ -762,12 +761,12 @@ public:
|
|||
{
|
||||
opp_xcv = Segment_2(xcv.target(), xcv.source());
|
||||
}
|
||||
|
||||
|
||||
if( xcv.is_line() )
|
||||
{
|
||||
opp_xcv = Line_2(xcv.get_pt(), xcv.get_ps());
|
||||
opp_xcv = Line_2(xcv.get_pt(), xcv.get_ps());
|
||||
}
|
||||
|
||||
|
||||
if( xcv.is_ray() )
|
||||
{
|
||||
Point_2 opp_tgt = Point_2( -(xcv.get_pt().x()), -(xcv.get_pt().y()));
|
||||
|
|
@ -907,7 +906,7 @@ public:
|
|||
|
||||
//! Allow its functor obtaining function calling the private constructor.
|
||||
friend class Arr_linear_traits_2<Kernel>;
|
||||
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Return the location of the given point with respect to the input curve.
|
||||
|
|
@ -933,7 +932,7 @@ public:
|
|||
typename Kernel::Compare_y_2 compare_y = kernel->compare_y_2_object();
|
||||
const Comparison_result res1 =
|
||||
cv.has_left() ? compare_y (p, cv.left()) : LARGER;
|
||||
const Comparison_result res2 =
|
||||
const Comparison_result res2 =
|
||||
cv.has_right() ? compare_y (p, cv.right()) : SMALLER;
|
||||
|
||||
return (res1 == res2) ? res1 : EQUAL;
|
||||
|
|
@ -978,8 +977,8 @@ public:
|
|||
typename Kernel::Compare_xy_2 compare_xy = kernel.compare_xy_2_object();
|
||||
);
|
||||
|
||||
CGAL_precondition
|
||||
(Segment_assertions::_assert_is_point_on (p, cv1,
|
||||
CGAL_precondition
|
||||
(Segment_assertions::_assert_is_point_on (p, cv1,
|
||||
Has_exact_division()) &&
|
||||
Segment_assertions::_assert_is_point_on (p, cv2,
|
||||
Has_exact_division()));
|
||||
|
|
@ -1037,7 +1036,7 @@ public:
|
|||
);
|
||||
|
||||
CGAL_precondition
|
||||
(Segment_assertions::_assert_is_point_on (p, cv1,
|
||||
(Segment_assertions::_assert_is_point_on (p, cv1,
|
||||
Has_exact_division()) &&
|
||||
Segment_assertions::_assert_is_point_on (p, cv2,
|
||||
Has_exact_division()));
|
||||
|
|
@ -1085,7 +1084,7 @@ public:
|
|||
|
||||
// Check that the two supporting lines are the same.
|
||||
if (! equal (cv1.supp_line(), cv2.supp_line()) &&
|
||||
! equal (cv1.supp_line(),
|
||||
! equal (cv1.supp_line(),
|
||||
kernel.construct_opposite_line_2_object()(cv2.supp_line())))
|
||||
{
|
||||
return (false);
|
||||
|
|
@ -1166,7 +1165,7 @@ public:
|
|||
/*! Obtain a Parameter_space_in_x_2 function object */
|
||||
Parameter_space_in_x_2 parameter_space_in_x_2_object() const
|
||||
{ return Parameter_space_in_x_2(); }
|
||||
|
||||
|
||||
/*! A function object that obtains the parameter space of a geometric
|
||||
* entity along the y-axis
|
||||
*/
|
||||
|
|
@ -1244,7 +1243,7 @@ public:
|
|||
* \return the comparison result:
|
||||
* SMALLER - x(p) < x(xc, ce);
|
||||
* EQUAL - x(p) = x(xc, ce);
|
||||
* LARGER - x(p) > x(xc, ce).
|
||||
* LARGER - x(p) > x(xc, ce).
|
||||
* \pre p lies in the interior of the parameter space.
|
||||
* \pre the ce end of the line xcv lies on a boundary, implying
|
||||
* that xcv1 is vertical.
|
||||
|
|
@ -1343,7 +1342,7 @@ public:
|
|||
/*! Obtain a Compare_x_near_limit_2 function object */
|
||||
Compare_x_near_limit_2 compare_x_near_limit_2_object() const
|
||||
{ return Compare_x_near_limit_2(); }
|
||||
|
||||
|
||||
|
||||
/*! A function object that compares the y-limits of arc ends on the
|
||||
* boundary of the parameter space.
|
||||
|
|
@ -1365,7 +1364,7 @@ public:
|
|||
|
||||
//! Allow its functor obtaining function calling the private constructor.
|
||||
friend class Arr_linear_traits_2<Kernel>;
|
||||
|
||||
|
||||
public:
|
||||
/*! Compare the y-limits of 2 lines at their ends on the boundary
|
||||
* of the parameter space at x = +/- oo.
|
||||
|
|
@ -1413,9 +1412,9 @@ public:
|
|||
/*! Obtain a Compare_y_limit_on_boundary_2 function object */
|
||||
Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const
|
||||
{ return Compare_y_near_boundary_2(this); }
|
||||
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/// \name Functor definitions for supporting intersections.
|
||||
//@{
|
||||
|
||||
|
|
@ -1527,7 +1526,7 @@ public:
|
|||
|
||||
// Check whether we have a single intersection point.
|
||||
const Point_2 *ip = object_cast<Point_2> (&obj);
|
||||
|
||||
|
||||
if (ip != NULL)
|
||||
{
|
||||
// Check whether the intersection point ip lies on both segments.
|
||||
|
|
@ -1639,8 +1638,8 @@ public:
|
|||
typename Kernel::Equal_2 equal = kernel.equal_2_object();
|
||||
|
||||
// Check whether the two curves have the same supporting line.
|
||||
if (! equal (cv1.supp_line(), cv2.supp_line()) &&
|
||||
! equal (cv1.supp_line(),
|
||||
if (! equal (cv1.supp_line(), cv2.supp_line()) &&
|
||||
! equal (cv1.supp_line(),
|
||||
kernel.construct_opposite_line_2_object()(cv2.supp_line())))
|
||||
return (false);
|
||||
|
||||
|
|
@ -1669,7 +1668,7 @@ public:
|
|||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
|
|
@ -1706,7 +1705,7 @@ public:
|
|||
if (cv2.has_right())
|
||||
c.set_right(cv2.right());
|
||||
else
|
||||
c.set_right(); // Unbounded endpoint.
|
||||
c.set_right(); // Unbounded endpoint.
|
||||
}
|
||||
else {
|
||||
CGAL_precondition(cv2.has_right() && cv1.has_left() &&
|
||||
|
|
@ -1740,7 +1739,7 @@ public:
|
|||
* \param p The exact point.
|
||||
* \param i The coordinate index (either 0 or 1).
|
||||
* \pre i is either 0 or 1.
|
||||
* \return An approximation of p's x-coordinate (if i == 0), or an
|
||||
* \return An approximation of p's x-coordinate (if i == 0), or an
|
||||
* approximation of p's y-coordinate (if i == 1).
|
||||
*/
|
||||
Approximate_number_type operator() (const Point_2& p,
|
||||
|
|
@ -1799,7 +1798,7 @@ template <class Kernel_>
|
|||
class Arr_linear_object_2 :
|
||||
public Arr_linear_traits_2<Kernel_>::_Linear_object_cached_2
|
||||
{
|
||||
typedef typename Arr_linear_traits_2<Kernel_>::_Linear_object_cached_2
|
||||
typedef typename Arr_linear_traits_2<Kernel_>::_Linear_object_cached_2
|
||||
Base;
|
||||
|
||||
public:
|
||||
|
|
@ -1819,7 +1818,7 @@ public:
|
|||
Arr_linear_object_2 () :
|
||||
Base()
|
||||
{}
|
||||
|
||||
|
||||
/*!
|
||||
* Constructor from two points.
|
||||
* \param s The source point.
|
||||
|
|
|
|||
Loading…
Reference in New Issue