]> OCCT Git - occt-copy.git/commitdiff
0032205: Visualization - implementing new selection scheme in context - replace extra
authornds <nds@opencascade.com>
Wed, 28 Oct 2020 18:16:27 +0000 (21:16 +0300)
committersnn <sergey.nikonov@opencascade.com>
Thu, 20 May 2021 14:12:25 +0000 (17:12 +0300)
- implementation of additional selection scheme, mainly to deselect single selected object.

(cherry picked from commit e76471b5587a36b6f8f9bec70d09e18d64002a78)

# Conflicts:
# src/ViewerTest/ViewerTest_ViewerCommands.cxx

# Conflicts:
# src/ViewerTest/ViewerTest_ViewerCommands.cxx

src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/bugs/vis/bug32205 [new file with mode: 0644]

index 86cabe13c0a3d171c51d8a73ab3ca77c67f499e1..19741a1280f37b14915fea74fbf0318978a280cd 100644 (file)
@@ -6916,6 +6916,10 @@ static Standard_Integer VSelect (Draw_Interpretor& ,
         ++anArgIter;
       }
     }
+    else if (anArg == "-replaceextra")
+    {
+      aSelScheme = AIS_SelectionScheme_ReplaceExtra;
+    }
     else if (anArg == "-replace")
     {
       aSelScheme = AIS_SelectionScheme_Replace;
diff --git a/tests/bugs/vis/bug32205 b/tests/bugs/vis/bug32205
new file mode 100644 (file)
index 0000000..7a5ee19
--- /dev/null
@@ -0,0 +1,28 @@
+puts "========"
+puts "0032205:  Visualization - implementing new selection scheme in context - replace extra"
+puts "========"
+puts ""
+
+pload MODELING VISUALIZATION
+box b1  0  0  0 10 10 10
+box b2 20 20 20 30 30 30
+vclear
+vinit View1
+vaxo
+vdisplay -dispMode 1 b1 b2
+vfit
+vselprops selHighlight -dispMode -1
+vselect 0 0 400 400 -xor
+if { ![string match "*Selected*" [vstate b1]] } { puts "Error: b1 should be selected."}
+if { ![string match "*Selected*" [vstate b2]] } { puts "Error: b2 should be selected."}
+vselect 200 200 -replaceExtra
+if {  [string match "*Selected*" [vstate b1]] } { puts "Error: b1 should not be selected."}
+if { ![string match "*Selected*" [vstate b2]] } { puts "Error: b2 should be selected."}
+vselect 200 200 -replaceExtra
+if {  [string match "*Selected*" [vstate b1]] } { puts "Error: b1 should not be selected."}
+if {  [string match "*Selected*" [vstate b2]] } { puts "Error: b2 should not be selected."}
+vselect 200 200 -replaceExtra
+if {  [string match "*Selected*" [vstate b1]] } { puts "Error: b1 should not be selected."}
+if { ![string match "*Selected*" [vstate b2]] } { puts "Error: b2 should be selected."}
+
+vdump $imagedir/${casename}.png