]> OCCT Git - occt-copy.git/commitdiff
0026721: Visualization - selection highlight of selected face is broken
authorvpa <vpa@opencascade.com>
Fri, 25 Sep 2015 16:27:17 +0000 (19:27 +0300)
committersan <san@opencascade.com>
Thu, 1 Oct 2015 08:21:24 +0000 (11:21 +0300)
- fixed highlight state in global status of previously selected object in AIS_InteractiveContext::SetSelected;
- test case for issue #26721

src/AIS/AIS_InteractiveContext_1.cxx
tests/bugs/vis/bug26721 [new file with mode: 0644]

index 2cb6e921c0af6670effb743a44656ba44d275595..64bb48460a5b7fbffdab671c9acd5c11917ed4b8 100644 (file)
@@ -1037,7 +1037,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
         anObjToClear.Add (anInteractive);
     }
     anOwner->State (0);
-    if (theOwner == anObject->GlobalSelOwner())
+    if (anOwner == anObject->GlobalSelOwner())
     {
       myObjects.ChangeFind (anObject)->SetHilightStatus (Standard_False);
     }
diff --git a/tests/bugs/vis/bug26721 b/tests/bugs/vis/bug26721
new file mode 100644 (file)
index 0000000..7e9e7f9
--- /dev/null
@@ -0,0 +1,34 @@
+puts "============"
+puts "CR26721"
+puts "============"
+puts ""
+
+##########################################################################################
+puts "Visualization - selection highlight of selected face is broken"
+##########################################################################################
+
+pload VISUALIZATION MODELING
+
+box b 1 1 1
+vinit
+vdisplay b
+vfit
+
+# select box in 0 selection mode
+vselect 200 200
+
+vselmode 4 1
+# select box's face
+vselect 200 300
+
+# check if highlight is correct:
+# 1. check if other edges of the box are not highlighted
+if {[vreadpixel 292 356 name] != "YELLOW 1"} {
+  puts "ERROR: the box is drawn with the color that isn't equal to default!"
+}
+# 2. check if previously selected face is highlighted with selection color
+if {[vreadpixel 204 301 name] != "GRAY80 1"} {
+  puts "ERROR: the face selected is not highlighted with selection color!"
+}
+
+set only_screen 1