0027621: Highlighting with color remains visible when shape is erased.
authorisk <isk@opencascade.com>
Mon, 4 Jul 2016 09:20:47 +0000 (12:20 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 7 Jul 2016 11:16:23 +0000 (14:16 +0300)
src/AIS/AIS_InteractiveContext.cxx
tests/bugs/vis/bug27621_1 [new file with mode: 0644]
tests/bugs/vis/bug27621_2 [new file with mode: 0644]

index 8e0041e..1f52174 100644 (file)
@@ -2410,6 +2410,18 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
     myMainPM->SetVisibility (theIObj, aDispModeIter.Value(), Standard_False);
   }
 
     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))
   {
   if (IsSelected (theIObj)
   && !aStatus->IsDModeIn (aDispMode))
   {
@@ -2478,6 +2490,12 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
     myMainPM->Clear (theIObj, aDispModeIter.Value());
   }
 
     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)
   {
   // 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 (file)
index 0000000..c7eea68
--- /dev/null
@@ -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 (file)
index 0000000..192cef5
--- /dev/null
@@ -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