simplification and fix of drawing a bis seg

This fixes a drawing bug in the demo with input 3segconstr.cin:
s -268 65 238 71
s 206 -89 -241 -11
s -94 171 -155 -196

Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This commit is contained in:
Panagiotis Cheilaris 2013-04-28 21:56:39 +02:00
parent 591e821e01
commit 31d9dd1eed
1 changed files with 9 additions and 12 deletions

View File

@ -1180,24 +1180,21 @@ public:
}
}
CGAL_SDG_DEBUG( std::cout << "debug first check npts="
<< npts << std::endl; );
if ((npts == 3) and
((p.is_segment() and not l.has_on_positive_side(vqps))
or(p.is_point() and not l.has_on_negative_side(vqps)))) {
npts = 2;
}
if (npts == 4) {
if ((p.is_segment() and not l.has_on_positive_side(vqps))
or(p.is_point() and not l.has_on_negative_side(vqps))) {
if (l.perpendicular(pnt).has_on_positive_side(vqps)) {
npts = 2;
}
else {
if (compare_x_2(vqps,points[1]) == EQUAL
and compare_y_2(vqps,points[1]) == EQUAL) {
npts = 2;
} else {
npts = 3;
}
if (not l.perpendicular(pnt).has_on_negative_side(vqps)) {
npts = 2;
} else {
if ((p.is_segment() and not l.has_on_positive_side(vqps))
or(p.is_point() and not l.has_on_negative_side(vqps))) {
npts = 3;
}
}
}