0028107: Visualization - provide a flexible interface to set custom hatch styles
[occt.git] / tests / bugs / vis / bug27530
CommitLineData
f0cddd16 1puts "==========="
2puts "OCC27530"
3puts "==========="
4puts ""
5##########################################################################
6# Visualization - AIS_InteractiveContext::HilightNextDetected() doesn't work in Neutral Point
7##########################################################################
8
9proc check_highlighting { theHiBoxIdx theCoords } {
10 set aNext [expr ($theHiBoxIdx + 1) % 3]
11 set aNextNext [expr ($theHiBoxIdx + 2) % 3]
12 set hiColor [vreadpixel [lindex $theCoords [expr $theHiBoxIdx * 2] ] [lindex $theCoords [expr $theHiBoxIdx * 2 + 1] ] name]
13 set nextColor [vreadpixel [lindex $theCoords [expr $aNext * 2] ] [lindex $theCoords [expr $aNext * 2 + 1] ] name]
14 set nextNextColor [vreadpixel [lindex $theCoords [expr $aNextNext * 2] ] [lindex $theCoords [expr $aNextNext * 2 + 1] ] name]
15
16 if {$hiColor == "CYAN1 1" && $nextColor == "YELLOW 1" && $nextNextColor == "YELLOW 1"} {
17 return true
18 } else {
19 return false
20 }
21}
22
23pload VISUALIZATION MODELING
24
25box b0 3 3 3
26box b1 1 1 1 3 2 1
27box b2 1.5 1.5 1.5 4 4 4
28
29set coords { }
30# b0_x, b0_y
31lappend coords 355
32lappend coords 186
33# b1_x, b1_y
34lappend coords 266
35lappend coords 333
36# b2_x, b2_y
37lappend coords 177
38lappend coords 2
39
40vinit
41vclear
42vdisplay b0 b1 b2
43vleft
44vfit
45
46# MoveTo in area that is common for all boxes
47vmoveto 210 280
48
49if { ![check_highlighting 0 $coords] } {
50 puts "ERROR: incorrect highlighting of box b0"
51}
52
53# check vselnext
54vselnext
55if { ![check_highlighting 1 $coords] } {
56 puts "ERROR: incorrect highlighting of box b1 after vselnext call"
57}
58vselnext
59if { ![check_highlighting 2 $coords] } {
60 puts "ERROR: incorrect highlighting of box b2 after vselnext call"
61}
62vselnext
63if { ![check_highlighting 0 $coords] } {
64 puts "ERROR: incorrect highlighting of box b0 after vselnext call"
65}
66
67# check vselprev
68vselprev
69if { ![check_highlighting 2 $coords] } {
70 puts "ERROR: incorrect highlighting of box b2 after vselprev call"
71}
72vselprev
73if { ![check_highlighting 1 $coords] } {
74 puts "ERROR: incorrect highlighting of box b1 after vselprev call"
75}
76vselprev
77if { ![check_highlighting 0 $coords] } {
78 puts "ERROR: incorrect highlighting of box b0 after vselprev call"
79}