mirror of https://github.com/CGAL/cgal
use supporting_site for line/segment computations
This commit is contained in:
parent
45b2122c14
commit
eaa4a4c266
|
|
@ -642,7 +642,7 @@ public:
|
|||
|
||||
Line_2 l = compute_line_from_to(corner, displaced);
|
||||
|
||||
Line_2 lseg = compute_supporting_line(s);
|
||||
Line_2 lseg = compute_supporting_line(s.supporting_site());
|
||||
|
||||
RT hx, hy, hw;
|
||||
|
||||
|
|
@ -749,7 +749,7 @@ public:
|
|||
|
||||
Line_2 l = compute_line_from_to(corner, displaced);
|
||||
|
||||
Line_2 lseg = compute_supporting_line(s);
|
||||
Line_2 lseg = compute_supporting_line(s.supporting_site());
|
||||
|
||||
RT hx, hy, hw;
|
||||
|
||||
|
|
@ -857,7 +857,7 @@ public:
|
|||
Sign dxs = CGAL::sign(strg.x() - ssrc.x());
|
||||
Sign dys = CGAL::sign(strg.y() - ssrc.y());
|
||||
|
||||
Line_2 lseg = compute_supporting_line(s);
|
||||
Line_2 lseg = compute_supporting_line(s.supporting_site());
|
||||
Oriented_side os_lseg_p = oriented_side_of_line(lseg, pp);
|
||||
|
||||
CGAL_assertion( os_lseg_p != ON_ORIENTED_BOUNDARY );
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace CGAL {
|
|||
namespace SegmentDelaunayGraphLinf_2 {
|
||||
|
||||
template< class K >
|
||||
class Bisector_Linf
|
||||
class Bisector_Linf
|
||||
{
|
||||
|
||||
public:
|
||||
|
|
@ -28,7 +28,7 @@ private:
|
|||
typedef typename K::FT FT;
|
||||
typedef typename K::RT RT;
|
||||
|
||||
typedef typename K::Line_2 Full_Line_2;
|
||||
typedef typename K::Line_2 Full_Line_2;
|
||||
typedef typename K::Point_2 Point_2;
|
||||
typedef typename K::Direction_2 Direction_2;
|
||||
typedef typename K::Vector_2 Vector_2;
|
||||
|
|
@ -146,19 +146,19 @@ private:
|
|||
|
||||
CGAL_SDG_DEBUG(std::cout << "bisector_PS entering with p=" << p
|
||||
<< " q=" << q << std::endl;);
|
||||
|
||||
|
||||
CGAL_assertion(p.is_point() and q.is_segment());
|
||||
Point_2 pnt = p.point();
|
||||
Segment_2 seg = q.segment();
|
||||
Full_Line_2 lseg = seg.supporting_line();
|
||||
|
||||
Full_Line_2 lseg = q.supporting_site().segment().supporting_line();
|
||||
|
||||
Are_same_points_2 same_points;
|
||||
Compare_x_2 compare_x_2;
|
||||
Compare_y_2 compare_y_2;
|
||||
|
||||
if (same_points(p,q.source_site()) or
|
||||
|
||||
if (same_points(p,q.source_site()) or
|
||||
same_points(p,q.target_site())) {
|
||||
//p must be one of the end point of segment q,
|
||||
//p must be one of the end point of segment q,
|
||||
//and the bisector is a line passing through p
|
||||
Point_2 points[1];
|
||||
unsigned int npts = 1;
|
||||
|
|
@ -188,7 +188,7 @@ private:
|
|||
Point_2 points[3];
|
||||
unsigned int npts;
|
||||
// segment site is horizontal
|
||||
if (seg.is_horizontal()) {
|
||||
if (q.supporting_site().segment().is_horizontal()) {
|
||||
//pver is vertical projection from point site on to segment site
|
||||
Point_2 pver;
|
||||
pver = Point_2(pnt.x(), lseg.y_at_x(pnt.x()));
|
||||
|
|
@ -227,7 +227,7 @@ private:
|
|||
|
||||
return pcl;
|
||||
}//end of horizontal segment case
|
||||
else if(seg.is_vertical()){
|
||||
else if(q.supporting_site().segment().is_vertical()){
|
||||
//segment site is vertical
|
||||
// phor is the projection of pnt on seg
|
||||
Point_2 phor;
|
||||
|
|
@ -393,8 +393,8 @@ private:
|
|||
Are_parallel_2 are_parallel;
|
||||
|
||||
// compute supporting lines of segments
|
||||
Full_Line_2 lp ( p.segment() );
|
||||
Full_Line_2 lq ( q.segment() );
|
||||
Full_Line_2 lp ( p.supporting_site().segment() );
|
||||
Full_Line_2 lq ( q.supporting_site().segment() );
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "bisector_SS lp = "
|
||||
<< lp.a() << ' ' << lp.b() << ' ' << lp.c() << std::endl;);
|
||||
|
|
|
|||
|
|
@ -259,70 +259,73 @@ public:
|
|||
|
||||
Point_2 points[3];
|
||||
unsigned int npts;
|
||||
|
||||
|
||||
Compare_x_2 compare_x_2;
|
||||
Compare_y_2 compare_y_2;
|
||||
Equal_2 are_same_points;
|
||||
|
||||
Equal_2 are_same_points;
|
||||
|
||||
if (are_same_points(sitep,sites.source_site())
|
||||
or are_same_points(sitep,sites.target_site())) {
|
||||
npts = 1;
|
||||
npts = 1;
|
||||
points[0] = pnt;
|
||||
Point_2 pseg = (are_same_points(sitep,sites.source_site())) ? seg.target() : seg.source();
|
||||
|
||||
Point_2 pseg = (are_same_points(sitep,sites.source_site())) ?
|
||||
seg.target() : seg.source();
|
||||
|
||||
Comparison_result cmpx = compare_x_2(pnt, pseg);
|
||||
Comparison_result cmpy = compare_y_2(pnt, pseg);
|
||||
|
||||
|
||||
Direction_2 d (
|
||||
(cmpy == EQUAL)? 0 :
|
||||
( cmpy == SMALLER )? +1 : -1,
|
||||
(cmpx == EQUAL)? 0 :
|
||||
(cmpy == EQUAL)? 0 :
|
||||
( cmpy == SMALLER )? +1 : -1,
|
||||
(cmpx == EQUAL)? 0 :
|
||||
( cmpx == SMALLER )? -1 : +1);
|
||||
if (q.is_point()) {
|
||||
d = -d;
|
||||
}
|
||||
|
||||
|
||||
Polychainline pcl(-d, points, points+npts, d);
|
||||
return pcl;
|
||||
} else {
|
||||
// pnt is not end point of seg
|
||||
// seg must not be horizontal or vertical
|
||||
CGAL_assertion( not(seg.is_horizontal() or seg.is_vertical()) );
|
||||
Line_2 lseg = seg.supporting_line();
|
||||
Point_2 phor,pver;
|
||||
CGAL_assertion(
|
||||
not( sites.supporting_site().segment().is_horizontal() or
|
||||
sites.supporting_site().segment().is_vertical() ) );
|
||||
Line_2 lseg = sites.supporting_site().segment().supporting_line();
|
||||
Point_2 phor, pver;
|
||||
phor = Point_2(lseg.x_at_y(pnt.y()), pnt.y());
|
||||
pver = Point_2(pnt.x(), lseg.y_at_x(pnt.x()));
|
||||
pver = Point_2(pnt.x(), lseg.y_at_x(pnt.x()));
|
||||
//pfirst and plast are points on the supporting line of seg
|
||||
Point_2 pfirst, plast;
|
||||
//pcfirst and pclast are points on the bisector
|
||||
Point_2 pcfirst, pclast;
|
||||
// segment with positive slope will have pfirst as phor
|
||||
// segment with negative slope will have pfirst as pver
|
||||
pfirst = (compare_x_2(seg.source(),seg.target())
|
||||
== compare_y_2(seg.source(),seg.target()))
|
||||
pfirst = (compare_x_2(seg.source(),seg.target())
|
||||
== compare_y_2(seg.source(),seg.target()))
|
||||
? phor : pver;
|
||||
plast = (compare_x_2(seg.source(),seg.target())
|
||||
== compare_y_2(seg.source(),seg.target()))
|
||||
plast = (compare_x_2(seg.source(),seg.target())
|
||||
== compare_y_2(seg.source(),seg.target()))
|
||||
? pver : phor;
|
||||
|
||||
FT half = FT(0.5);
|
||||
|
||||
FT half = FT(0.5);
|
||||
Point_2 pmid_pfirst_pnt = midpoint(pfirst, pnt);
|
||||
Point_2 pmid_plast_pnt = midpoint(plast, pnt);
|
||||
FT seglenhalffirst ( half *
|
||||
CGAL::abs(
|
||||
CGAL::abs(pnt.x()-pfirst.x()) -
|
||||
CGAL::abs(pnt.x()-pfirst.x()) -
|
||||
CGAL::abs(pnt.y()-pfirst.y())) );
|
||||
FT seglenhalflast ( half *
|
||||
CGAL::abs(
|
||||
CGAL::abs(pnt.x()-plast.x()) -
|
||||
CGAL::abs(pnt.x()-plast.x()) -
|
||||
CGAL::abs(pnt.y()-plast.y())) );
|
||||
|
||||
if (compare_x_2(seg.source(),seg.target())
|
||||
|
||||
if (compare_x_2(seg.source(),seg.target())
|
||||
== compare_y_2(seg.source(),seg.target())) {
|
||||
//segment with positive slope
|
||||
if ( (compare_x_2(seg.source(),seg.target()) == SMALLER
|
||||
if ( (compare_x_2(seg.source(),seg.target()) == SMALLER
|
||||
and lseg.has_on_positive_side(pnt))
|
||||
or (compare_x_2(seg.source(),seg.target()) == LARGER
|
||||
or (compare_x_2(seg.source(),seg.target()) == LARGER
|
||||
and lseg.has_on_negative_side(pnt)) ) {
|
||||
//pcfirst is center of square , pfirst = phor, upward direction
|
||||
//pclast is center of sqaure, plast = pver, left direction
|
||||
|
|
@ -578,13 +581,15 @@ public:
|
|||
} else {
|
||||
// pnt is not end point of seg
|
||||
// seg must not be horizontal or vertical
|
||||
CGAL_assertion( not(seg.is_horizontal() or seg.is_vertical()) );
|
||||
CGAL_assertion(
|
||||
not( sites.supporting_site().segment().is_horizontal() or
|
||||
sites.supporting_site().segment().is_vertical() ) );
|
||||
// bisector ray always starts with v
|
||||
points[0] = v;
|
||||
Line_2 lseg = seg.supporting_line();
|
||||
Point_2 phor,pver;
|
||||
Line_2 lseg = sites.supporting_site().segment().supporting_line();
|
||||
Point_2 phor, pver;
|
||||
phor = Point_2(lseg.x_at_y(pnt.y()), pnt.y());
|
||||
pver = Point_2(pnt.x(), lseg.y_at_x(pnt.x()));
|
||||
pver = Point_2(pnt.x(), lseg.y_at_x(pnt.x()));
|
||||
//pfirst and plast are points on the supporting line of seg
|
||||
Point_2 pfirst, plast;
|
||||
//pcfirst and pclast are points on the bisector
|
||||
|
|
@ -790,13 +795,14 @@ public:
|
|||
points[1] = vqps;
|
||||
Polychainsegment pcs(points, points+2);
|
||||
|
||||
CGAL_SDG_DEBUG( std::cout << "debug construct bisector segment is (trivial) "
|
||||
<< pcs << std::endl; );
|
||||
CGAL_SDG_DEBUG( std::cout
|
||||
<< "debug construct bisector segment is (trivial) "
|
||||
<< pcs << std::endl; );
|
||||
return pcs;
|
||||
}
|
||||
|
||||
if ( p.is_point() and q.is_point() ) {
|
||||
Point_2 pp = p.point();
|
||||
if ( p.is_point() and q.is_point() ) {
|
||||
Point_2 pp = p.point();
|
||||
Point_2 pq = q.point();
|
||||
|
||||
CGAL_assertion( not (are_same_points(p, q)) );
|
||||
|
|
@ -894,10 +900,10 @@ public:
|
|||
|
||||
//CGAL_SDG_DEBUG( std::cout << "debug construct bisector segment is "
|
||||
// << pcs << std::endl; );
|
||||
|
||||
|
||||
return pcs;
|
||||
} // end of two points case
|
||||
else if ( (p.is_point() and q.is_segment()) or
|
||||
else if ( (p.is_point() and q.is_segment()) or
|
||||
(q.is_point() and p.is_segment()) ) {
|
||||
//one site is point and one site is segment
|
||||
unsigned int npts;
|
||||
|
|
@ -906,37 +912,39 @@ public:
|
|||
Equal_2 are_same_points;
|
||||
// check if p is point and is an endpoint of q
|
||||
// or if q is a point and is an end point of p
|
||||
if ( (p.is_point() and
|
||||
(are_same_points(p, q.source_site())or
|
||||
are_same_points(p, q.target_site())))
|
||||
or(q.is_point() and
|
||||
(are_same_points(q, p.source_site())or
|
||||
are_same_points(q, p.target_site()))) )
|
||||
if ( ( p.is_point() and
|
||||
(are_same_points(p, q.source_site()) or
|
||||
are_same_points(p, q.target_site()) ) )
|
||||
or (q.is_point() and
|
||||
(are_same_points(q, p.source_site()) or
|
||||
are_same_points(q, p.target_site()) ) ) )
|
||||
{
|
||||
npts = 2;
|
||||
}
|
||||
else {
|
||||
//pnt is the point site and seg is the segment site
|
||||
Point_2 pnt = (p.is_point()) ? p.point() : q.point();
|
||||
Point_2 pnt = (p.is_point()) ? p.point() : q.point();
|
||||
Segment_2 seg = (p.is_segment()) ? p.segment() : q.segment();
|
||||
Site_2 sitepnt = (p.is_point()) ? p : q;
|
||||
Site_2 siteseg = (p.is_point()) ? q : p;
|
||||
// lseg is the suporting line of the segment site
|
||||
Line_2 lseg = seg.supporting_line();
|
||||
Line_2 lseg = siteseg.supporting_site().segment().supporting_line();
|
||||
// segment site is horizontal
|
||||
if (seg.is_horizontal()) {
|
||||
if (lseg.is_horizontal()) {
|
||||
//pver is vertical projection from point site on to segment site
|
||||
Point_2 pver;
|
||||
pver = Point_2(pnt.x(), lseg.y_at_x(pnt.x()));
|
||||
|
||||
pver = Point_2(pnt.x(), lseg.y_at_x(pnt.x()));
|
||||
|
||||
Point_2 m = midpoint(pnt, pver);
|
||||
FT half = FT(0.5);
|
||||
FT seglenhalf ( half * CGAL::abs(pnt.y()-pver.y()) );
|
||||
|
||||
|
||||
//positive side is left-turn
|
||||
if (lseg.has_on_positive_side(pnt)) {
|
||||
points[1]= (compare_x_2(seg.source(),seg.target())==SMALLER)
|
||||
points[1]= (compare_x_2(seg.source(),seg.target())==SMALLER)
|
||||
? Point_2(m.x() + seglenhalf, m.y())
|
||||
: Point_2(m.x() - seglenhalf, m.y());
|
||||
points[2]= (compare_x_2(seg.source(),seg.target())==SMALLER)
|
||||
points[2]= (compare_x_2(seg.source(),seg.target())==SMALLER)
|
||||
? Point_2(m.x() - seglenhalf, m.y())
|
||||
: Point_2(m.x() + seglenhalf, m.y());
|
||||
} else {//pnt is on the negative side of lseg i.e right turn
|
||||
|
|
@ -981,7 +989,7 @@ public:
|
|||
CGAL_SDG_DEBUG( std::cout << "sandeep debug after cutting points,npts = "
|
||||
<< npts << std::endl; );
|
||||
}//end of horizontal segment case
|
||||
else if(seg.is_vertical()){
|
||||
else if (lseg.is_vertical()) {
|
||||
//segment site is vertical
|
||||
// phor is the projection of pnt on seg
|
||||
Point_2 phor;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,6 @@ private:
|
|||
{
|
||||
CGAL_precondition( t.is_point() );
|
||||
|
||||
// Line_2 lq = compute_supporting_line(q);
|
||||
Line_2 lq = compute_supporting_line(q.supporting_site());
|
||||
|
||||
Comparison_result res =
|
||||
|
|
@ -746,8 +745,9 @@ public:
|
|||
CGAL_SDG_DEBUG( std::cout << "debug fecf p is not endpoint of q"
|
||||
<< std::endl; );
|
||||
|
||||
CGAL_assertion( not ( q.segment().is_horizontal() or
|
||||
q.segment().is_vertical() ) ) ;
|
||||
CGAL_assertion(
|
||||
not ( q.supporting_site().segment().is_horizontal() or
|
||||
q.supporting_site().segment().is_vertical() ) ) ;
|
||||
|
||||
Line_2 lseg = compute_supporting_line(q.supporting_site());
|
||||
|
||||
|
|
@ -832,8 +832,9 @@ public:
|
|||
<< sgn << " returns " << false << std::endl; );
|
||||
return false;
|
||||
} else { // q is not endpoint of p
|
||||
CGAL_assertion( not ( p.segment().is_horizontal() or
|
||||
p.segment().is_vertical() ) ) ;
|
||||
CGAL_assertion(
|
||||
not ( p.supporting_site().segment().is_horizontal() or
|
||||
p.supporting_site().segment().is_vertical() ) ) ;
|
||||
|
||||
Line_2 lseg = compute_supporting_line(p.supporting_site());
|
||||
|
||||
|
|
@ -1021,8 +1022,10 @@ public:
|
|||
|
||||
if ( p.is_segment() or q.is_segment() ) {
|
||||
Segment_2 seg = (p.is_point())? q.segment(): p.segment();
|
||||
Site_2 siteseg = (p.is_point())? q: p;
|
||||
|
||||
if (seg.is_horizontal() or seg.is_vertical()) {
|
||||
if (siteseg.supporting_site().segment().is_horizontal() or
|
||||
siteseg.supporting_site().segment().is_vertical() ) {
|
||||
if (p.is_point()) {
|
||||
CGAL_assertion( same_points(p, q.source_site()) or
|
||||
same_points(p, q.target_site()) ) ;
|
||||
|
|
@ -1038,8 +1041,9 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
CGAL_assertion( not( seg.is_horizontal() or
|
||||
seg.is_vertical() ));
|
||||
CGAL_assertion(
|
||||
not( siteseg.supporting_site().segment().is_horizontal() or
|
||||
siteseg.supporting_site().segment().is_vertical() ));
|
||||
// t is segment
|
||||
if (t.is_segment()) {
|
||||
CGAL_assertion(sgn == NEGATIVE);
|
||||
|
|
|
|||
|
|
@ -86,10 +86,10 @@ public:
|
|||
} else {
|
||||
|
||||
// here q is point
|
||||
if ( not (t.segment().is_horizontal() or
|
||||
t.segment().is_vertical() ) ) {
|
||||
if ( not (t.supporting_site().segment().is_horizontal() or
|
||||
t.supporting_site().segment().is_vertical() ) ) {
|
||||
|
||||
Line_2 lt = compute_supporting_line(t);
|
||||
Line_2 lt = compute_supporting_line(t.supporting_site());
|
||||
|
||||
// Linf-project point q to line lt
|
||||
|
||||
|
|
@ -140,10 +140,10 @@ public:
|
|||
same_points(q, t.target_site()) ) );
|
||||
|
||||
// here q is point
|
||||
if ( not (t.segment().is_horizontal() or
|
||||
t.segment().is_vertical() ) ) {
|
||||
if ( not (t.supporting_site().segment().is_horizontal() or
|
||||
t.supporting_site().segment().is_vertical() ) ) {
|
||||
|
||||
Line_2 lt = compute_supporting_line(t);
|
||||
Line_2 lt = compute_supporting_line(t.supporting_site());
|
||||
|
||||
// Linf-project point q to line lt
|
||||
|
||||
|
|
@ -158,11 +158,11 @@ public:
|
|||
} else {
|
||||
// s is segment
|
||||
CGAL_assertion(
|
||||
not (s.segment().is_horizontal() or
|
||||
s.segment().is_vertical() ) );
|
||||
not (s.supporting_site().segment().is_horizontal() or
|
||||
s.supporting_site().segment().is_vertical() ) );
|
||||
|
||||
Direction_2 d (s.segment());
|
||||
Line_2 ls = compute_supporting_line(s);
|
||||
Direction_2 d (s.supporting_site().segment());
|
||||
Line_2 ls = compute_supporting_line(s.supporting_site());
|
||||
if (CGAL::sign(d.dx()) == CGAL::sign(d.dy())) {
|
||||
srep = compute_horizontal_projection(
|
||||
ls, q.point());
|
||||
|
|
@ -180,11 +180,11 @@ public:
|
|||
} else {
|
||||
// r is segment
|
||||
CGAL_assertion(
|
||||
not (r.segment().is_horizontal() or
|
||||
r.segment().is_vertical() ) );
|
||||
not (r.supporting_site().segment().is_horizontal() or
|
||||
r.supporting_site().segment().is_vertical() ) );
|
||||
|
||||
Direction_2 d (r.segment());
|
||||
Line_2 lr = compute_supporting_line(r);
|
||||
Direction_2 d (r.supporting_site().segment());
|
||||
Line_2 lr = compute_supporting_line(r.supporting_site());
|
||||
if (CGAL::sign(d.dx()) == CGAL::sign(d.dy())) {
|
||||
rrep = compute_vertical_projection(
|
||||
lr, q.point());
|
||||
|
|
@ -257,7 +257,8 @@ public:
|
|||
// (this has to be checked)
|
||||
CGAL_assertion(s.is_point() and r.is_point());
|
||||
|
||||
if (q.segment().is_horizontal() or q.segment().is_vertical())
|
||||
if (q.supporting_site().segment().is_horizontal() or
|
||||
q.supporting_site().segment().is_vertical() )
|
||||
{
|
||||
// in this case r and s must be endpoints of q
|
||||
CGAL_SDG_DEBUG(
|
||||
|
|
@ -300,7 +301,7 @@ public:
|
|||
is_conflicting_side_of_q = true;
|
||||
}
|
||||
} else {
|
||||
l = compute_supporting_line(q);
|
||||
l = compute_supporting_line(q.supporting_site());
|
||||
Oriented_side sidelt =
|
||||
oriented_side_of_line(l, t.point());
|
||||
if (is_s_endp_of_q) {
|
||||
|
|
@ -479,15 +480,16 @@ public:
|
|||
|
||||
CGAL_assertion(sgn == NEGATIVE);
|
||||
|
||||
CGAL_assertion(not (s.segment().is_horizontal() or
|
||||
s.segment().is_vertical() ));
|
||||
CGAL_assertion(
|
||||
not (s.supporting_site().segment().is_horizontal() or
|
||||
s.supporting_site().segment().is_vertical() ));
|
||||
|
||||
// compute infinite square with corner at q
|
||||
// and with center at infinity at
|
||||
// direction SE, NE, NW, or SW;
|
||||
// the direction goes from segment s to point q
|
||||
|
||||
Line_2 l = compute_supporting_line(s);
|
||||
Line_2 l = compute_supporting_line(s.supporting_site());
|
||||
|
||||
Point_2 phor =
|
||||
compute_horizontal_projection(l, q.point());
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public:
|
|||
CGAL_precondition( q.is_point() );
|
||||
CGAL_precondition( s.is_segment() && p.is_point() );
|
||||
|
||||
Line_2 l = compute_supporting_line( s );
|
||||
Line_2 l = compute_supporting_line( s.supporting_site() );
|
||||
Line_2 lp = compute_linf_perpendicular(l, p.point());
|
||||
|
||||
Oriented_side retval = lp.oriented_side(q.point());
|
||||
|
|
@ -83,7 +83,7 @@ public:
|
|||
CGAL_precondition( s.is_segment() && p.is_point() );
|
||||
|
||||
Voronoi_vertex_2 v(s1, s2, s3);
|
||||
Line_2 l = compute_supporting_line( s );
|
||||
Line_2 l = compute_supporting_line( s.supporting_site() );
|
||||
Line_2 lp = compute_linf_perpendicular(l, p.point());
|
||||
|
||||
Oriented_side retval = v.oriented_side(lp);
|
||||
|
|
@ -106,7 +106,7 @@ public:
|
|||
{
|
||||
CGAL_precondition( s.is_segment() and p.is_point() );
|
||||
|
||||
Line_2 lseg = compute_supporting_line( s );
|
||||
Line_2 lseg = compute_supporting_line( s.supporting_site() );
|
||||
Line_2 lp = compute_linf_perpendicular(lseg, p.point());
|
||||
bool has_lseg_neg_slope;
|
||||
|
||||
|
|
@ -143,10 +143,10 @@ public:
|
|||
// which is the linf projection
|
||||
|
||||
CGAL_assertion(
|
||||
s1.segment().is_horizontal() or
|
||||
s1.segment().is_vertical() or
|
||||
s2.segment().is_horizontal() or
|
||||
s2.segment().is_vertical() );
|
||||
s1.supporting_site().segment().is_horizontal() or
|
||||
s1.supporting_site().segment().is_vertical() or
|
||||
s2.supporting_site().segment().is_horizontal() or
|
||||
s2.supporting_site().segment().is_vertical() );
|
||||
|
||||
if (same_points(s1.source_site(), s2.source_site()) or
|
||||
same_points(s1.source_site(), s2.target_site()) ) {
|
||||
|
|
@ -180,8 +180,9 @@ public:
|
|||
<< "case of s1/s2 no endpoint relation"
|
||||
<< std::endl;);
|
||||
|
||||
CGAL_assertion(not (s.segment().is_horizontal() or
|
||||
s.segment().is_vertical() ) );
|
||||
CGAL_assertion(
|
||||
not (s.supporting_site().segment().is_horizontal() or
|
||||
s.supporting_site().segment().is_vertical() ) );
|
||||
|
||||
has_lseg_neg_slope =
|
||||
CGAL::sign(lseg.a()) == CGAL::sign(lseg.b());
|
||||
|
|
|
|||
|
|
@ -355,17 +355,17 @@ private:
|
|||
|
||||
CGAL_assertion( p.is_point() || q.is_point() );
|
||||
|
||||
CGAL_SDG_DEBUG( std::cout << "debug incircle_p of p=" << p
|
||||
<< " q=" << q << " t=" << t << std::endl; );
|
||||
CGAL_SDG_DEBUG( std::cout << "debug incircle_p of p=" << p
|
||||
<< " q=" << q << " t=" << t << std::endl; );
|
||||
|
||||
// philaris: here, for Linf there are differences from L2
|
||||
|
||||
if ((q.is_segment() and
|
||||
(q.segment().is_horizontal() or
|
||||
q.segment().is_vertical())) or
|
||||
(p.is_segment() and
|
||||
(p.segment().is_horizontal() or
|
||||
p.segment().is_vertical())) ) {
|
||||
if ((q.is_segment() and
|
||||
(q.supporting_site().segment().is_horizontal() or
|
||||
q.supporting_site().segment().is_vertical())) or
|
||||
(p.is_segment() and
|
||||
(p.supporting_site().segment().is_horizontal() or
|
||||
p.supporting_site().segment().is_vertical())) ) {
|
||||
// the case of horizontal or vertical segment is the same
|
||||
// as in L2
|
||||
Orientation o;
|
||||
|
|
@ -391,16 +391,17 @@ private:
|
|||
// here the segment is neither horizontal nor vertical
|
||||
if ( p.is_point() && q.is_segment() ) {
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p: p point, q segment"
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p: p point, q segment"
|
||||
<< std::endl; );
|
||||
|
||||
Point_2 pnt = p.point();
|
||||
Segment_2 seg = q.segment();
|
||||
Line_2 l = compute_supporting_line(q.supporting_site());
|
||||
|
||||
// compute slope of segment q
|
||||
Comparison_result cmpxsegpts =
|
||||
// compute slope of segment q
|
||||
Comparison_result cmpxsegpts =
|
||||
cmpx(seg.target(), seg.source());
|
||||
Comparison_result cmpysegpts =
|
||||
Comparison_result cmpysegpts =
|
||||
cmpy(seg.target(), seg.source());
|
||||
|
||||
CGAL_assertion((cmpxsegpts != EQUAL) and
|
||||
|
|
@ -411,16 +412,15 @@ private:
|
|||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p: q has " <<
|
||||
(is_positive_slope ? "positive" : "negative") <<
|
||||
" slope" << std::endl; );
|
||||
" slope" << std::endl; );
|
||||
|
||||
Line_2 l = compute_supporting_line(q);
|
||||
|
||||
Oriented_side side_of_pnt =
|
||||
Oriented_side side_of_pnt =
|
||||
oriented_side_of_line(l, pnt);
|
||||
|
||||
if (side_of_pnt == ON_ORIENTED_BOUNDARY) {
|
||||
CGAL_assertion(same_points(q.source_site(), p) or
|
||||
same_points(q.target_site(), p) );
|
||||
same_points(q.target_site(), p) );
|
||||
} else {
|
||||
// here, side_of_pnt is non-zero
|
||||
Oriented_side side_of_t = oriented_side_of_line(l, t.point());
|
||||
|
|
@ -448,12 +448,12 @@ private:
|
|||
}
|
||||
|
||||
lhor = compute_horizontal_side_line(
|
||||
pnt, otherpnt,
|
||||
pnt, otherpnt,
|
||||
is_positive_slope ?
|
||||
ON_NEGATIVE_SIDE : ON_POSITIVE_SIDE );
|
||||
lver = compute_vertical_side_line(
|
||||
pnt, otherpnt,
|
||||
is_positive_slope ?
|
||||
pnt, otherpnt,
|
||||
is_positive_slope ?
|
||||
ON_POSITIVE_SIDE : ON_NEGATIVE_SIDE);
|
||||
} else {
|
||||
// here point p is not on segment q
|
||||
|
|
@ -509,47 +509,49 @@ private:
|
|||
// philaris: negative means conflict
|
||||
// positive means no conflict
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "CGAL_SDG_DEBUG: debug incircle_p lhor=("
|
||||
<< lhor.a() << " " << lhor.b() << " " << lhor.c()
|
||||
<< ") lver=("
|
||||
<< lver.a() << " " << lver.b() << " " << lver.c()
|
||||
<< ")" << std::endl ;);
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "CGAL_SDG_DEBUG: debug incircle_p lhor=("
|
||||
<< lhor.a() << " " << lhor.b() << " " << lhor.c()
|
||||
<< ") lver=("
|
||||
<< lver.a() << " " << lver.b() << " " << lver.c()
|
||||
<< ")" << std::endl ;);
|
||||
|
||||
Oriented_side osh =
|
||||
Oriented_side osh =
|
||||
oriented_side_of_line(lhor, t.point());
|
||||
|
||||
Oriented_side osv =
|
||||
Oriented_side osv =
|
||||
oriented_side_of_line(lver, t.point());
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p osh=" << osh
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p osh=" << osh
|
||||
<< " osv=" << osv << std::endl; );
|
||||
|
||||
if ((osh !=
|
||||
if ((osh !=
|
||||
ON_NEGATIVE_SIDE) and
|
||||
(osv !=
|
||||
ON_NEGATIVE_SIDE))
|
||||
(osv !=
|
||||
ON_NEGATIVE_SIDE))
|
||||
{
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p about to return NEG"
|
||||
<< std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_p about to return NEG" << std::endl; );
|
||||
return NEGATIVE;
|
||||
} else {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p about to return POS"
|
||||
<< std::endl; );
|
||||
} else {
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_p about to return POS" << std::endl; );
|
||||
return POSITIVE;
|
||||
}
|
||||
|
||||
} else { // p is a segment and q is a point
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p: p segment, q point"
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p: p segment, q point"
|
||||
<< std::endl; );
|
||||
|
||||
Segment_2 seg = p.segment();
|
||||
Point_2 pnt = q.point();
|
||||
Line_2 l = compute_supporting_line(p.supporting_site());
|
||||
|
||||
// compute slope of segment p
|
||||
Comparison_result cmpxsegpts =
|
||||
// compute slope of segment p
|
||||
Comparison_result cmpxsegpts =
|
||||
cmpx(seg.target(), seg.source());
|
||||
Comparison_result cmpysegpts =
|
||||
Comparison_result cmpysegpts =
|
||||
cmpy(seg.target(), seg.source());
|
||||
|
||||
CGAL_assertion((cmpxsegpts != EQUAL) and
|
||||
|
|
@ -558,14 +560,12 @@ private:
|
|||
bool is_positive_slope = (cmpxsegpts == cmpysegpts);
|
||||
//bool is_negative_slope = (cmpxsegpts == -cmpysegpts);
|
||||
|
||||
Line_2 l = compute_supporting_line(p);
|
||||
|
||||
Oriented_side side_of_pnt =
|
||||
Oriented_side side_of_pnt =
|
||||
oriented_side_of_line(l, pnt);
|
||||
|
||||
if (side_of_pnt == ON_ORIENTED_BOUNDARY) {
|
||||
CGAL_assertion(same_points(p.source_site(), q) or
|
||||
same_points(p.target_site(), q) );
|
||||
same_points(p.target_site(), q) );
|
||||
} else {
|
||||
// here, side_of_pnt is non-zero
|
||||
Oriented_side side_of_t = oriented_side_of_line(l, t.point());
|
||||
|
|
@ -710,8 +710,8 @@ private:
|
|||
return NEGATIVE;
|
||||
} else {
|
||||
// here, neither p nor q is on t
|
||||
if (t.segment().is_horizontal() or
|
||||
t.segment().is_vertical()) {
|
||||
if (t.supporting_site().segment().is_horizontal() or
|
||||
t.supporting_site().segment().is_vertical()) {
|
||||
// here segment is horizontal or vertical;
|
||||
// there are similarities with L2 case here
|
||||
|
||||
|
|
@ -866,20 +866,20 @@ private:
|
|||
} else {
|
||||
// philaris: serious difference for Linf here, related to L2
|
||||
|
||||
if ( p.segment().is_horizontal() or
|
||||
p.segment().is_vertical() ) {
|
||||
if ( p.supporting_site().segment().is_horizontal() or
|
||||
p.supporting_site().segment().is_vertical() ) {
|
||||
return POSITIVE;
|
||||
} else {
|
||||
CGAL_assertion(not p.segment().is_horizontal());
|
||||
CGAL_assertion(not p.segment().is_vertical());
|
||||
CGAL_assertion(not p.supporting_site().segment().is_horizontal());
|
||||
CGAL_assertion(not p.supporting_site().segment().is_vertical());
|
||||
|
||||
Segment_2 seg = p.segment();
|
||||
Point_2 pnt = q.point();
|
||||
|
||||
// compute slope of segment p
|
||||
Comparison_result cmpxsegpts =
|
||||
// compute slope of segment p
|
||||
Comparison_result cmpxsegpts =
|
||||
cmpx(seg.target(), seg.source());
|
||||
Comparison_result cmpysegpts =
|
||||
Comparison_result cmpysegpts =
|
||||
cmpy(seg.target(), seg.source());
|
||||
|
||||
CGAL_assertion((cmpxsegpts != EQUAL) and
|
||||
|
|
@ -888,7 +888,7 @@ private:
|
|||
bool is_positive_slope = (cmpxsegpts == cmpysegpts);
|
||||
//bool is_negative_slope = (cmpxsegpts == -cmpysegpts);
|
||||
|
||||
Line_2 l = compute_supporting_line(p);
|
||||
Line_2 l = compute_supporting_line(p.supporting_site());
|
||||
|
||||
Oriented_side side_of_pnt =
|
||||
oriented_side_of_line(l, pnt);
|
||||
|
|
@ -965,28 +965,30 @@ private:
|
|||
} else {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps does not cross wedge, "
|
||||
<< "check for common endpoint of p and t"
|
||||
<< std::endl; );
|
||||
<< std::endl; );
|
||||
|
||||
bool is_psrc_tsrc =
|
||||
same_points(p.source_site(), t.source_site());
|
||||
bool is_psrc_ttrg =
|
||||
same_points(p.source_site(), t.target_site());
|
||||
bool is_ptrg_tsrc =
|
||||
same_points(p.target_site(), t.source_site());
|
||||
bool is_ptrg_ttrg =
|
||||
bool is_psrc_tsrc =
|
||||
same_points(p.source_site(), t.source_site());
|
||||
bool is_psrc_ttrg =
|
||||
same_points(p.source_site(), t.target_site());
|
||||
bool is_ptrg_tsrc =
|
||||
same_points(p.target_site(), t.source_site());
|
||||
bool is_ptrg_ttrg =
|
||||
same_points(p.target_site(), t.target_site());
|
||||
|
||||
Point_2 testp, otherp;
|
||||
|
||||
if (is_psrc_tsrc or is_ptrg_tsrc) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps tsrc endp of p"
|
||||
<< std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_sps tsrc endp of p"
|
||||
<< std::endl; );
|
||||
|
||||
if (same_points(q, t.target_site())) {
|
||||
if (t.segment().is_horizontal() or
|
||||
t.segment().is_vertical() ) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps horver-non seg comm"
|
||||
<< std::endl; );
|
||||
if (t.supporting_site().segment().is_horizontal() or
|
||||
t.supporting_site().segment().is_vertical() ) {
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_sps horver-non seg comm"
|
||||
<< std::endl; );
|
||||
return POSITIVE;
|
||||
}
|
||||
}
|
||||
|
|
@ -994,14 +996,16 @@ private:
|
|||
testp = t.source_site().point();
|
||||
otherp = t.target_site().point();
|
||||
} else if (is_psrc_ttrg or is_ptrg_ttrg) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps ttrg endp of p"
|
||||
<< std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_sps ttrg endp of p"
|
||||
<< std::endl; );
|
||||
|
||||
if (same_points(q, t.source_site())) {
|
||||
if (t.segment().is_horizontal() or
|
||||
t.segment().is_vertical() ) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps horver-non seg comm"
|
||||
<< std::endl; );
|
||||
if (t.supporting_site().segment().is_horizontal() or
|
||||
t.supporting_site().segment().is_vertical() ) {
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_sps horver-non seg comm"
|
||||
<< std::endl; );
|
||||
return POSITIVE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1010,7 +1014,7 @@ private:
|
|||
otherp = t.source_site().point();
|
||||
} else {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps fail endp, return POS"
|
||||
<< std::endl; );
|
||||
<< std::endl; );
|
||||
return POSITIVE;
|
||||
}
|
||||
|
||||
|
|
@ -1118,20 +1122,20 @@ private:
|
|||
} else {
|
||||
// philaris: serious difference for Linf here, related to L2
|
||||
|
||||
if ( q.segment().is_horizontal() or
|
||||
q.segment().is_vertical() ) {
|
||||
if ( q.supporting_site().segment().is_horizontal() or
|
||||
q.supporting_site().segment().is_vertical() ) {
|
||||
return POSITIVE;
|
||||
} else {
|
||||
CGAL_assertion(not q.segment().is_horizontal());
|
||||
CGAL_assertion(not q.segment().is_vertical());
|
||||
CGAL_assertion(not q.supporting_site().segment().is_horizontal());
|
||||
CGAL_assertion(not q.supporting_site().segment().is_vertical());
|
||||
|
||||
Point_2 pnt = p.point();
|
||||
Segment_2 seg = q.segment();
|
||||
|
||||
// compute slope of segment q
|
||||
Comparison_result cmpxsegpts =
|
||||
// compute slope of segment q
|
||||
Comparison_result cmpxsegpts =
|
||||
cmpx(seg.target(), seg.source());
|
||||
Comparison_result cmpysegpts =
|
||||
Comparison_result cmpysegpts =
|
||||
cmpy(seg.target(), seg.source());
|
||||
|
||||
CGAL_assertion((cmpxsegpts != EQUAL) and
|
||||
|
|
@ -1144,7 +1148,7 @@ private:
|
|||
(is_positive_slope ? "positive" : "negative") <<
|
||||
" slope" << std::endl; );
|
||||
|
||||
Line_2 l = compute_supporting_line(q);
|
||||
Line_2 l = compute_supporting_line(q.supporting_site());
|
||||
|
||||
Oriented_side side_of_pnt =
|
||||
oriented_side_of_line(l, pnt);
|
||||
|
|
@ -1234,14 +1238,15 @@ private:
|
|||
Point_2 testt, othert;
|
||||
|
||||
if (is_qsrc_tsrc or is_qtrg_tsrc) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_pss tsrc endp of q"
|
||||
<< std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_pss tsrc endp of q" << std::endl; );
|
||||
|
||||
if (same_points(p, t.target_site())) {
|
||||
if (t.segment().is_horizontal() or
|
||||
t.segment().is_vertical() ) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps horver-non seg comm"
|
||||
<< std::endl; );
|
||||
if (t.supporting_site().segment().is_horizontal() or
|
||||
t.supporting_site().segment().is_vertical() ) {
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_sps horver-non seg comm"
|
||||
<< std::endl; );
|
||||
return POSITIVE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1249,14 +1254,15 @@ private:
|
|||
testt = t.source_site().point();
|
||||
othert = t.target_site().point();
|
||||
} else if (is_qsrc_ttrg or is_qtrg_ttrg) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_pss ttrg endp of q"
|
||||
<< std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_pss ttrg endp of q" << std::endl; );
|
||||
|
||||
if (same_points(p, t.source_site())) {
|
||||
if (t.segment().is_horizontal() or
|
||||
t.segment().is_vertical() ) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_pss horver-non seg comm"
|
||||
<< std::endl; );
|
||||
if (t.supporting_site().segment().is_horizontal() or
|
||||
t.supporting_site().segment().is_vertical() ) {
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_pss horver-non seg comm"
|
||||
<< std::endl; );
|
||||
return POSITIVE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1264,19 +1270,20 @@ private:
|
|||
testt = t.target_site().point();
|
||||
othert = t.source_site().point();
|
||||
} else {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_pss fail endp, return POS"
|
||||
<< std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug incircle_pss fail endp, return POS"
|
||||
<< std::endl; );
|
||||
return POSITIVE;
|
||||
}
|
||||
|
||||
// here p and t have common endpoint testt
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug testt=" << testt
|
||||
CGAL_SDG_DEBUG(std::cout << "debug testt=" << testt
|
||||
<< " pnt_on_seg=" << pnt_on_seg << std::endl; );
|
||||
|
||||
// check if testp equals pnt_on_seg
|
||||
|
||||
if ((cmpx(testt, pnt_on_seg) == EQUAL ) and
|
||||
if ((cmpx(testt, pnt_on_seg) == EQUAL ) and
|
||||
(cmpy(testt, pnt_on_seg) == EQUAL ) ) {
|
||||
|
||||
// here testt is the same as pnt_on_seg
|
||||
|
|
|
|||
|
|
@ -556,7 +556,7 @@ private:
|
|||
|
||||
bool use_bqr;
|
||||
|
||||
Line_2 l = compute_supporting_line(r);
|
||||
Line_2 l = compute_supporting_line(r.supporting_site());
|
||||
|
||||
if (((CGAL::sign(l.a()) == ZERO) and sameypq) or
|
||||
((CGAL::sign(l.b()) == ZERO) and samexpq) ) {
|
||||
|
|
@ -1676,8 +1676,8 @@ private:
|
|||
<< numendpts_of_t << std::endl;);
|
||||
|
||||
if (numendpts_of_t > 0) {
|
||||
bool is_t_horizontal = t.segment().is_horizontal();
|
||||
bool is_t_vertical = t.segment().is_vertical();
|
||||
bool is_t_horizontal = t.supporting_site().segment().is_horizontal();
|
||||
bool is_t_vertical = t.supporting_site().segment().is_vertical();
|
||||
|
||||
if (is_t_horizontal or is_t_vertical) {
|
||||
CGAL_assertion(numendpts_of_t == 1);
|
||||
|
|
@ -1720,8 +1720,10 @@ private:
|
|||
CGAL_assertion(numothers < 2);
|
||||
|
||||
if (numothers == 1) {
|
||||
bool is_other_horizontal = other.segment().is_horizontal();
|
||||
bool is_other_vertical = other.segment().is_vertical();
|
||||
bool is_other_horizontal =
|
||||
other.supporting_site().segment().is_horizontal();
|
||||
bool is_other_vertical =
|
||||
other.supporting_site().segment().is_vertical();
|
||||
|
||||
if ((is_t_horizontal and is_other_horizontal) or
|
||||
(is_t_vertical and is_other_vertical) ) {
|
||||
|
|
@ -2105,26 +2107,29 @@ private:
|
|||
inline
|
||||
void
|
||||
compute_helper_two_seg(
|
||||
const Site_2& a, const Site_2& b,
|
||||
const Site_2& a, const Site_2& b,
|
||||
const Site_2& common_site, Site_2& other_of_seg)
|
||||
const
|
||||
{
|
||||
CGAL_assertion(a.is_segment());
|
||||
CGAL_assertion(b.is_segment());
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug compute_helper_two_seg entering with "
|
||||
<< a << " and " << b << " having common "
|
||||
<< common_site << std::endl;);
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug compute_helper_two_seg entering with "
|
||||
<< a << " and " << b << " having common "
|
||||
<< common_site << std::endl;);
|
||||
|
||||
if (a.segment().is_horizontal() or a.segment().is_vertical()) {
|
||||
if (a.supporting_site().segment().is_horizontal() or
|
||||
a.supporting_site().segment().is_vertical()) {
|
||||
if ( same_points(common_site, b.source_site()) ) {
|
||||
other_of_seg = b.target_site();
|
||||
} else {
|
||||
other_of_seg = b.source_site();
|
||||
}
|
||||
} else {
|
||||
CGAL_assertion(
|
||||
b.segment().is_horizontal() or b.segment().is_vertical() );
|
||||
CGAL_assertion(
|
||||
b.supporting_site().segment().is_horizontal() or
|
||||
b.supporting_site().segment().is_vertical() );
|
||||
|
||||
if ( same_points(common_site, a.source_site()) ) {
|
||||
other_of_seg = a.target_site();
|
||||
|
|
@ -2138,9 +2143,9 @@ private:
|
|||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Sign incircle_s(const Site_2& t) const
|
||||
|
||||
Sign incircle_s(const Site_2& t) const
|
||||
{
|
||||
CGAL_precondition( t.is_segment() );
|
||||
|
||||
|
|
|
|||
|
|
@ -1645,7 +1645,7 @@ private:
|
|||
// philaris: addition for Linf
|
||||
|
||||
if (is_endpoint_of(p, q)) {
|
||||
if (q.segment().is_horizontal()) {
|
||||
if (q.supporting_site().segment().is_horizontal()) {
|
||||
if (scmpy(p,t) == EQUAL) {
|
||||
Site_2 other =
|
||||
same_points(p, q.source_site()) ?
|
||||
|
|
@ -1655,7 +1655,7 @@ private:
|
|||
}
|
||||
}
|
||||
}
|
||||
if (q.segment().is_vertical()) {
|
||||
if (q.supporting_site().segment().is_vertical()) {
|
||||
if (scmpx(p,t) == EQUAL) {
|
||||
Site_2 other =
|
||||
same_points(p, q.source_site()) ?
|
||||
|
|
@ -1668,7 +1668,7 @@ private:
|
|||
}
|
||||
|
||||
if (is_endpoint_of(p, r)) {
|
||||
if (r.segment().is_horizontal()) {
|
||||
if (r.supporting_site().segment().is_horizontal()) {
|
||||
if (scmpy(p,t) == EQUAL) {
|
||||
Site_2 other =
|
||||
same_points(p, r.source_site()) ?
|
||||
|
|
@ -1678,7 +1678,7 @@ private:
|
|||
}
|
||||
}
|
||||
}
|
||||
if (r.segment().is_vertical()) {
|
||||
if (r.supporting_site().segment().is_vertical()) {
|
||||
if (scmpx(p,t) == EQUAL) {
|
||||
Site_2 other =
|
||||
same_points(p, r.source_site()) ?
|
||||
|
|
@ -1884,8 +1884,8 @@ private:
|
|||
<< numendpts_of_t << std::endl;);
|
||||
|
||||
if (numendpts_of_t > 0) {
|
||||
bool is_t_horizontal = t.segment().is_horizontal();
|
||||
bool is_t_vertical = t.segment().is_vertical();
|
||||
bool is_t_horizontal = t.supporting_site().segment().is_horizontal();
|
||||
bool is_t_vertical = t.supporting_site().segment().is_vertical();
|
||||
|
||||
if (is_t_horizontal or is_t_vertical) {
|
||||
CGAL_assertion(numendpts_of_t == 1);
|
||||
|
|
@ -1927,8 +1927,10 @@ private:
|
|||
CGAL_assertion(numothers < 2);
|
||||
|
||||
if (numothers == 1) {
|
||||
bool is_other_horizontal = other.segment().is_horizontal();
|
||||
bool is_other_vertical = other.segment().is_vertical();
|
||||
bool is_other_horizontal =
|
||||
other.supporting_site().segment().is_horizontal();
|
||||
bool is_other_vertical =
|
||||
other.supporting_site().segment().is_vertical();
|
||||
|
||||
if ((is_t_horizontal and is_other_horizontal) or
|
||||
(is_t_vertical and is_other_vertical) ) {
|
||||
|
|
@ -2352,33 +2354,36 @@ private:
|
|||
inline
|
||||
void
|
||||
compute_helper_two_seg(
|
||||
const Site_2& a, const Site_2& b,
|
||||
const Site_2& a, const Site_2& b,
|
||||
const Site_2& common_site, Site_2& other_of_seg)
|
||||
const
|
||||
{
|
||||
CGAL_assertion(a.is_segment());
|
||||
CGAL_assertion(b.is_segment());
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug compute_helper_two_seg entering with "
|
||||
<< a << " and " << b << " having common "
|
||||
<< common_site << std::endl;);
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug compute_helper_two_seg entering with "
|
||||
<< a << " and " << b << " having common "
|
||||
<< common_site << std::endl;);
|
||||
|
||||
if (a.segment().is_horizontal() or a.segment().is_vertical()) {
|
||||
if (a.supporting_site().segment().is_horizontal() or
|
||||
a.supporting_site().segment().is_vertical()) {
|
||||
if ( same_points(common_site, b.source_site()) ) {
|
||||
other_of_seg = b.target_site();
|
||||
} else {
|
||||
other_of_seg = b.source_site();
|
||||
}
|
||||
} else {
|
||||
CGAL_assertion(
|
||||
b.segment().is_horizontal() or b.segment().is_vertical() );
|
||||
CGAL_assertion(
|
||||
b.supporting_site().segment().is_horizontal() or
|
||||
b.supporting_site().segment().is_vertical() );
|
||||
|
||||
if ( same_points(common_site, a.source_site()) ) {
|
||||
other_of_seg = a.target_site();
|
||||
} else {
|
||||
other_of_seg = a.source_site();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // end of compute_helper_two_seg
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,6 @@ private:
|
|||
{
|
||||
CGAL_precondition( t.is_point() );
|
||||
|
||||
// Line_2 lq = compute_supporting_line(q);
|
||||
Line_2 lq = compute_supporting_line(q.supporting_site());
|
||||
|
||||
Comparison_result res =
|
||||
|
|
@ -878,24 +877,18 @@ public:
|
|||
CGAL_assertion( not ( p.is_segment() and q.is_segment()) );
|
||||
|
||||
if ( p.is_segment() or q.is_segment() ) {
|
||||
Segment_2 seg = (p.is_point())? q.segment(): p.segment();
|
||||
|
||||
if (seg.is_horizontal() or seg.is_vertical()) {
|
||||
if (p.is_point()) {
|
||||
CGAL_assertion( same_points(p, q.source_site()) or
|
||||
same_points(p, q.target_site()) ) ;
|
||||
} else {
|
||||
CGAL_assertion( same_points(q, p.source_site()) or
|
||||
same_points(q, p.target_site()) ) ;
|
||||
}
|
||||
CGAL_SDG_DEBUG(
|
||||
std::cout << "debug finite-edge-int-cf with (p,q,t,sgn)= "
|
||||
<< p << ' ' << q << ' ' << t << ' '
|
||||
<< "(sgn " << sgn << " not ignored)" << " returns "
|
||||
<< false << std::endl; );
|
||||
return false;
|
||||
if (p.is_point()) {
|
||||
CGAL_assertion( same_points(p, q.source_site()) or
|
||||
same_points(p, q.target_site()) ) ;
|
||||
} else {
|
||||
CGAL_assertion( same_points(q, p.source_site()) or
|
||||
same_points(q, p.target_site()) ) ;
|
||||
}
|
||||
|
||||
CGAL_SDG_DEBUG(
|
||||
std::cout << "debug finite-edge-int-cf with (p,q,t,sgn)= "
|
||||
<< p << ' ' << q << ' ' << t << ' '
|
||||
<< "(sgn " << sgn << " not ignored)" << " returns "
|
||||
<< false << std::endl; );
|
||||
return false;
|
||||
} // end of case: any of p, q is a segment
|
||||
|
||||
|
|
|
|||
|
|
@ -157,17 +157,14 @@ public:
|
|||
// (this has to be checked)
|
||||
CGAL_assertion(s.is_point() and r.is_point());
|
||||
|
||||
if (q.segment().is_horizontal() or q.segment().is_vertical())
|
||||
{
|
||||
// in this case r and s must be endpoints of q
|
||||
CGAL_SDG_DEBUG(
|
||||
std::cout
|
||||
<< "debug infinite-edge-int-cf with (q,s,r,t,sgn)= "
|
||||
<< q << ' ' << s << ' ' << r << ' ' << t
|
||||
<< ' ' << sgn << " returns "
|
||||
<< ( sgn == NEGATIVE ) << std::endl;);
|
||||
return ( sgn == NEGATIVE );
|
||||
}
|
||||
// in this case r and s must be endpoints of q
|
||||
CGAL_SDG_DEBUG(
|
||||
std::cout
|
||||
<< "debug infinite-edge-int-cf with (q,s,r,t,sgn)= "
|
||||
<< q << ' ' << s << ' ' << r << ' ' << t
|
||||
<< ' ' << sgn << " returns "
|
||||
<< ( sgn == NEGATIVE ) << std::endl;);
|
||||
return ( sgn == NEGATIVE );
|
||||
}
|
||||
|
||||
// here and below both q and t are points
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ private:
|
|||
Site_2 tp = Site_2::construct_site_2(p);
|
||||
|
||||
return ( same_points(support.source_site(), tp) ||
|
||||
same_points(support.target_site(), tp) );
|
||||
same_points(support.target_site(), tp) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ private:
|
|||
return (o == LEFT_TURN) ? POSITIVE : NEGATIVE;
|
||||
}
|
||||
|
||||
// here orientation Linf is degenerate
|
||||
// here orientation Linf is degenerate
|
||||
|
||||
// return NEGATIVE if t is strictly inside the bounding box
|
||||
// of p and q, otherwise return POSITIVE;
|
||||
|
|
@ -235,7 +235,7 @@ private:
|
|||
return (o == LEFT_TURN) ? POSITIVE : NEGATIVE;
|
||||
}
|
||||
|
||||
// here orientation Linf is degenerate
|
||||
// here orientation Linf is degenerate
|
||||
|
||||
// return NEGATIVE if t is strictly inside the bounding box
|
||||
// of p and q, otherwise return POSITIVE;
|
||||
|
|
@ -334,7 +334,7 @@ private:
|
|||
return (o == LEFT_TURN) ? POSITIVE : NEGATIVE;
|
||||
}
|
||||
|
||||
// here orientation Linf is degenerate
|
||||
// here orientation Linf is degenerate
|
||||
|
||||
// return NEGATIVE if t is strictly inside the bounding box
|
||||
// of p and q, otherwise return POSITIVE;
|
||||
|
|
@ -359,17 +359,17 @@ private:
|
|||
|
||||
CGAL_assertion( p.is_point() || q.is_point() );
|
||||
|
||||
CGAL_SDG_DEBUG( std::cout << "debug incircle_p of p=" << p
|
||||
<< " q=" << q << " t=" << t << std::endl; );
|
||||
CGAL_SDG_DEBUG( std::cout << "debug incircle_p of p=" << p
|
||||
<< " q=" << q << " t=" << t << std::endl; );
|
||||
|
||||
// philaris: here, for Linf there are differences from L2
|
||||
|
||||
if ((q.is_segment() and
|
||||
(q.segment().is_horizontal() or
|
||||
q.segment().is_vertical())) or
|
||||
(p.is_segment() and
|
||||
(p.segment().is_horizontal() or
|
||||
p.segment().is_vertical())) ) {
|
||||
if ((q.is_segment() and
|
||||
(q.supporting_site().segment().is_horizontal() or
|
||||
q.supporting_site().segment().is_vertical())) or
|
||||
(p.is_segment() and
|
||||
(p.supporting_site().segment().is_horizontal() or
|
||||
p.supporting_site().segment().is_vertical())) ) {
|
||||
// the case of horizontal or vertical segment is the same
|
||||
// as in L2
|
||||
Orientation o;
|
||||
|
|
@ -385,7 +385,7 @@ private:
|
|||
o = orientation_linf(pp, q.point(), t.point());
|
||||
}
|
||||
if ( CGAL::is_certain(o == RIGHT_TURN) ) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p about to return "
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_p about to return "
|
||||
<< (CGAL::get_certain( o == RIGHT_TURN ) ? NEGATIVE : POSITIVE)
|
||||
<< std::endl ;);
|
||||
return CGAL::get_certain( o == RIGHT_TURN ) ? NEGATIVE : POSITIVE;
|
||||
|
|
@ -394,15 +394,16 @@ private:
|
|||
}
|
||||
//Sandeep: Added to avoid compiler warning
|
||||
CGAL_assertion(false);
|
||||
CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p should not reach here "
|
||||
<< NEGATIVE
|
||||
<< std::endl ;);
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "sandeep: debug incircle_p should not reach here "
|
||||
<< NEGATIVE
|
||||
<< std::endl ;);
|
||||
return NEGATIVE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
// philaris: here Linf is very different from L2
|
||||
// philaris: here Linf is very different from L2
|
||||
Sign incircle_pps(const Site_2& p, const Site_2& q,
|
||||
const Site_2& t) const
|
||||
{
|
||||
|
|
@ -426,8 +427,8 @@ private:
|
|||
return NEGATIVE;
|
||||
} else {
|
||||
// here, neither p nor q is on t
|
||||
if (t.segment().is_horizontal() or
|
||||
t.segment().is_vertical()) {
|
||||
if (t.supporting_site().segment().is_horizontal() or
|
||||
t.supporting_site().segment().is_vertical()) {
|
||||
// here segment is horizontal or vertical;
|
||||
// there are similarities with L2 case here
|
||||
|
||||
|
|
@ -455,10 +456,10 @@ private:
|
|||
// decision procedure (see below).
|
||||
// since we insert endpoints of segments first, p and q cannot
|
||||
// be consecutive points on the convex hull, because of the
|
||||
// endpoints of t
|
||||
// endpoints of t
|
||||
return POSITIVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end of case where neither p nor q is on t
|
||||
//Sandeep: Added to avoid compiler warning
|
||||
CGAL_assertion(false);
|
||||
|
|
@ -489,7 +490,7 @@ private:
|
|||
|
||||
|
||||
if ( is_q_on_t and is_q_on_p) {
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps "
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps "
|
||||
<< "is_q_on_t and is_q_on_p" << std::endl; );
|
||||
|
||||
Point_2 pp = same_points(q, p.source_site()) ? p.target() : p.source();
|
||||
|
|
@ -497,8 +498,8 @@ private:
|
|||
|
||||
Orientation o = orientation_linf(pp, q.point(), pt);
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps or( "
|
||||
<< pp << ", " << q.point() << ", " << pt << " ) = "
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_sps or( "
|
||||
<< pp << ", " << q.point() << ", " << pt << " ) = "
|
||||
<< o << std::endl; );
|
||||
|
||||
if (o == DEGENERATE) {
|
||||
|
|
@ -534,10 +535,10 @@ private:
|
|||
} else {
|
||||
// philaris: serious difference for Linf here, related to L2
|
||||
|
||||
if ( p.segment().is_horizontal() or
|
||||
p.segment().is_vertical() ) {
|
||||
if ( p.supporting_site().segment().is_horizontal() or
|
||||
p.supporting_site().segment().is_vertical() ) {
|
||||
return POSITIVE;
|
||||
}
|
||||
}
|
||||
} // end of case where q is not on t
|
||||
//Sandeep: Added to avoid compiler warning
|
||||
CGAL_assertion(false);
|
||||
|
|
@ -568,7 +569,7 @@ private:
|
|||
|
||||
if ( is_p_on_t and is_p_on_q ) {
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_pss "
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_pss "
|
||||
<< "is_p_on_t and is_p_on_q" << std::endl; );
|
||||
|
||||
Point_2 pq = same_points(p, q.source_site()) ? q.target() : q.source();
|
||||
|
|
@ -604,18 +605,18 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_pss or( "
|
||||
<< p.point() << ", " << pq << ", " << pt << " ) = "
|
||||
<< o << std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout << "debug incircle_pss or( "
|
||||
<< p.point() << ", " << pq << ", " << pt << " ) = "
|
||||
<< o << std::endl; );
|
||||
|
||||
return (o == RIGHT_TURN) ? NEGATIVE : POSITIVE;
|
||||
} else {
|
||||
// philaris: serious difference for Linf here, related to L2
|
||||
|
||||
if ( q.segment().is_horizontal() or
|
||||
q.segment().is_vertical() ) {
|
||||
if ( q.supporting_site().segment().is_horizontal() or
|
||||
q.supporting_site().segment().is_vertical() ) {
|
||||
return POSITIVE;
|
||||
}
|
||||
}
|
||||
} // end of case where p is not on t
|
||||
//Sandeep: Added to avoid compiler warning
|
||||
CGAL_assertion(false);
|
||||
|
|
@ -650,10 +651,10 @@ public:
|
|||
const Site_2& r, const Site_2& t) const
|
||||
{
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug: Vertex_conflict entering (pqrt)= ("
|
||||
<< p << ") (" << q << ") ("
|
||||
<< r << ") (" << t << ")"
|
||||
<< std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug: Vertex_conflict entering (pqrt)= ("
|
||||
<< p << ") (" << q << ") (" << r << ") (" << t << ")"
|
||||
<< std::endl; );
|
||||
|
||||
|
||||
#ifdef CGAL_PROFILE
|
||||
|
|
@ -701,11 +702,11 @@ public:
|
|||
Sign s_alt = v_alt.incircle(t);
|
||||
|
||||
if ( s != s_alt ) {
|
||||
std::cerr << "different results" << std::endl; );
|
||||
std::cerr << p << std::endl; );
|
||||
std::cerr << q << std::endl; );
|
||||
std::cerr << r << std::endl; );
|
||||
std::cerr << t << std::endl; );
|
||||
std::cerr << "different results" << std::endl;
|
||||
std::cerr << p << std::endl;
|
||||
std::cerr << q << std::endl;
|
||||
std::cerr << r << std::endl;
|
||||
std::cerr << t << std::endl;
|
||||
CGAL_assertion( s == s_alt );
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -715,22 +716,22 @@ public:
|
|||
Voronoi_vertex_2 v(p, q, r);
|
||||
|
||||
Point_2 temppt = v.point();
|
||||
CGAL_SDG_DEBUG(std::cout << "debug Voronoi_vertex_2 v=" << temppt << std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug Voronoi_vertex_2 v=" << temppt << std::endl; );
|
||||
|
||||
Sign retval = v.incircle(t);
|
||||
|
||||
CGAL_SDG_DEBUG(std::cout << "debug: Vertex_conflict (pqrt)= ("
|
||||
<< p << ") (" << q << ") ("
|
||||
<< r << ") (" << t << ") returns " << retval
|
||||
<< std::endl; );
|
||||
CGAL_SDG_DEBUG(std::cout
|
||||
<< "debug: Vertex_conflict (pqrt)= ("
|
||||
<< p << ") (" << q << ") ("
|
||||
<< r << ") (" << t << ") returns " << retval
|
||||
<< std::endl; );
|
||||
|
||||
return retval;
|
||||
#endif // CGAL_SDG_CHECK_INCIRCLE_CONSISTENCY
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Sign operator()(const Site_2& p, const Site_2& q,
|
||||
const Site_2& t) const
|
||||
{
|
||||
|
|
@ -773,7 +774,7 @@ public:
|
|||
if ( t.is_point() ) {
|
||||
// return incircle_p(p, q, t);
|
||||
retval = incircle_p(q, p, t);
|
||||
} else {
|
||||
} else {
|
||||
// MK::ERROR: do geometric filtering when orientation is called.
|
||||
// return incircle_s(p, q, t);
|
||||
retval = incircle_s(q, p, t);
|
||||
|
|
|
|||
Loading…
Reference in New Issue