From 4f51d9d704906394eb0ca0274f9b6b1b821242a9 Mon Sep 17 00:00:00 2001 From: isk Date: Mon, 4 Jul 2016 12:20:47 +0300 Subject: [PATCH] 0027621: Highlighting with color remains visible when shape is erased. --- src/AIS/AIS_InteractiveContext.cxx | 18 ++++++++++++++++++ tests/bugs/vis/bug27621_1 | 21 +++++++++++++++++++++ tests/bugs/vis/bug27621_2 | 21 +++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 tests/bugs/vis/bug27621_1 create mode 100644 tests/bugs/vis/bug27621_2 diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx index 8e0041e315..1f52174ec3 100644 --- a/src/AIS/AIS_InteractiveContext.cxx +++ b/src/AIS/AIS_InteractiveContext.cxx @@ -2410,6 +2410,18 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t myMainPM->SetVisibility (theIObj, aDispModeIter.Value(), Standard_False); } + if (aStatus->IsHilighted() + && theIObj->HasHilightMode()) + { + myMainPM->Unhighlight (theIObj, aDispMode); + } + + if (!myLastPicked.IsNull() + && myLastPicked->Selectable() == theIObj) + { + myMainPM->ClearImmediateDraw(); + } + if (IsSelected (theIObj) && !aStatus->IsDModeIn (aDispMode)) { @@ -2478,6 +2490,12 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t myMainPM->Clear (theIObj, aDispModeIter.Value()); } + if (aStatus->IsHilighted() + && theIObj->HasHilightMode()) + { + myMainPM->Unhighlight (theIObj, theIObj->HilightMode()); + } + // Object removes from Detected sequence for(Standard_Integer aDetIter = 1; aDetIter < myAISDetectedSeq.Length(); ++aDetIter) { diff --git a/tests/bugs/vis/bug27621_1 b/tests/bugs/vis/bug27621_1 new file mode 100644 index 0000000000..c7eea682ab --- /dev/null +++ b/tests/bugs/vis/bug27621_1 @@ -0,0 +1,21 @@ +puts "========" +puts "CR27621_1" +puts "========" +puts "" +################################################################### +puts "Highlighting with color remains visible when shape is erased" +################################################################### + +vclear +vinit View1 + +box b 1 2 3 +vdisplay b -dispmode 1 +vfit +vmoveto 250 250 + +vdump $imagedir/${casename}_highlighted.png + +verase b + +vdump $imagedir/${casename}_erased.png diff --git a/tests/bugs/vis/bug27621_2 b/tests/bugs/vis/bug27621_2 new file mode 100644 index 0000000000..192cef5531 --- /dev/null +++ b/tests/bugs/vis/bug27621_2 @@ -0,0 +1,21 @@ +puts "========" +puts "CR27621_2" +puts "========" +puts "" +################################################################### +puts "Highlighting with color remains visible when shape is erased" +################################################################### + +vclear +vinit View1 + +box b 1 2 3 +vdisplay b -dispmode 1 +vfit +vmoveto 250 250 + +vdump $imagedir/${casename}_highlighted.png + +vclear + +vdump $imagedir/${casename}_erased.png -- 2.20.1