0027530: Visualization - AIS_InteractiveContext::HilightNextDetected() doesn't work...
[occt.git] / tests / v3d / edge / A10
CommitLineData
4ca4bbe8 1puts "============"
2puts "CR25436"
3puts "Test case check work of the new commands vselnext and vselprev"
4puts "============"
5puts ""
6
f0cddd16 7proc check_highlighting { theEdgeIdx theCoords } {
8 set aNext [expr ($theEdgeIdx + 1) % 3]
9 set aNextNext [expr ($theEdgeIdx + 2) % 3]
10 set hiColor [vreadpixel [lindex $theCoords [expr $theEdgeIdx * 2] ] [lindex $theCoords [expr $theEdgeIdx * 2 + 1] ] name]
11 set nextColor [vreadpixel [lindex $theCoords [expr $aNext * 2] ] [lindex $theCoords [expr $aNext * 2 + 1] ] name]
12 set nextNextColor [vreadpixel [lindex $theCoords [expr $aNextNext * 2] ] [lindex $theCoords [expr $aNextNext * 2 + 1] ] name]
13
14 if {$hiColor == "CYAN1 1" && $nextColor == "YELLOW 1" && $nextNextColor == "YELLOW 1"} {
15 return true
16 } else {
17 return false
18 }
19}
20
21set coords { }
22# e10_x, e10_y
23lappend coords 94
24lappend coords 140
25# e2_x, e2_y
26lappend coords 103
27lappend coords 60
28# e1_x, e1_y
29lappend coords 29
30lappend coords 208
31
4ca4bbe8 32box b 10 10 10
33vdisplay b
34vfit
35vselmode 2 1
36vmoveto 30 101
37
f0cddd16 38if { ![check_highlighting 0 $coords] } {
39 puts "ERROR: incorrect highlighting of edge 10"
40}
41
4ca4bbe8 42vselnext
f0cddd16 43if { ![check_highlighting 1 $coords] } {
44 puts "ERROR: incorrect highlighting of edge 2 after vselnext call"
45}
4ca4bbe8 46vselnext
f0cddd16 47if { ![check_highlighting 2 $coords] } {
48 puts "ERROR: incorrect highlighting of edge 1 after vselnext call"
49}
4ca4bbe8 50vselnext
f0cddd16 51if { ![check_highlighting 0 $coords] } {
52 puts "ERROR: incorrect highlighting of edge 10 after vselnext call"
53}
4ca4bbe8 54
55vselprev
f0cddd16 56if { ![check_highlighting 2 $coords] } {
57 puts "ERROR: incorrect highlighting of edge 1 after vselprev call"
58}
4ca4bbe8 59vselprev
f0cddd16 60if { ![check_highlighting 1 $coords] } {
61 puts "ERROR: incorrect highlighting of edge 2 after vselprev call"
62}
4ca4bbe8 63vselprev
f0cddd16 64if { ![check_highlighting 0 $coords] } {
65 puts "ERROR: incorrect highlighting of edge 10 after vselprev call"
66}