fix of pss ring with points_inside_touching_sides

Change of function point_inside_touching_sides (renamed
to points_inside_touching_sides) in order to process correctly
inputs like br80.cin:
s       10      120     60      20
s       60      40      70      60
s       30      110     100     40

(segments AB, CD, EF, respectively)

The incircle predicate (CD, B, F, EF) returns 0.

Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This commit is contained in:
Panagiotis Cheilaris 2014-05-19 14:34:08 +02:00
parent 25952ab183
commit d53af0382a
1 changed files with 16 additions and 7 deletions

View File

@ -1471,7 +1471,7 @@ private:
CGAL_SDG_DEBUG(std::cout CGAL_SDG_DEBUG(std::cout
<< "debug vring non-hv s1=" << s1 << "debug vring non-hv s1=" << s1
<< std::endl;); << std::endl;);
if (point_inside_touching_sides(st, s1)) { if (points_inside_touching_sides(s1, pt_site, s2, st)) {
return NEGATIVE; return NEGATIVE;
} }
} }
@ -1482,7 +1482,7 @@ private:
CGAL_SDG_DEBUG(std::cout CGAL_SDG_DEBUG(std::cout
<< "debug vring non-hv s2=" << s2 << "debug vring non-hv s2=" << s2
<< std::endl;); << std::endl;);
if (point_inside_touching_sides(st, s2)) { if (points_inside_touching_sides(s2, pt_site, s1, st)) {
return NEGATIVE; return NEGATIVE;
} }
} }
@ -3276,12 +3276,18 @@ public:
private: private:
inline inline
bool point_inside_touching_sides(const Site_2 & t, const Site_2 & s) bool points_inside_touching_sides(
const Site_2 & s, const Site_2 & pt_site,
const Site_2 & other_seg, const Site_2 & t)
const const
{ {
CGAL_assertion(not is_site_h_or_v(s)); CGAL_assertion(not is_site_h_or_v(s));
CGAL_assertion(t.is_point()); CGAL_assertion(t.is_point());
CGAL_assertion(s.is_segment()); CGAL_assertion(s.is_segment());
if ((not is_site_h_or_v(other_seg)) and
is_endpoint_of(pt_site, other_seg)) {
return false;
}
Line_2 ls = compute_supporting_line(s.supporting_site()); Line_2 ls = compute_supporting_line(s.supporting_site());
Point_2 v(ux_,uy_,uz_); Point_2 v(ux_,uy_,uz_);
Point_2 corner = Point_2 corner =
@ -3294,12 +3300,15 @@ private:
} }
Oriented_side ost = oriented_side_of_line(ltest, t.point()); Oriented_side ost = oriented_side_of_line(ltest, t.point());
Oriented_side osx = oriented_side_of_line(ltest, corner); Oriented_side osx = oriented_side_of_line(ltest, corner);
CGAL_assertion(scmpx(t, pt_site) != EQUAL);
CGAL_assertion(scmpy(t, pt_site) != EQUAL);
if (ost == osx) { if (ost == osx) {
return true; Oriented_side osp = oriented_side_of_line(ltest, pt_site.point());
} if (ost == osp) {
else { return true;
return false; }
} }
return false;
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------