File: bug24389

package info (click to toggle)
oce 0.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 301,548 kB
  • sloc: cpp: 1,190,609; ansic: 67,225; sh: 11,630; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 342; xml: 292; perl: 37
file content (247 lines) | stat: -rw-r--r-- 7,903 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
puts "============"
puts "CR24389"
puts "============"
puts ""
#######################################################################
#  Invalid hilight of AIS dimension line in local selection
#######################################################################

# ----------------------------------------------#
#  Check highlight of length dimension elements #
# ----------------------------------------------#

vinit View1
vtop

set anImage1 $imagedir/${casename}_1.png
set anImage2 $imagedir/${casename}_2.png
set anImage3 $imagedir/${casename}_3.png

# length

vpoint len_p1  0 0 0
vpoint len_p2 40 0 0
verase len_p1 len_p2

vdimension len1 -length -text 3d -plane xoy -flyout 20 -arrow external -label left -shapes len_p1 len_p2
vdimension len2 -length -text 3d -plane xoy -flyout -20 -arrow external -label right -shapes len_p1 len_p2

vpoint len_p3  0 20 0
vpoint len_p4 40 20 0
verase len_p3 len_p4

vdimension len3 -length -text 3d -plane xoy -flyout 20 -arrow internal -label hcenter -shapes len_p3 len_p4

# diameter

vpoint diam_p1  90 0   0
vpoint diam_p2 120 0   0
vpoint diam_p3 105 -15 0
verase diam_p1 diam_p2 diam_p3
vcircle diam_c1 diam_p1 diam_p2 diam_p3 0
vdimension diam1 -diameter -text 3d -plane xoy -arrow external -label left -shapes diam_c1

vpoint diam_p4  90 40 0
vpoint diam_p5 120 40 0
vpoint diam_p6 105 25 0
verase diam_p4 diam_p5 diam_p6
vcircle diam_c2 diam_p4 diam_p5 diam_p6 0
vdimension diam2 -diameter -text 3d -plane xoy -arrow external -label right -shapes diam_c2

vpoint diam_p7  80 -40 0
vpoint diam_p8 120 -40 0
vpoint diam_p9 100 -60 0
verase diam_p7 diam_p8 diam_p9
vcircle diam_c3 diam_p7 diam_p8 diam_p9 0
vdimension diam3 -diameter -text 3d -plane xoy -arrow external -label hcenter -flyout 30 -shapes diam_c3

# radius

vpoint rad_p1 140  -5 0
vpoint rad_p2 180 -45 0
vpoint rad_p3 220  -5 0
verase rad_p1 rad_p2 rad_p3
vcircle rad_c1 rad_p1 rad_p2 rad_p3 0
vdimension rad1 -radius -text 3d -plane xoy -arrow internal -label hcenter -flyout 0 -shapes rad_c1

vpoint rad_p4 180 -70 0
vpoint rad_p5 160 -90 0
vpoint rad_p6 140 -70 0
verase rad_p4 rad_p5 rad_p6
vcircle rad_c2 rad_p4 rad_p5 rad_p6 0
vdimension rad2 -radius -text 3d -plane xoy -arrow external -label left -shapes rad_c2

# angles

vpoint ang_p1 0  -50 0
vpoint ang_p2 25 -75 0
vpoint ang_p3 0  -100 0
verase ang_p1 ang_p2 ang_p3
vdimension ang1 -angle -text 3d -plane xoy -arrow internal -label hcenter -flyout 35 -shapes ang_p1 ang_p2 ang_p3

vpoint ang_p4   0 -120 0
vpoint ang_p5  30 -80  0
vpoint ang_p6  30 -120 0
verase ang_p4 ang_p5 ang_p6
vdimension ang2 -angle -text 3d -plane xoy -arrow external -label left -flyout 55 -shapes ang_p4 ang_p5 ang_p6

vpoint ang_p8  55 -120 0
vpoint ang_p9  55 -80  0
vpoint ang_p10 95 -120 0
verase ang_p8 ang_p9 ang_p10
vdimension ang3 -angle -text 3d -plane xoy -arrow external -label right -flyout 55 -shapes ang_p8 ang_p9 ang_p10

vpoint fit1 -75 0 0
vpoint fit2 235 0 0
vfit

# ----------------------------------------------------------------------------- #
#               Verify picking in neutral and local selections                  #
# ----------------------------------------------------------------------------- #

proc check_picking { pick check name } {
  for {set i 0} {$i < [llength $pick]} {incr i} {
  
    set pick_x [lindex [lindex $pick $i] 0]
    set pick_y [lindex [lindex $pick $i] 1]
    set check_x [lindex $check 0]
    set check_y [lindex $check 1]
    
    vmoveto $pick_x $pick_y
    set res [checkcolor $check_x $check_y 0 1 1]
    
    if { $res != 1 } {
      puts "Error : Highlighting of $name at pick coordinates ($pick_x, $pick_y) check coordinates ($check_x, $check_y)"
    }
  }
}

proc check_cross_picking { pick object name } {

  vselmode 0 1

  for {set i 1} {$i < 3} {incr i} {
    
    vselmode $object $i 1

    for {set j 1} {$j < 3} {incr j} {

      set pick_idx_i [expr "[llength $pick] - 2 + $i - 1"]
      set pick_idx_j [expr "[llength $pick] - 2 + $j - 1"]

      set pick_x [lindex [lindex $pick $pick_idx_i] 0]
      set pick_y [lindex [lindex $pick $pick_idx_i] 1]
      set check_x [lindex [lindex $pick $pick_idx_j] 0]
      set check_y [lindex [lindex $pick $pick_idx_j] 1]
      
      vmoveto $pick_x $pick_y
      
      if {$i == $j} {
        set res [checkcolor $check_x $check_y 0 1 1]
        if { $res != 1 } {
          puts "Error : No local hilighting of $name at pick coordinates ($pick_x, $pick_y) check coordinates ($check_x, $check_y)"
        }
      } else {
        set res [checkcolor $check_x $check_y 0 0 0]
        if { $res != 1 } {
          puts "Error : Unwanted hilighting of $name at pick coordinates ($pick_x, $pick_y) check coordinates ($check_x, $check_y)"
        }
      }
    }
    vselmode $object $i 0
  }
  vselmode 0 1
}

# pick coord { [flyout], dimension line, text }

# check sensitives "len1"
set pick_coord { {100 133 } { 106 124 } { 76 130 } }
set check_coord { 123 125 }
check_picking $pick_coord $check_coord "length dimension (len1)"
check_cross_picking $pick_coord len1 "length dimension (len1)"

# check sensitives "len2"
set pick_coord { { 100 167 } { 126 177 } { 187 180 } }
set check_coord { 106 177 }
check_picking $pick_coord $check_coord "length dimension (len2)"
check_cross_picking $pick_coord len2 "length dimension (len2)"

# check sensitives "len3"
set pick_coord { { 100 114 } { 106 99 } { 120 97 } }
set check_coord { 153 109 }
check_picking $pick_coord $check_coord "length dimension (len3)"
check_cross_picking $pick_coord len3 "length dimension (len3)"

# check sensitives "diam1"
set pick_coord { { 247 151 } { 184 150 } }
set check_coord { 236 151 }
check_picking $pick_coord $check_coord "diameter dimension (diam1)"
check_cross_picking $pick_coord diam1 "diameter dimension (diam1)"

# check sensitives "diam2"
set pick_coord { { 221 99 } { 285 99 } }
set check_coord { 239 99 }
check_picking $pick_coord $check_coord "diameter dimension (diam2)"
check_cross_picking $pick_coord diam2 "diameter dimension (diam2)"

# check sensitives "diam3"
set pick_coord { { 205 225 } { 263 242 } { 224 242 } }
set check_coord { 205 233 }
check_picking $pick_coord $check_coord "diameter dimension (diam3)"
check_cross_picking $pick_coord diam3 "diameter dimension (diam3)"

# check sensitives "rad1"
set pick_coord { { 288 158 } { 310 157 } }
set check_coord { 288 158 }
check_picking $pick_coord $check_coord "radius dimension (rad1)"
check_cross_picking $pick_coord rad1 "radius dimension (rad1)"

# check sensitives "rad2"
set pick_coord { { 320 242 } { 362 241 } }
set check_coord { 320 242 }
check_picking $pick_coord $check_coord "radius dimension (rad2)"
check_cross_picking $pick_coord rad2 "radius dimension (rad2)"

# check sensitives "ang1"
set pick_coord { { 113 229 } { 96 221 } { 85 256 } }
set check_coord { 86 250 }
check_picking $pick_coord $check_coord "angle dimension (ang1)"
check_cross_picking $pick_coord ang1 "angle dimension (ang1)"

# check sensitives "ang2"
set pick_coord { { 140 311 } { 91 310 } { 50 278 } }
set check_coord { 105 318 }
check_picking $pick_coord $check_coord "angle dimension (ang2)"
check_cross_picking $pick_coord ang2 "angle dimension (ang2)"

# check sensitives "ang3"
set pick_coord { { 172 303 } { 163 327 } { 243 287 } }
set check_coord { 183 326 }
check_picking $pick_coord $check_coord "angle dimension (ang3)"
check_cross_picking $pick_coord ang3 "angle dimension (ang3)"

# --------------------------------------------------- #
#               Dump selected images                  #
# --------------------------------------------------- #

set xmin -500
set xmax  500
set ymin -500
set ymax  500
set shift 0

vselmode 0 1
vselect $xmin $ymin $xmax $ymax $shift
vdump $anImage1

vselect 0 0 0 0 0
vselmode 1 1
vselect $xmin $ymin $xmax $ymax $shift
vdump $anImage2

vselect 0 0 0 0 0
vselmode 0 1
vselmode 2 1
vselect $xmin $ymin $xmax $ymax $shift
vdump $anImage3