mirror of https://github.com/CGAL/cgal
Refactoring of CK_2 Filtered_bbox_circular_kernel_2:
- The three classes Circular_arc_2, Circular_arc_point_2 and Line_arc_2
now have a proper base class with bboxes,
- The functors of Fb_ck_2 now directly use the functors of Ck_2 (without
bbox filtering) templated by Fb_ck_2: that avoids all creations of
temporary objects to convert between types CGAL::Foobar_2<CK_2> and
CGAL::Foobar_2<Fb_ck_2>.
- The number of functors in bbox_filtered_predicates has been reduced
quite a lot: all functors that were not using bboxes have been
removed. They were just forwarding all there calls to the functors
without filtering. That was useless (and created a lot of temporary
objects).
As a side effect, Fb_ck_2 now works even with -DCGAL_CFG_MATCHING_BUG_6
(VC++), because of the removal of the temporary objects.
This commit is contained in:
parent
72ed56006a
commit
418d2a5f01
|
|
@ -226,204 +226,6 @@ public:
|
|||
return is;
|
||||
}
|
||||
|
||||
template < class CK >
|
||||
struct Filtered_bbox_circular_kernel_2;
|
||||
|
||||
template < typename CK >
|
||||
class Circular_arc_2 < Filtered_bbox_circular_kernel_2 < CK > > {
|
||||
|
||||
typedef Filtered_bbox_circular_kernel_2 < CK > BK;
|
||||
typedef Circular_arc_2< BK > Self;
|
||||
typedef typename BK::FT FT;
|
||||
typedef typename BK::RT RT;
|
||||
typedef typename BK::Point_2 Point_2;
|
||||
typedef typename BK::Line_2 Line_2;
|
||||
typedef typename BK::Circle_2 Circle_2;
|
||||
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
|
||||
typedef typename CK::Circular_arc_2 Rcircular_arc_2;
|
||||
typedef typename CK::Root_of_2 Root_of_2;
|
||||
|
||||
public:
|
||||
typedef BK R;
|
||||
typedef Circular_arc_2<BK> Rep;
|
||||
|
||||
const Rep& rep() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rep& rep()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
///////////Construction/////////////
|
||||
|
||||
Circular_arc_2(){}
|
||||
|
||||
// otherwise it will lead to ambiguos definitions
|
||||
explicit Circular_arc_2(const Circle_2 &c)
|
||||
: P_arc(c),bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_2(const Circle_2 &support,
|
||||
const Line_2 &l1, const bool b_l1,
|
||||
const Line_2 &l2, const bool b_l2)
|
||||
: P_arc(support,l1,b_l1,l2,b_l2),bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Circular_arc_2(const Circle_2 &c,
|
||||
const Circle_2 &c1, const bool b_1,
|
||||
const Circle_2 &c2, const bool b_2)
|
||||
: P_arc(c,c1,b_1,c2,b_2),bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Circular_arc_2(const Rcircular_arc_2 &A, const bool b,
|
||||
const Circle_2 &ccut, const bool b_cut)
|
||||
: P_arc(A, b, ccut, b_cut),bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Circular_arc_2(const Point_2 &start,
|
||||
const Point_2 &middle,
|
||||
const Point_2 &end)
|
||||
: P_arc(start, middle, end),bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_2(const Point_2 &begin,
|
||||
const Point_2 &end,
|
||||
const FT &bulge)
|
||||
: P_arc(begin, end, bulge),bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_2(const Circle_2 &support,
|
||||
const Circular_arc_point_2 &begin,
|
||||
const Circular_arc_point_2 &end)
|
||||
: P_arc(support, begin.point(), end.point()),bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_2(const Rcircular_arc_2 &a)
|
||||
: P_arc(a),bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_2(const Circular_arc_2 &c) : P_arc(c.P_arc)
|
||||
{
|
||||
if(c.bb) bb = new Bbox_2(*(c.bb));
|
||||
else bb = NULL;
|
||||
}
|
||||
|
||||
~Circular_arc_2() { if(bb) delete bb; }
|
||||
|
||||
|
||||
//////////Predicates//////////
|
||||
|
||||
bool is_x_monotone() const
|
||||
{ return P_arc.is_x_monotone();}
|
||||
|
||||
bool is_y_monotone() const
|
||||
{ return P_arc.is_y_monotone();}
|
||||
|
||||
bool on_upper_part() const
|
||||
{ return P_arc.on_upper_part();}
|
||||
|
||||
|
||||
//////////Accessors///////////
|
||||
|
||||
const Rcircular_arc_2& arc () const
|
||||
{ return P_arc ;}
|
||||
|
||||
///Interface of the inner arc///
|
||||
|
||||
typename Qualified_result_of<typename BK::Construct_circular_source_vertex_2,Self>::type
|
||||
source() const
|
||||
{ return typename BK::Construct_circular_source_vertex_2()(*this);}
|
||||
|
||||
typename Qualified_result_of<typename BK::Construct_circular_target_vertex_2,Self>::type
|
||||
target() const
|
||||
{ return typename BK::Construct_circular_target_vertex_2()(*this);}
|
||||
|
||||
typename Qualified_result_of<typename BK::Construct_circular_min_vertex_2,Self>::type
|
||||
left() const
|
||||
{
|
||||
return typename BK::Construct_circular_min_vertex_2()(*this);
|
||||
}
|
||||
|
||||
typename Qualified_result_of<typename BK::Construct_circular_max_vertex_2,Self>::type
|
||||
right() const
|
||||
{
|
||||
return typename BK::Construct_circular_max_vertex_2()(*this);
|
||||
}
|
||||
|
||||
Circle_2 supporting_circle() const
|
||||
{ return P_arc.supporting_circle();}
|
||||
|
||||
Point_2 center() const
|
||||
{ return P_arc.center();}
|
||||
|
||||
FT squared_radius() const
|
||||
{ return P_arc.squared_radius();}
|
||||
|
||||
Bbox_2 bbox() const
|
||||
{
|
||||
if(bb==NULL)
|
||||
bb=new Bbox_2(P_arc.bbox());
|
||||
return *bb;
|
||||
}
|
||||
|
||||
|
||||
///Specific check used for bbox construction///
|
||||
|
||||
bool has_no_bbox() const
|
||||
{ return (bb==NULL);}
|
||||
|
||||
bool equal_ref(const Circular_arc_2 &c) const
|
||||
{
|
||||
return CGAL::identical(P_arc, c.P_arc);
|
||||
}
|
||||
|
||||
bool is_full() const {
|
||||
return P_arc.is_full();
|
||||
}
|
||||
|
||||
bool is_complementary_x_monotone() const {
|
||||
return P_arc.is_complementary_x_monotone();
|
||||
}
|
||||
|
||||
bool is_complementary_y_monotone() const {
|
||||
return P_arc.is_complementary_y_monotone();
|
||||
}
|
||||
|
||||
bool two_end_points_on_upper_part() const {
|
||||
return P_arc.two_end_points_on_upper_part();
|
||||
}
|
||||
|
||||
bool complementary_on_upper_part() const {
|
||||
return P_arc.complementary_on_upper_part();
|
||||
}
|
||||
|
||||
bool two_end_points_on_left_part() const {
|
||||
return P_arc.two_end_points_on_left_part();
|
||||
}
|
||||
|
||||
bool on_left_part() const {
|
||||
return P_arc.on_left_part();
|
||||
}
|
||||
|
||||
bool complementary_on_left_part() const {
|
||||
return P_arc.complementary_on_left_part();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Rcircular_arc_2 P_arc;
|
||||
mutable Bbox_2 *bb;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -172,103 +172,6 @@ public:
|
|||
return os << p.x() << " " << p.y() << " ";
|
||||
}
|
||||
|
||||
template < class CK >
|
||||
struct Filtered_bbox_circular_kernel_2;
|
||||
|
||||
template < typename CK >
|
||||
class Circular_arc_point_2 < Filtered_bbox_circular_kernel_2 < CK > > {
|
||||
|
||||
typedef Filtered_bbox_circular_kernel_2 < CK > BK;
|
||||
typedef typename CK::FT FT;
|
||||
typedef typename CK::RT RT;
|
||||
typedef typename BK::Point_2 Point_2;
|
||||
typedef typename CK::Line_2 Line_2;
|
||||
typedef typename CK::Circle_2 Circle_2;
|
||||
typedef typename CK::Circular_arc_point_2 Rcircular_arc_point_2;
|
||||
typedef typename CK::Circular_arc_2 Circular_arc_2;
|
||||
typedef typename CK::Root_of_2 Root_of_2;
|
||||
|
||||
public:
|
||||
typedef typename Rcircular_arc_point_2::Root_for_circles_2_2
|
||||
Root_for_circles_2_2;
|
||||
typedef BK R;
|
||||
typedef Circular_arc_point_2<BK> Rep;
|
||||
|
||||
const Rep& rep() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rep& rep()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
////Construction/////
|
||||
Circular_arc_point_2()
|
||||
: P_point(),bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_point_2(const Root_for_circles_2_2 & np)
|
||||
: P_point(np), bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_point_2(const Point_2 & p)
|
||||
: P_point(p), bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_point_2(const Rcircular_arc_point_2 & p)
|
||||
: P_point(p),bb(NULL)
|
||||
{}
|
||||
|
||||
Circular_arc_point_2(const Circular_arc_point_2 &c) : P_point(c.P_point)
|
||||
{
|
||||
if(c.bb) bb = new Bbox_2(*(c.bb));
|
||||
else bb = NULL;
|
||||
}
|
||||
|
||||
~Circular_arc_point_2() { if(bb) delete bb; }
|
||||
|
||||
////Accesors////
|
||||
const Rcircular_arc_point_2& point() const
|
||||
{return P_point;}
|
||||
|
||||
typename Qualified_result_of<typename R::Compute_circular_x_2,Rcircular_arc_point_2>::type
|
||||
x() const
|
||||
{ return P_point.x();}
|
||||
|
||||
typename Qualified_result_of<typename R::Compute_circular_y_2,Rcircular_arc_point_2>::type
|
||||
y() const
|
||||
{ return P_point.y();}
|
||||
|
||||
|
||||
////Bbox related accessors////
|
||||
|
||||
bool has_no_bbox() const
|
||||
{ return (bb==NULL);}
|
||||
|
||||
Bbox_2 bbox() const
|
||||
{
|
||||
if(this->has_no_bbox())
|
||||
bb= new Bbox_2(P_point.bbox());
|
||||
|
||||
return *bb;
|
||||
}
|
||||
|
||||
const Root_for_circles_2_2 & coordinates() const
|
||||
{ return P_point.coordinates(); }
|
||||
|
||||
bool equal_ref(const Circular_arc_point_2 &p) const
|
||||
{
|
||||
return CGAL::identical(P_point, p.P_point);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Rcircular_arc_point_2 P_point;
|
||||
mutable Bbox_2 *bb;
|
||||
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ namespace internal {
|
|||
template < class CircularKernel, class LinearKernelBase, class AlgebraicKernel >
|
||||
struct Circular_kernel_base_ref_count: public LinearKernelBase
|
||||
{
|
||||
typedef internal::Circular_arc_2<CircularKernel> Circular_arc_2;
|
||||
typedef internal::Circular_arc_point_2<CircularKernel> Circular_arc_point_2;
|
||||
typedef internal::Line_arc_2<CircularKernel> Line_arc_2;
|
||||
typedef internal::Circular_arc_2_base<CircularKernel> Circular_arc_2;
|
||||
typedef internal::Circular_arc_point_2_base<CircularKernel> Circular_arc_point_2;
|
||||
typedef internal::Line_arc_2_base<CircularKernel> Line_arc_2;
|
||||
typedef LinearKernelBase Linear_kernel;
|
||||
typedef AlgebraicKernel Algebraic_kernel;
|
||||
typedef typename Algebraic_kernel::Root_of_2 Root_of_2;
|
||||
|
|
@ -66,7 +66,12 @@ struct Circular_kernel_base_ref_count: public LinearKernelBase
|
|||
struct Handle { typedef Handle_for<T> type; };
|
||||
|
||||
template < typename Kernel2 >
|
||||
struct Base { typedef Circular_kernel_base_ref_count<Kernel2, LinearKernelBase, AlgebraicKernel> Type; };
|
||||
struct Base {
|
||||
typedef typename LinearKernelBase::template Base<Kernel2>::Type ReboundLK;
|
||||
typedef Circular_kernel_base_ref_count<Kernel2,
|
||||
ReboundLK,
|
||||
AlgebraicKernel> Type;
|
||||
};
|
||||
|
||||
#define CGAL_Circular_Kernel_pred(Y,Z) \
|
||||
typedef CircularFunctors::Y<CircularKernel> Y; \
|
||||
|
|
|
|||
|
|
@ -44,9 +44,11 @@
|
|||
namespace CGAL {
|
||||
namespace internal {
|
||||
|
||||
template <class CK >
|
||||
class Circular_arc_2
|
||||
template <class CK_ >
|
||||
class Circular_arc_2_base
|
||||
{
|
||||
public:
|
||||
typedef CK_ CK;
|
||||
typedef typename CK::FT FT;
|
||||
typedef typename CK::RT RT;
|
||||
typedef typename CK::Point_2 Point_2;
|
||||
|
|
@ -54,6 +56,8 @@ namespace internal {
|
|||
typedef typename CK::Circle_2 Circle_2;
|
||||
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
|
||||
typedef typename CK::Root_of_2 Root_of_2;
|
||||
|
||||
private:
|
||||
typedef struct bit_field {
|
||||
unsigned short int is_full:2;
|
||||
unsigned short int is_x_monotonic:2;
|
||||
|
|
@ -87,7 +91,7 @@ namespace internal {
|
|||
|
||||
public:
|
||||
|
||||
Circular_arc_2()
|
||||
Circular_arc_2_base()
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES
|
||||
: id_of_my_supporting_circle(0)
|
||||
#endif
|
||||
|
|
@ -100,7 +104,7 @@ namespace internal {
|
|||
|
||||
}
|
||||
|
||||
Circular_arc_2(const Circle_2 &c)
|
||||
Circular_arc_2_base(const Circle_2 &c)
|
||||
: _support(c)
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES
|
||||
, id_of_my_supporting_circle(0)
|
||||
|
|
@ -117,7 +121,7 @@ namespace internal {
|
|||
CircularFunctors::x_extremal_point<CK>(supporting_circle(),true);
|
||||
}
|
||||
|
||||
Circular_arc_2(const Circle_2 &support,
|
||||
Circular_arc_2_base(const Circle_2 &support,
|
||||
const Line_2 &l1, bool b1,
|
||||
const Line_2 &l2, bool b2)
|
||||
{
|
||||
|
|
@ -143,14 +147,14 @@ namespace internal {
|
|||
|
||||
Circle_2 c2 (center2, sqr2);
|
||||
|
||||
*this = Circular_arc_2(support, c1, b1, c2, b2);
|
||||
*this = Circular_arc_2_base(support, c1, b1, c2, b2);
|
||||
|
||||
CGAL_kernel_assertion(do_intersect(support, c1));
|
||||
CGAL_kernel_assertion(do_intersect(support, c2));
|
||||
}
|
||||
|
||||
|
||||
Circular_arc_2(const Circle_2 &c,
|
||||
Circular_arc_2_base(const Circle_2 &c,
|
||||
const Circle_2 &c1, const bool b_1,
|
||||
const Circle_2 &c2, const bool b_2)
|
||||
: _support(c)
|
||||
|
|
@ -208,7 +212,7 @@ namespace internal {
|
|||
// having same (b) endpoint as A (true == _begin, false == _end)
|
||||
// but whose (!b) endpoint is the intersection of A with ccut given
|
||||
// by b_cut
|
||||
Circular_arc_2(const Circular_arc_2 &A, const bool b,
|
||||
Circular_arc_2_base(const Circular_arc_2_base &A, const bool b,
|
||||
const Circle_2 &ccut, const bool b_cut)
|
||||
: _support(A.supporting_circle())
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES
|
||||
|
|
@ -244,7 +248,7 @@ namespace internal {
|
|||
// Constructs an arc supported by Circle_2(begin, middle, end),
|
||||
// with _begin == begin, _end == end.
|
||||
// (middle is not necessarily on the arc)
|
||||
Circular_arc_2(const Point_2 &begin,
|
||||
Circular_arc_2_base(const Point_2 &begin,
|
||||
const Point_2 &middle,
|
||||
const Point_2 &end)
|
||||
: _begin(begin), _end(end)
|
||||
|
|
@ -264,14 +268,14 @@ namespace internal {
|
|||
* Circle_2 c = Circle_2(begin, middle, end);
|
||||
* Line_2 l1 (begin, middle);
|
||||
Line_2 l2 (middle, end);
|
||||
*this = Circular_arc_2(c,
|
||||
*this = Circular_arc_2_base(c,
|
||||
l1, compare_xy(begin, middle) < 0,
|
||||
l2, compare_xy(end, middle) < 0);*/
|
||||
//std::cout << source() << std::endl;
|
||||
//std::cout << target() << std::endl;
|
||||
}
|
||||
|
||||
Circular_arc_2(const Circle_2 &support,
|
||||
Circular_arc_2_base(const Circle_2 &support,
|
||||
const Circular_arc_point_2 &source,
|
||||
const Circular_arc_point_2 &target)
|
||||
: _begin(source), _end(target), _support(support)
|
||||
|
|
@ -293,7 +297,7 @@ namespace internal {
|
|||
// CGAL_kernel_exactness_precondition(CK().has_on_2_object()(support, target));
|
||||
}
|
||||
|
||||
Circular_arc_2(const Point_2 &begin,
|
||||
Circular_arc_2_base(const Point_2 &begin,
|
||||
const Point_2 &end,
|
||||
const FT &bulge)
|
||||
: _begin(begin), _end(end)
|
||||
|
|
@ -337,15 +341,15 @@ namespace internal {
|
|||
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE
|
||||
template < class T >
|
||||
static bool find_intersection(const Circular_arc_2& c1,
|
||||
const Circular_arc_2& c2,
|
||||
static bool find_intersection(const Circular_arc_2_base& c1,
|
||||
const Circular_arc_2_base& c2,
|
||||
T& res) {
|
||||
return table.find<T>(c1.my_id, c2.my_id, res);
|
||||
}
|
||||
|
||||
template < class T >
|
||||
static void put_intersection(const Circular_arc_2& c1,
|
||||
const Circular_arc_2& c2,
|
||||
static void put_intersection(const Circular_arc_2_base& c1,
|
||||
const Circular_arc_2_base& c2,
|
||||
const T& res) {
|
||||
table.put<T>(c1.my_id, c2.my_id, res);
|
||||
}
|
||||
|
|
@ -357,8 +361,8 @@ namespace internal {
|
|||
|
||||
template < class T >
|
||||
static bool find_intersection_circle_circle(
|
||||
const Circular_arc_2& c1,
|
||||
const Circular_arc_2& c2,
|
||||
const Circular_arc_2_base& c1,
|
||||
const Circular_arc_2_base& c2,
|
||||
T& res) {
|
||||
if(c1.id_of_my_supporting_circle == 0) return false;
|
||||
if(c2.id_of_my_supporting_circle == 0) return false;
|
||||
|
|
@ -368,8 +372,8 @@ namespace internal {
|
|||
}
|
||||
|
||||
template < class T >
|
||||
static void put_intersection_circle_circle(const Circular_arc_2& c1,
|
||||
const Circular_arc_2& c2,
|
||||
static void put_intersection_circle_circle(const Circular_arc_2_base& c1,
|
||||
const Circular_arc_2_base& c2,
|
||||
const T& res) {
|
||||
circle_table.put<T>(c1.circle_number(),
|
||||
c2.circle_number(),
|
||||
|
|
@ -653,23 +657,23 @@ public:
|
|||
flags.is_complementary_x_monotone = v_is_complementary_x_monotone;
|
||||
}
|
||||
|
||||
};
|
||||
}; // end class Circular_arc_2_base
|
||||
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE
|
||||
template < typename CK >
|
||||
internal::Intersection_line_2_circle_2_map Circular_arc_2< CK >::table =
|
||||
internal::Intersection_line_2_circle_2_map Circular_arc_2_base< CK >::table =
|
||||
internal::Intersection_line_2_circle_2_map();
|
||||
#endif
|
||||
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES
|
||||
template < typename CK >
|
||||
internal::Intersection_line_2_circle_2_map Circular_arc_2< CK >::circle_table =
|
||||
internal::Intersection_line_2_circle_2_map Circular_arc_2_base< CK >::circle_table =
|
||||
internal::Intersection_line_2_circle_2_map();
|
||||
#endif
|
||||
|
||||
template < typename CK >
|
||||
std::ostream &
|
||||
operator<<(std::ostream & os, const Circular_arc_2<CK> &a)
|
||||
operator<<(std::ostream & os, const Circular_arc_2_base<CK> &a)
|
||||
{
|
||||
// The output format is :
|
||||
// - supporting circle
|
||||
|
|
@ -684,23 +688,23 @@ public:
|
|||
|
||||
template < typename CK >
|
||||
std::istream &
|
||||
operator>>(std::istream & is, Circular_arc_2<CK> &a)
|
||||
operator>>(std::istream & is, Circular_arc_2_base<CK> &a)
|
||||
{
|
||||
typename CK::Circle_2 s;
|
||||
typename CK::Circular_arc_point_2 p1;
|
||||
typename CK::Circular_arc_point_2 p2;
|
||||
is >> s >> p1 >> p2 ;
|
||||
if (is)
|
||||
a = Circular_arc_2<CK>(s, p1, p2);
|
||||
a = Circular_arc_2_base<CK>(s, p1, p2);
|
||||
return is;
|
||||
}
|
||||
|
||||
template < typename CK >
|
||||
std::ostream &
|
||||
print(std::ostream & os, const Circular_arc_2<CK> &a)
|
||||
print(std::ostream & os, const Circular_arc_2_base<CK> &a)
|
||||
{
|
||||
if(a.is_x_monotone()) {
|
||||
return os << "Circular_arc_2( " << std::endl
|
||||
return os << "Circular_arc_2_base( " << std::endl
|
||||
<< "left : " << a.left() << " , " << std::endl
|
||||
<< "right : " << a.right() << " , " << std::endl
|
||||
<< "upper part : " << a.on_upper_part() << std::endl
|
||||
|
|
@ -710,7 +714,7 @@ public:
|
|||
<< std::sqrt(CGAL::to_double(a.supporting_circle().squared_radius()))
|
||||
<< " ]])" << std::endl;
|
||||
} else {
|
||||
return os << "Circular_arc_2( " << std::endl
|
||||
return os << "Circular_arc_2_base( " << std::endl
|
||||
<< " [[ approximate circle is (x,y,r) : "
|
||||
<< CGAL::to_double(a.supporting_circle().center().x()) << ""
|
||||
<< CGAL::to_double(a.supporting_circle().center().y()) << ""
|
||||
|
|
@ -719,6 +723,96 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
template < typename CK >
|
||||
class Filtered_bbox_circular_arc_2_base : public Circular_arc_2_base<CK>
|
||||
{
|
||||
typedef Filtered_bbox_circular_arc_2_base<CK> Self;
|
||||
typedef Circular_arc_2_base<CK> P_arc;
|
||||
typedef typename CK::FT FT;
|
||||
typedef typename CK::Point_2 Point_2;
|
||||
typedef typename CK::Line_2 Line_2;
|
||||
typedef typename CK::Circle_2 Circle_2;
|
||||
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
|
||||
typedef typename CK::Root_of_2 Root_of_2;
|
||||
|
||||
public:
|
||||
///////////Construction/////////////
|
||||
|
||||
Filtered_bbox_circular_arc_2_base() : P_arc(), bb(NULL) {}
|
||||
|
||||
// otherwise it will lead to ambiguos definitions
|
||||
explicit Filtered_bbox_circular_arc_2_base(const Circle_2 &c)
|
||||
: P_arc(c),bb(NULL)
|
||||
{}
|
||||
|
||||
Filtered_bbox_circular_arc_2_base(const Circle_2 &support,
|
||||
const Line_2 &l1, const bool b_l1,
|
||||
const Line_2 &l2, const bool b_l2)
|
||||
: P_arc(support,l1,b_l1,l2,b_l2),bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Filtered_bbox_circular_arc_2_base(const Circle_2 &c,
|
||||
const Circle_2 &c1, const bool b_1,
|
||||
const Circle_2 &c2, const bool b_2)
|
||||
: P_arc(c,c1,b_1,c2,b_2),bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Filtered_bbox_circular_arc_2_base(const Point_2 &start,
|
||||
const Point_2 &middle,
|
||||
const Point_2 &end)
|
||||
: P_arc(start, middle, end),bb(NULL)
|
||||
{}
|
||||
|
||||
Filtered_bbox_circular_arc_2_base(const Point_2 &begin,
|
||||
const Point_2 &end,
|
||||
const FT &bulge)
|
||||
: P_arc(begin, end, bulge),bb(NULL)
|
||||
{}
|
||||
|
||||
Filtered_bbox_circular_arc_2_base(const Circle_2 &support,
|
||||
const Circular_arc_point_2 &begin,
|
||||
const Circular_arc_point_2 &end)
|
||||
: P_arc(support, begin, end),bb(NULL)
|
||||
{}
|
||||
|
||||
Filtered_bbox_circular_arc_2_base(const Self &c)
|
||||
: P_arc(c), bb(c.bb ? new Bbox_2(*(c.bb)) : NULL)
|
||||
{}
|
||||
|
||||
Filtered_bbox_circular_arc_2_base& operator=(const Self& c)
|
||||
{
|
||||
if(this != &c)
|
||||
{
|
||||
this->P_arc::operator=(c);
|
||||
bb = c.bb ? new Bbox_2(*(c.bb)) : NULL;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
~Filtered_bbox_circular_arc_2_base() { if(bb) delete bb; }
|
||||
|
||||
Bbox_2 bbox() const
|
||||
{
|
||||
if(bb==NULL)
|
||||
bb=new Bbox_2(CGAL::CircularFunctors::circular_arc_bbox<CK>(*this));
|
||||
return *bb;
|
||||
}
|
||||
|
||||
|
||||
///Specific check used for bbox construction///
|
||||
bool has_no_bbox() const
|
||||
{ return (bb==NULL);}
|
||||
|
||||
private:
|
||||
mutable Bbox_2 *bb;
|
||||
}; // end class Filtered_bbox_circular_arc_2_base
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace internal
|
||||
} // namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace CGAL {
|
|||
namespace internal {
|
||||
|
||||
template <class CK >
|
||||
class Circular_arc_point_2
|
||||
class Circular_arc_point_2_base
|
||||
{
|
||||
typedef typename CK::FT FT;
|
||||
typedef typename CK::Root_of_2 Root_of_2;
|
||||
|
|
@ -44,14 +44,14 @@ namespace internal {
|
|||
typedef typename CK::Root_for_circles_2_2 Root_for_circles_2_2;
|
||||
typedef typename CK::template Handle<Root_for_circles_2_2>::type Base;
|
||||
|
||||
Circular_arc_point_2()
|
||||
Circular_arc_point_2_base()
|
||||
{}
|
||||
|
||||
Circular_arc_point_2(const Root_for_circles_2_2 & np)
|
||||
Circular_arc_point_2_base(const Root_for_circles_2_2 & np)
|
||||
: _p(np)
|
||||
{}
|
||||
|
||||
Circular_arc_point_2(const Point_2 & p)
|
||||
Circular_arc_point_2_base(const Point_2 & p)
|
||||
: _p(p.x(),p.y()/*,1,1,-p.x()-p.y()*/)
|
||||
{}
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ namespace internal {
|
|||
const Root_for_circles_2_2 & coordinates() const
|
||||
{ return get(_p); }
|
||||
|
||||
bool equal_ref(const Circular_arc_point_2 &p) const
|
||||
bool equal_ref(const Circular_arc_point_2_base &p) const
|
||||
{
|
||||
return CGAL::identical(_p, p._p);
|
||||
}
|
||||
|
|
@ -80,12 +80,84 @@ namespace internal {
|
|||
|
||||
template < typename CK >
|
||||
std::ostream &
|
||||
print(std::ostream & os, const Circular_arc_point_2<CK> &p)
|
||||
print(std::ostream & os, const Circular_arc_point_2_base<CK> &p)
|
||||
{
|
||||
return os << "CirclArcEndPoint_2(" << std::endl
|
||||
<< p.x() << ", " << p.y() << ')';
|
||||
}
|
||||
|
||||
template < typename BK >
|
||||
class Filtered_bbox_circular_arc_point_2_base
|
||||
: public Circular_arc_point_2_base<BK>
|
||||
{
|
||||
public:
|
||||
typedef Filtered_bbox_circular_arc_point_2_base<BK> Self;
|
||||
typedef Circular_arc_point_2_base<BK> P_point;
|
||||
|
||||
typedef typename BK::Point_2 Point_2;
|
||||
typedef typename BK::Root_for_circles_2_2 Root_for_circles_2_2;
|
||||
|
||||
void trace_bb() const {
|
||||
std::cerr << "Creation bb = " << (void*)(bb);
|
||||
if(bb) {
|
||||
std::cerr << " (" << *bb << ")";
|
||||
}
|
||||
std::cerr << "\n";
|
||||
}
|
||||
|
||||
////Construction/////
|
||||
Filtered_bbox_circular_arc_point_2_base()
|
||||
: P_point(), bb(NULL)
|
||||
{}
|
||||
|
||||
explicit Filtered_bbox_circular_arc_point_2_base(const Root_for_circles_2_2 & np)
|
||||
: P_point(np), bb(NULL)
|
||||
{trace_bb();}
|
||||
|
||||
explicit Filtered_bbox_circular_arc_point_2_base(const Point_2 & p)
|
||||
: P_point(p), bb(NULL)
|
||||
{trace_bb();}
|
||||
|
||||
Filtered_bbox_circular_arc_point_2_base(const Self &c)
|
||||
: P_point(c), bb(c.bb ? new Bbox_2(*(c.bb)) : NULL)
|
||||
{trace_bb();}
|
||||
|
||||
Filtered_bbox_circular_arc_point_2_base&
|
||||
operator=(const Self& c) {
|
||||
if(this != &c)
|
||||
{
|
||||
this->P_point::operator=(c);
|
||||
bb = c.bb ? new Bbox_2(*(c.bb)) : NULL;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
~Filtered_bbox_circular_arc_point_2_base() {
|
||||
std::cerr << "Destruction, bb = " << (void*)(bb) << std::endl;
|
||||
if(bb) {
|
||||
delete bb;
|
||||
bb = 0;
|
||||
}
|
||||
}
|
||||
|
||||
////Bbox related accessors////
|
||||
|
||||
bool has_no_bbox() const
|
||||
{ return (bb==NULL);}
|
||||
|
||||
Bbox_2 bbox() const
|
||||
{
|
||||
if(this->has_no_bbox())
|
||||
bb= new Bbox_2(P_point::bbox());
|
||||
|
||||
return *bb;
|
||||
}
|
||||
|
||||
private:
|
||||
mutable Bbox_2 *bb;
|
||||
}; // end class Filtered_bbox_circular_arc_point_2_base
|
||||
|
||||
|
||||
} // namespace internal
|
||||
} // namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,10 @@
|
|||
namespace CGAL {
|
||||
namespace internal {
|
||||
|
||||
template <class CK >
|
||||
class Line_arc_2
|
||||
{
|
||||
template <class CK >
|
||||
class Line_arc_2_base
|
||||
{
|
||||
public:
|
||||
typedef typename CK::FT FT;
|
||||
typedef typename CK::RT RT;
|
||||
typedef typename CK::Point_2 Point_2;
|
||||
|
|
@ -48,11 +49,12 @@ namespace internal {
|
|||
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
|
||||
typedef typename CK::Root_of_2 Root_of_2;
|
||||
typedef typename CK::Segment_2 Segment_2;
|
||||
|
||||
private:
|
||||
typedef struct bit_field {
|
||||
unsigned char begin_less_xy_than_end:2;
|
||||
} bit_field;
|
||||
|
||||
private:
|
||||
// set flags to 0
|
||||
// when 1 bit -> 0 = false, 1 = true
|
||||
// when 2 bits -> 0 = don_know, 1 = false
|
||||
|
|
@ -61,7 +63,7 @@ namespace internal {
|
|||
flags.begin_less_xy_than_end = 0;
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
//typedef typename CGAL::Simple_cartesian<Root_of_2>::Point_2
|
||||
// Numeric_point_2;
|
||||
typedef typename CK::Root_for_circles_2_2
|
||||
|
|
@ -96,14 +98,14 @@ namespace internal {
|
|||
}
|
||||
|
||||
|
||||
public:
|
||||
Line_arc_2()
|
||||
public:
|
||||
Line_arc_2_base()
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES
|
||||
: id_of_my_supporting_line(Circular_arc_2::circle_table.get_new_id())
|
||||
#endif
|
||||
{}
|
||||
|
||||
Line_arc_2(const Line_2 &support,
|
||||
Line_arc_2_base(const Line_2 &support,
|
||||
const Circle_2 &c1,const bool b1,
|
||||
const Circle_2 &c2,const bool b2)
|
||||
:_support(support)
|
||||
|
|
@ -117,7 +119,7 @@ namespace internal {
|
|||
}
|
||||
|
||||
|
||||
Line_arc_2(const Line_2 &support,
|
||||
Line_arc_2_base(const Line_2 &support,
|
||||
const Line_2 &l1,
|
||||
const Line_2 &l2)
|
||||
:_support(support)
|
||||
|
|
@ -138,7 +140,7 @@ namespace internal {
|
|||
reset_flags();
|
||||
}
|
||||
|
||||
Line_arc_2(const Line_2 &support,
|
||||
Line_arc_2_base(const Line_2 &support,
|
||||
const Circular_arc_point_2 &p1,
|
||||
const Circular_arc_point_2 &p2)
|
||||
:_support(support)
|
||||
|
|
@ -152,7 +154,7 @@ namespace internal {
|
|||
reset_flags();
|
||||
}
|
||||
|
||||
Line_arc_2(const Segment_2 &s)
|
||||
Line_arc_2_base(const Segment_2 &s)
|
||||
:_support(s.supporting_line())
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES
|
||||
,id_of_my_supporting_line(Circular_arc_2::circle_table.get_new_id())
|
||||
|
|
@ -164,7 +166,7 @@ namespace internal {
|
|||
}
|
||||
|
||||
|
||||
Line_arc_2(const Point_2 &p1,
|
||||
Line_arc_2_base(const Point_2 &p1,
|
||||
const Point_2 &p2)
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES
|
||||
: id_of_my_supporting_line(Circular_arc_2::circle_table.get_new_id())
|
||||
|
|
@ -176,7 +178,7 @@ namespace internal {
|
|||
reset_flags();
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
Line_2 _support;
|
||||
Circular_arc_point_2 _begin, _end;
|
||||
|
|
@ -194,7 +196,7 @@ namespace internal {
|
|||
}
|
||||
#endif
|
||||
|
||||
private: //(some useful functions)
|
||||
private: //(some useful functions)
|
||||
|
||||
bool begin_less_xy_than_end() const {
|
||||
if(flags.begin_less_xy_than_end == 0) {
|
||||
|
|
@ -204,13 +206,13 @@ namespace internal {
|
|||
} return flags.begin_less_xy_than_end == 2;
|
||||
}
|
||||
|
||||
public :
|
||||
public :
|
||||
|
||||
#ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES
|
||||
template < class T >
|
||||
static bool find_intersection_circle_line(
|
||||
const Circular_arc_2& c,
|
||||
const Line_arc_2& l,
|
||||
const Line_arc_2_base& l,
|
||||
T& res) {
|
||||
if(c.id_of_my_supporting_circle == 0) return false;
|
||||
return Circular_arc_2::circle_table.template find<T>(c.id_of_my_supporting_circle,
|
||||
|
|
@ -220,7 +222,7 @@ namespace internal {
|
|||
|
||||
template < class T >
|
||||
static void put_intersection_circle_line(const Circular_arc_2& c,
|
||||
const Line_arc_2& l,
|
||||
const Line_arc_2_base& l,
|
||||
const T& res) {
|
||||
Circular_arc_2::circle_table.template put<T>(c.circle_number(),
|
||||
l.line_number(),
|
||||
|
|
@ -263,11 +265,89 @@ namespace internal {
|
|||
return _begin.bbox() + _end.bbox();
|
||||
}
|
||||
|
||||
};
|
||||
}; // end class Line_arc_2_base
|
||||
|
||||
/* template < typename CK > */
|
||||
template <class CB>
|
||||
class Filtered_bbox_line_arc_2_base : public Line_arc_2_base<CB> {
|
||||
typedef Filtered_bbox_line_arc_2_base<CB> Self;
|
||||
typedef Line_arc_2_base<CB> P_arc;
|
||||
|
||||
public:
|
||||
|
||||
typedef typename P_arc::Point_2 Point_2;
|
||||
typedef typename P_arc::Line_2 Line_2;
|
||||
typedef typename P_arc::Segment_2 Segment_2;
|
||||
typedef typename P_arc::Circle_2 Circle_2;
|
||||
typedef typename P_arc::Circular_arc_point_2 Circular_arc_point_2;
|
||||
|
||||
Filtered_bbox_line_arc_2_base() : P_arc(), bb(NULL) {}
|
||||
|
||||
Filtered_bbox_line_arc_2_base(const Line_2 &support,
|
||||
const Circle_2 &l1, const bool b_l1,
|
||||
const Circle_2 &l2, const bool b_l2)
|
||||
: P_arc(support,l1,b_l1,l2,b_l2), bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Filtered_bbox_line_arc_2_base(const Line_2 &support,
|
||||
const Line_2 &l1,
|
||||
const Line_2 &l2)
|
||||
: P_arc(support,l1,l2), bb(NULL)
|
||||
{}
|
||||
|
||||
Filtered_bbox_line_arc_2_base(const Line_2 &support,
|
||||
const Circular_arc_point_2 &begin,
|
||||
const Circular_arc_point_2 &end)
|
||||
: P_arc(support, begin, end) , bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Filtered_bbox_line_arc_2_base(const Segment_2 &s)
|
||||
: P_arc(s) , bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Filtered_bbox_line_arc_2_base(const Point_2 &p1,
|
||||
const Point_2 &p2)
|
||||
: P_arc(p1,p2) , bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Filtered_bbox_line_arc_2_base(const Filtered_bbox_line_arc_2_base &c)
|
||||
: P_arc(c), bb(c.bb ? new Bbox_2(*(c.bb)) : NULL)
|
||||
{}
|
||||
|
||||
Filtered_bbox_line_arc_2_base& operator=(const Self& c)
|
||||
{
|
||||
if(this != &c)
|
||||
{
|
||||
this->P_arc::operator=(c);
|
||||
bb = c.bb ? new Bbox_2(*(c.bb)) : NULL;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
~Filtered_bbox_line_arc_2_base() { if(bb) delete bb; }
|
||||
|
||||
Bbox_2 bbox() const
|
||||
{
|
||||
if(bb==NULL)
|
||||
bb=new Bbox_2(P_arc::bbox());
|
||||
return *bb;
|
||||
}
|
||||
|
||||
bool has_no_bbox() const
|
||||
{ return (bb==NULL);}
|
||||
|
||||
private:
|
||||
|
||||
mutable Bbox_2 *bb;
|
||||
|
||||
}; // end class Filtered_bbox_line_arc_2_base
|
||||
|
||||
/* template < typename CK > */
|
||||
/* std::ostream & */
|
||||
/* operator<<(std::ostream & os, const Line_arc_2<CK> &a) */
|
||||
/* operator<<(std::ostream & os, const Line_arc_2_base<CK> &a) */
|
||||
/* { */
|
||||
|
||||
/* return os << a.supporting_line() << " " */
|
||||
|
|
@ -277,19 +357,19 @@ namespace internal {
|
|||
|
||||
/* template < typename CK > */
|
||||
/* std::istream & */
|
||||
/* operator>>(std::istream & is, Line_arc_2<CK> &a) */
|
||||
/* operator>>(std::istream & is, Line_arc_2_base<CK> &a) */
|
||||
/* { */
|
||||
/* typename CK::Line_2 l; */
|
||||
/* typename CK::Circular_arc_point_2 p1; */
|
||||
/* typename CK::Circular_arc_point_2 p2; */
|
||||
/* is >> l >> p1 >> p2 ; */
|
||||
/* if (is) */
|
||||
/* a = Line_arc_2<CK>(l, p1, p2); */
|
||||
/* a = Line_arc_2_base<CK>(l, p1, p2); */
|
||||
/* return is; */
|
||||
/* } */
|
||||
|
||||
|
||||
} // namespace internal
|
||||
} // namespace internal
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_CIRCULAR_KERNEL_LINE_ARC_2_H
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ template < class FilteredBboxKernel, class CircularKernel >
|
|||
struct Filtered_bbox_circular_kernel_base_ref_count : public CircularKernel
|
||||
{
|
||||
|
||||
typedef CGAL::Circular_arc_2<FilteredBboxKernel> Circular_arc_2;
|
||||
typedef CGAL::Line_arc_2<FilteredBboxKernel> Line_arc_2;
|
||||
typedef CGAL::Circular_arc_point_2<FilteredBboxKernel> Circular_arc_point_2;
|
||||
typedef internal::Filtered_bbox_circular_arc_2_base<FilteredBboxKernel> Circular_arc_2;
|
||||
typedef internal::Filtered_bbox_line_arc_2_base<FilteredBboxKernel> Line_arc_2;
|
||||
typedef internal::Filtered_bbox_circular_arc_point_2_base<FilteredBboxKernel> Circular_arc_point_2;
|
||||
|
||||
// The mechanism that allows to specify reference-counting or not.
|
||||
template < typename T >
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -37,35 +37,12 @@
|
|||
CGAL_Filtered_Bbox_Circular_Kernel_pred(Compare_xy_2, compare_xy_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_pred(Has_on_2, has_on_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_pred(Compare_y_at_x_2, compare_y_at_x_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_pred(Compare_y_to_right_2, compare_y_to_right_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_pred(Do_overlap_2, do_overlap_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_pred(Equal_2, equal_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_pred(In_x_range_2, in_x_range_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_pred(Do_intersect_2, do_intersect_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_pred(Is_vertical_2, is_vertical_2_object)
|
||||
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Construct_line_arc_2,
|
||||
construct_line_arc_2_object_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Construct_circular_arc_2,
|
||||
construct_circular_arc_2_object_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Construct_circular_source_vertex_2,
|
||||
construct_circular_source_vertex_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Construct_circular_target_vertex_2,
|
||||
construct_circular_target_vertex_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Construct_circular_min_vertex_2,
|
||||
construct_circular_min_vertex_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Construct_circular_max_vertex_2,
|
||||
construct_circular_max_vertex_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Make_x_monotone_2,
|
||||
make_x_monotone_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Intersect_2,
|
||||
intersect_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Split_2,
|
||||
split_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Construct_bbox_2,
|
||||
construct_bbox_2_object)
|
||||
CGAL_Filtered_Bbox_Circular_Kernel_cons(Construct_circular_arc_point_2,
|
||||
construct_circular_arc_point_2_object)
|
||||
|
||||
#undef CGAL_Filtered_Bbox_Circular_Kernel_pred
|
||||
#undef CGAL_Filtered_Bbox_Circular_Kernel_cons
|
||||
|
|
|
|||
|
|
@ -185,143 +185,6 @@ operator!=(const Line_arc_2<CircularKernel> &p,
|
|||
return is;
|
||||
}
|
||||
|
||||
template < class CK >
|
||||
struct Filtered_bbox_circular_kernel_2;
|
||||
|
||||
template < typename CK >
|
||||
class Line_arc_2 < Filtered_bbox_circular_kernel_2 < CK > > {
|
||||
|
||||
typedef Filtered_bbox_circular_kernel_2 < CK > BK;
|
||||
typedef Line_arc_2< BK > Self;
|
||||
typedef typename CK::FT FT;
|
||||
typedef typename CK::RT RT;
|
||||
typedef typename CK::Point_2 Point_2;
|
||||
typedef typename BK::Line_2 Line_2;
|
||||
typedef typename CK::Segment_2 Segment_2;
|
||||
typedef typename CK::Circle_2 Circle_2;
|
||||
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
|
||||
typedef typename CK::Line_arc_2 Rline_arc_2;
|
||||
typedef typename CK::Root_of_2 Root_of_2;
|
||||
|
||||
|
||||
public:
|
||||
typedef BK R;
|
||||
typedef Line_arc_2<BK> Rep;
|
||||
|
||||
const Rep& rep() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rep& rep()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
///////////Construction/////////////
|
||||
|
||||
Line_arc_2(){}
|
||||
|
||||
Line_arc_2(const Line_2 &support,
|
||||
const Circle_2 &l1, const bool b_l1,
|
||||
const Circle_2 &l2, const bool b_l2)
|
||||
: P_arc(support,l1,b_l1,l2,b_l2), bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Line_arc_2(const Line_2 &support,
|
||||
const Line_2 &l1,
|
||||
const Line_2 &l2)
|
||||
: P_arc(support,l1,l2), bb(NULL)
|
||||
{}
|
||||
|
||||
Line_arc_2(const Line_2 &support,
|
||||
const Circular_arc_point_2 &begin,
|
||||
const Circular_arc_point_2 &end)
|
||||
: P_arc(support, begin.point(), end.point()) , bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Line_arc_2(const Segment_2 &s)
|
||||
: P_arc(s) , bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Line_arc_2(const Point_2 &p1,
|
||||
const Point_2 &p2)
|
||||
: P_arc(p1,p2) , bb(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Line_arc_2(const Rline_arc_2 &a)
|
||||
: P_arc(a) , bb(NULL)
|
||||
{}
|
||||
|
||||
Line_arc_2(const Line_arc_2 &c) : P_arc(c.P_arc)
|
||||
{
|
||||
if(c.bb) bb = new Bbox_2(*(c.bb));
|
||||
else bb = NULL;
|
||||
}
|
||||
|
||||
~Line_arc_2() { if(bb) delete bb; }
|
||||
|
||||
|
||||
//////////Predicates//////////
|
||||
|
||||
bool is_vertical() const
|
||||
{ return P_arc.is_vertical();}
|
||||
|
||||
//////////Accessors///////////
|
||||
|
||||
const Rline_arc_2& arc () const
|
||||
{ return P_arc ;}
|
||||
|
||||
///Interface of the inner arc///
|
||||
|
||||
typename Qualified_result_of<typename BK::Construct_circular_min_vertex_2,Self>::type
|
||||
left() const
|
||||
{return typename BK::Construct_circular_min_vertex_2()(*this);}
|
||||
|
||||
typename Qualified_result_of<typename BK::Construct_circular_max_vertex_2,Self>::type
|
||||
right() const
|
||||
{return typename BK::Construct_circular_max_vertex_2()(*this);}
|
||||
|
||||
typename Qualified_result_of<typename BK::Construct_circular_source_vertex_2,Self>::type
|
||||
source() const
|
||||
{return typename BK::Construct_circular_source_vertex_2()(*this);}
|
||||
|
||||
typename Qualified_result_of<typename BK::Construct_circular_target_vertex_2,Self>::type
|
||||
target() const
|
||||
{return typename BK::Construct_circular_target_vertex_2()(*this);}
|
||||
|
||||
Line_2
|
||||
supporting_line() const
|
||||
{ return P_arc.supporting_line();}
|
||||
|
||||
Bbox_2 bbox() const
|
||||
{
|
||||
if(bb==NULL)
|
||||
bb=new Bbox_2(P_arc.bbox());
|
||||
return *bb;
|
||||
}
|
||||
|
||||
|
||||
///Specific check used for bbox construction///
|
||||
|
||||
bool has_no_bbox() const
|
||||
{ return (bb==NULL);}
|
||||
|
||||
bool equal_ref(const Line_arc_2 &c) const
|
||||
{
|
||||
return CGAL::identical(P_arc, c.P_arc);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Rline_arc_2 P_arc;
|
||||
mutable Bbox_2 *bb;
|
||||
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue