5 #######################################################################
6 # Invalid hilight of AIS dimension line in local selection
7 #######################################################################
9 vfont add [locate_data_file DejaVuSans.ttf] SansFont
11 # ----------------------------------------------#
12 # Check highlight of length dimension elements #
13 # ----------------------------------------------#
18 set anImage1 $imagedir/${casename}_1.png
19 set anImage2 $imagedir/${casename}_2.png
20 set anImage3 $imagedir/${casename}_3.png
28 vdimension len1 -length -text 3d -plane xoy -flyout 20 -arrow external -label left -shapes len_p1 len_p2 -font SansFont
29 vdimension len2 -length -text 3d -plane xoy -flyout -20 -arrow external -label right -shapes len_p1 len_p2 -font SansFont
35 vdimension len3 -length -text 3d -plane xoy -flyout 20 -arrow internal -label hcenter -shapes len_p3 len_p4 -font SansFont
40 vpoint diam_p2 120 0 0
41 vpoint diam_p3 105 -15 0
42 verase diam_p1 diam_p2 diam_p3
43 vcircle diam_c1 diam_p1 diam_p2 diam_p3 0
44 vdimension diam1 -diameter -text 3d -plane xoy -arrow external -label left -shapes diam_c1 -font SansFont
46 vpoint diam_p4 90 40 0
47 vpoint diam_p5 120 40 0
48 vpoint diam_p6 105 25 0
49 verase diam_p4 diam_p5 diam_p6
50 vcircle diam_c2 diam_p4 diam_p5 diam_p6 0
51 vdimension diam2 -diameter -text 3d -plane xoy -arrow external -label right -shapes diam_c2 -font SansFont
53 vpoint diam_p7 80 -40 0
54 vpoint diam_p8 120 -40 0
55 vpoint diam_p9 100 -60 0
56 verase diam_p7 diam_p8 diam_p9
57 vcircle diam_c3 diam_p7 diam_p8 diam_p9 0
58 vdimension diam3 -diameter -text 3d -plane xoy -arrow external -label hcenter -flyout 30 -shapes diam_c3 -font SansFont
62 vpoint rad_p1 140 -5 0
63 vpoint rad_p2 180 -45 0
64 vpoint rad_p3 220 -5 0
65 verase rad_p1 rad_p2 rad_p3
66 vcircle rad_c1 rad_p1 rad_p2 rad_p3 0
67 vdimension rad1 -radius -text 3d -plane xoy -arrow internal -label hcenter -flyout 0 -shapes rad_c1 -font SansFont
69 vpoint rad_p4 180 -70 0
70 vpoint rad_p5 160 -90 0
71 vpoint rad_p6 140 -70 0
72 verase rad_p4 rad_p5 rad_p6
73 vcircle rad_c2 rad_p4 rad_p5 rad_p6 0
74 vdimension rad2 -radius -text 3d -plane xoy -arrow external -label left -shapes rad_c2 -font SansFont
79 vpoint ang_p2 25 -75 0
80 vpoint ang_p3 0 -100 0
81 verase ang_p1 ang_p2 ang_p3
82 vdimension ang1 -angle -text 3d -plane xoy -arrow internal -label hcenter -flyout 35 -shapes ang_p1 ang_p2 ang_p3 -font SansFont
84 vpoint ang_p4 0 -120 0
85 vpoint ang_p5 30 -80 0
86 vpoint ang_p6 30 -120 0
87 verase ang_p4 ang_p5 ang_p6
88 vdimension ang2 -angle -text 3d -plane xoy -arrow external -label left -flyout 55 -shapes ang_p4 ang_p5 ang_p6 -font SansFont
90 vpoint ang_p8 55 -120 0
91 vpoint ang_p9 55 -80 0
92 vpoint ang_p10 95 -120 0
93 verase ang_p8 ang_p9 ang_p10
94 vdimension ang3 -angle -text 3d -plane xoy -arrow external -label right -flyout 55 -shapes ang_p8 ang_p9 ang_p10 -font SansFont
100 # ----------------------------------------------------------------------------- #
101 # Verify picking in neutral and local selections #
102 # ----------------------------------------------------------------------------- #
104 proc check_picking { pick check name } {
105 for {set i 0} {$i < [llength $pick]} {incr i} {
107 set pick_x [lindex [lindex $pick $i] 0]
108 set pick_y [lindex [lindex $pick $i] 1]
109 set check_x [lindex $check 0]
110 set check_y [lindex $check 1]
112 vmoveto $pick_x $pick_y
113 set res [checkcolor $check_x $check_y 0 1 1]
116 puts "Error : Highlighting of $name at pick coordinates ($pick_x, $pick_y) check coordinates ($check_x, $check_y)"
121 proc check_cross_picking { pick object name } {
125 for {set i 1} {$i < 3} {incr i} {
127 vselmode $object $i 1
129 for {set j 1} {$j < 3} {incr j} {
131 set pick_idx_i [expr "[llength $pick] - 2 + $i - 1"]
132 set pick_idx_j [expr "[llength $pick] - 2 + $j - 1"]
134 set pick_x [lindex [lindex $pick $pick_idx_i] 0]
135 set pick_y [lindex [lindex $pick $pick_idx_i] 1]
136 set check_x [lindex [lindex $pick $pick_idx_j] 0]
137 set check_y [lindex [lindex $pick $pick_idx_j] 1]
139 vmoveto $pick_x $pick_y
142 set res [checkcolor $check_x $check_y 0 1 1]
144 puts "Error : No local hilighting of $name at pick coordinates ($pick_x, $pick_y) check coordinates ($check_x, $check_y)"
147 set res [checkcolor $check_x $check_y 0 0 0]
149 puts "Error : Unwanted hilighting of $name at pick coordinates ($pick_x, $pick_y) check coordinates ($check_x, $check_y)"
153 vselmode $object $i 0
158 # pick coord { [flyout], dimension line, text }
160 # check sensitives "len1"
161 set pick_coord { {100 133 } { 106 124 } { 76 130 } }
162 set check_coord { 123 125 }
163 check_picking $pick_coord $check_coord "length dimension (len1)"
164 check_cross_picking $pick_coord len1 "length dimension (len1)"
166 # check sensitives "len2"
167 set pick_coord { { 100 167 } { 126 177 } { 187 180 } }
168 set check_coord { 106 177 }
169 check_picking $pick_coord $check_coord "length dimension (len2)"
170 check_cross_picking $pick_coord len2 "length dimension (len2)"
172 # check sensitives "len3"
173 set pick_coord { { 100 114 } { 106 99 } { 120 97 } }
174 set check_coord { 153 109 }
175 check_picking $pick_coord $check_coord "length dimension (len3)"
176 check_cross_picking $pick_coord len3 "length dimension (len3)"
178 # check sensitives "diam1"
179 set pick_coord { { 247 151 } { 184 150 } }
180 set check_coord { 236 151 }
181 check_picking $pick_coord $check_coord "diameter dimension (diam1)"
182 check_cross_picking $pick_coord diam1 "diameter dimension (diam1)"
184 # check sensitives "diam2"
185 set pick_coord { { 221 99 } { 285 99 } }
186 set check_coord { 239 99 }
187 check_picking $pick_coord $check_coord "diameter dimension (diam2)"
188 check_cross_picking $pick_coord diam2 "diameter dimension (diam2)"
190 # check sensitives "diam3"
191 set pick_coord { { 205 225 } { 263 242 } { 224 242 } }
192 set check_coord { 205 233 }
193 check_picking $pick_coord $check_coord "diameter dimension (diam3)"
194 check_cross_picking $pick_coord diam3 "diameter dimension (diam3)"
196 # check sensitives "rad1"
197 set pick_coord { { 288 158 } { 310 157 } }
198 set check_coord { 288 158 }
199 check_picking $pick_coord $check_coord "radius dimension (rad1)"
200 check_cross_picking $pick_coord rad1 "radius dimension (rad1)"
202 # check sensitives "rad2"
203 set pick_coord { { 320 242 } { 362 241 } }
204 set check_coord { 320 242 }
205 check_picking $pick_coord $check_coord "radius dimension (rad2)"
206 check_cross_picking $pick_coord rad2 "radius dimension (rad2)"
208 # check sensitives "ang1"
209 set pick_coord { { 113 229 } { 96 221 } { 85 256 } }
210 set check_coord { 86 250 }
211 check_picking $pick_coord $check_coord "angle dimension (ang1)"
212 check_cross_picking $pick_coord ang1 "angle dimension (ang1)"
214 # check sensitives "ang2"
215 set pick_coord { { 140 311 } { 91 310 } { 50 278 } }
216 set check_coord { 105 318 }
217 check_picking $pick_coord $check_coord "angle dimension (ang2)"
218 check_cross_picking $pick_coord ang2 "angle dimension (ang2)"
220 # check sensitives "ang3"
221 set pick_coord { { 172 303 } { 163 327 } { 243 287 } }
222 set check_coord { 183 326 }
223 check_picking $pick_coord $check_coord "angle dimension (ang3)"
224 check_cross_picking $pick_coord ang3 "angle dimension (ang3)"
226 # --------------------------------------------------- #
227 # Dump selected images #
228 # --------------------------------------------------- #
237 vselect $xmin $ymin $xmax $ymax $shift
242 vselect $xmin $ymin $xmax $ymax $shift
248 vselect $xmin $ymin $xmax $ymax $shift