From: nds Date: Thu, 7 Feb 2019 12:31:50 +0000 (+0300) Subject: 0030484: Visualization - 2d persistent: order of detection doesn't coincide with... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR30484;p=occt-copy.git 0030484: Visualization - 2d persistent: order of detection doesn't coincide with order of objects creation --- diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/SelectMgr/SelectMgr_ViewerSelector.cxx index 0fb6c8666e..c693773d84 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -282,6 +282,9 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(SelectBasics_Sensitive aCriterion.Priority = anOwner->Priority(); aCriterion.Depth = aPickResult.Depth(); aCriterion.MinDist = aPickResult.DistToGeomCenter(); + if (!aSelectable.IsNull() && !aSelectable->TransformPersistence().IsNull() && + aSelectable->TransformPersistence()->Mode() == Graphic3d_TMF_2d) + aCriterion.MinDist = 0; // having 2D persistent, 3D geometry point is not required aCriterion.ToPreferClosest = preferclosest; if (SelectMgr_SortCriterion* aPrevCriterion = mystored.ChangeSeek (anOwner)) diff --git a/tests/bugs/vis/bug30484 b/tests/bugs/vis/bug30484 new file mode 100644 index 0000000000..20812545a7 --- /dev/null +++ b/tests/bugs/vis/bug30484 @@ -0,0 +1,29 @@ +puts "=============" +puts "0030484: Visualization - 2d persistent: order of detection doesn't coincide with order of objects creation +puts "=============" + +pload MODELING VISUALIZATION +vclear + +vinit +vselprops dynHighlight -dispMode 1 -color WHITE + +box box_1 75 -250 0 200 200 200 +box box_2 175 -300 0 200 200 200 + +vdisplay box_1 -2d topLeft -top -dispmode 1 +vsetmaterial box_1 PLASTIC +vsetcolor box_1 DEEPPINK2 + +vdisplay box_2 -2d topLeft -top -dispmode 1 +vsetmaterial box_2 PLASTIC +vsetcolor box_2 PALEGREEN2 + +vmoveto 205 170 + +if { [vreadpixel 205 170 rgb name] != "WHITE" } { puts "Error: common area should be highlighted" } +if { [vreadpixel 150 170 rgb name] == "WHITE" } { puts "Error: box_1 should NOT be highlighted" } +if { [vreadpixel 330 170 rgb name] != "WHITE" } { puts "Error: box_2 should be highlighted" } + +vdump $imagedir/${casename}.png +