From 1ccc1371b97227ae546f586e710e61f48d1a5353 Mon Sep 17 00:00:00 2001 From: kgv Date: Sat, 9 Feb 2019 01:38:28 +0300 Subject: [PATCH] 0030486: Visualization - Rubber-band selection does not work with disabled overlap detection SelectMgr_RectangularFrustum::Overlaps() now treats degenerated polygon as point instead of returning FALSE. --- src/SelectMgr/SelectMgr_RectangularFrustum.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/SelectMgr/SelectMgr_RectangularFrustum.cxx b/src/SelectMgr/SelectMgr_RectangularFrustum.cxx index d972e19f2d..9b7f540d71 100644 --- a/src/SelectMgr/SelectMgr_RectangularFrustum.cxx +++ b/src/SelectMgr/SelectMgr_RectangularFrustum.cxx @@ -537,10 +537,17 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn else if (theSensType == Select3D_TOS_INTERIOR) { gp_Vec aPolyNorm (gp_XYZ (RealLast(), RealLast(), RealLast())); - if (!hasOverlap (theArrayOfPnts, aPolyNorm) - || !segmentPlaneIntersection (aPolyNorm, - theArrayOfPnts.First(), - thePickResult)) + if (!hasOverlap (theArrayOfPnts, aPolyNorm)) + { + return Standard_False; + } + + if (aPolyNorm.Magnitude() <= Precision::Confusion()) + { + // treat degenerated polygon as point + return Overlaps (theArrayOfPnts.First(), thePickResult); + } + else if (!segmentPlaneIntersection (aPolyNorm, theArrayOfPnts.First(), thePickResult)) { return Standard_False; } -- 2.39.5