0031779: Visualization, AIS_ViewController - controller should handle selection schemes
[occt.git] / tests / bugs / vis / bug26779
1 puts "============"
2 puts "CR26779"
3 puts "============"
4 puts ""
5
6 ##########################################################################################
7 puts "Draw Harness, ViewerTest - vstate output is incorrect for sub-shapes selection without opening local context"
8 ##########################################################################################
9
10 pload MODELING VISUALIZATION
11
12 box b1 1 2 3
13 box b2  5 5 5 1 1 1
14
15 vclear
16 vclose ALL
17 vinit View1
18 vaxo
19 vsetdispmode 1
20 vdisplay b1
21 vfit
22
23 vselmode b1 4 1
24 vselect 300 300
25 set anInfo [split [vstate] "\n"]
26 set aItem1 [lindex $anInfo 0]
27 set aItem2 [string trim [lindex $anInfo 1] ]
28 set aSize [llength $anInfo]
29 if {$aSize != 3 || [string compare $aItem1 "Locally selected sub-shapes within b1:"] != 0 || [string compare $aItem2 "Face #2"] != 0} {
30   puts "ERROR: vstate output for selected face is incorrect"
31 }
32
33 vdisplay b2
34 vfit
35
36 vselect 350 120 -xor
37 set anInfo [split [vstate *] "\n"]
38 set aItem1 [string trim [lindex $anInfo 1] ]
39 set aItem2 [string trim [lindex $anInfo 2] ]
40 set aItem3 [string trim [lindex $anInfo 4] ]
41 set aSize [llength $anInfo]
42 puts $aItem1
43 puts $aItem2
44 puts $aSize
45 if {$aSize != 6} {
46   puts "ERROR: vstate output for shift selection is incorrect"
47 }
48 if {[string compare $aItem1 "b1                   Displayed                   Type:  AIS_Shape (AIS_Shape)"] != 0 &&
49 [string compare $aItem2 "b1                   Displayed                   Type:  AIS_Shape (AIS_Shape)"] != 0} {
50   puts "ERROR: no info about object b1 in vstate output"
51 }
52 if {[string compare $aItem1 "b2                   Displayed Selected Detected Type:  AIS_Shape (AIS_Shape)"] != 0 &&
53 [string compare $aItem2 "b2                   Displayed Selected Detected Type:  AIS_Shape (AIS_Shape)"] != 0} {
54   puts "ERROR: no info about object b2 in vstate output"
55 }
56 if {[string compare $aItem3 "Face #2"] != 0} {
57   puts "ERROR: vstate output for selected face in test part 2 is incorrect"
58 }
59
60 checkview -screenshot -3d -path ${imagedir}/${test_image}.png