0026945: Visualization - selection does not work after closing one of local contexts...
[occt.git] / tests / bugs / vis / bug26945
1 puts "============"
2 puts "CR26945"
3 puts "Visualization - selection does not work after closing one of local contexts in stack"
4 puts "============"
5 puts ""
6
7 pload VISUALIZATION MODELING QAcommands
8
9 vinit
10 vclear
11
12 box b 1 1 1
13 vdisplay b
14 vfit
15 vaspects b -setWidth 2
16
17 set edge_x 380
18 set edge_y 281
19 set vert_x 379
20 set vert_y 305
21 set pick_face_x 250
22 set pick_face_y 300
23 set pick_vert_x 380
24 set pick_vert_y 309
25
26 # open local ctx with face selection enabled
27 OCC26945_open 4
28 vmoveto $pick_face_x $pick_face_y
29 if {[vreadpixel $edge_x $edge_y name] != "CYAN1 1"} {
30   puts "ERROR: Can not select face in local context 1"
31 }
32
33 vmoveto 0 0
34
35 # open local ctx with vertex selection enabled
36 set aVertIdx [OCC26945_open 1]
37 vmoveto $pick_vert_x $pick_vert_y
38 if {[vreadpixel $vert_x $vert_y name] != "CYAN1 1"} {
39   puts "ERROR: Can not select vertex in local context 2"
40 }
41
42 vmoveto 0 0
43
44 # open local ctx with edge selection enabled
45 set anEdgeIdx [OCC26945_open 2]
46 vmoveto $edge_x $edge_y
47 if {[vreadpixel $edge_x $edge_y name] != "CYAN1 1"} {
48   puts "ERROR: Can not select edge in local context 3"
49 }
50
51 vmoveto 0 0
52
53 # close local ctx with vertex selection enabled.
54 # edge selection should be active.
55 OCC26945_close $aVertIdx
56 vmoveto $edge_x $edge_y
57 if {[vreadpixel $edge_x $edge_y name] != "CYAN1 1"} {
58   puts "ERROR: Can not select edge after closing local context 2"
59 }
60
61 vmoveto 0 0
62
63 # close local ctx with edge selection enabled.
64 # face selection should be active.
65 OCC26945_close $anEdgeIdx
66 vmoveto $pick_face_x $pick_face_y
67 if {[vreadpixel $edge_x $edge_y name] != "CYAN1 1"} {
68   puts "ERROR: Can not select face after closing local context 3"
69 }
70
71 set only_screen 1