5 ####################################################################################
6 # Visualization - Test case for selection in perspective views
7 # Test is made using comparison of selected points with expected to be selected points.
8 # In case of mismatching test will report about an error of certain type:
9 # point selection, rectangle selection or polygon selection is broken.
10 ####################################################################################
13 #draw grid of points 7x7
15 for {set x 0} {$x<7} {incr x} {
16 for {set y 0} {$y<7} {incr y} {
21 for {set x 0} {$x<7} {incr x} {
22 for {set y 0} {$y<7} {incr y} {
35 #check rectagle selection
40 set ref_selected {55 6 69 18 13 67 54 68 19 12 62 5 53 60 4 61 20 11}
41 set asplit [split $result "\n"]
42 for {set i 0} {$i < [llength $ref_selected]} {incr i} {
43 lappend newlist [lindex [lindex $asplit $i] 0]
45 set newsorted [lsort $newlist]
46 set refsorted [lsort $ref_selected]
47 for {set i 0} {$i < [llength $refsorted]} {incr i} {
48 if {[lindex $refsorted $i] != [lindex $newsorted $i]} {
54 #check point selection
59 if {[lindex $result 0] != 6} {
63 #check polygon selection
64 vselect 70 70 0 600 200 600 200 200 600 200 600 70
68 set ref_selected {67 97 47 32 12 33 49 74 54 8 50 19\
69 9 63 83 56 39 26 66 75 18 95 81 15 89 51 46 76 57 90\
70 82 58 65 10 11 25 62 59 14 52 40 60 68 16 55 7 64 61\
72 set asplit [split $result "\n"]
73 for {set i 0} {$i < [llength $ref_selected]} {incr i} {
74 lappend newlist [lindex [lindex $asplit $i] 0]
76 set newsorted [lsort $newlist]
77 set refsorted [lsort $ref_selected]
78 for {set i 0} {$i < [llength $refsorted]} {incr i} {
79 if {[lindex $refsorted $i] != [lindex $newsorted $i]} {
86 puts "Error : Perspective selection by rectangle is broken."
89 puts "Error : Perspective selection by point is broken."
92 puts "Error : Perspective selection by polygon is broken."