0023950: Names and visibility of points not saved when writing XCAF Document into...
[occt.git] / tests / bugs / xde / bug9531
1 puts "TODO OCC12345 ALL: OCC9531: Faulty"
2
3 puts "============"
4 puts "OCC9531"
5 puts "============"
6 puts ""
7 #######################################################################
8 # Regression after writing-reading operation
9 #######################################################################
10
11 set BugNumber OCC9531
12
13 set IsOk 1
14 set filepath [locate_data_file 919-001-T02-04-CP-VL.igs]
15 if {[catch {igesread $filepath OCC9531a *}]} {
16    puts "Faulty ${BugNumber} : here is reading problem"
17    set IsOk 0
18 }
19
20 file delete ${imagedir}/OCC9531tmp.igs
21
22 if {[catch {brepiges OCC9531a ${imagedir}/OCC9531tmp.igs}]} {
23    puts "Faulty ${BugNumber} : here is conversation to brep problem"
24    set IsOk 0
25 }
26 catch {exec chmod 777 ${imagedir}/OCC9531tmp.igs}
27
28 if {[catch {igesread ${imagedir}/OCC9531tmp.igs OCC9531b *}]} {
29    puts "Faulty ${BugNumber} : here is 2nd reading problem"
30    set IsOk 0
31 }
32
33 if { ${IsOk} == 1} {
34    set aTokList {= }
35    set Tol1 [lindex [split [tolerance OCC9531a] ${aTokList}] 2]
36    set Tol2 [lindex [split [tolerance OCC9531b] ${aTokList}] 2]
37    set percent_max 0.1
38    set Tolerance_percent [GetPercent ${Tol1} ${Tol2}]
39    puts "Tolerance_percent = ${Tolerance_percent} %"
40    if { ${Tolerance_percent}  > ${percent_max} } {
41       set IsOk 0
42    }
43
44    set good_square 5236.89
45    set good_vertex 5748
46    set good_edge 5680
47    set good_wire 915
48    set good_face 899
49    set good_shell 0
50    set good_solid 0
51    set good_compsolid 0
52    set good_compound 1
53    set good_shape 13243
54
55    set nb_info [nbshapes OCC9531a]
56    regexp {Mass +: +([-0-9.+eE]+)} [sprops OCC9531a] full sq1
57    regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v1
58    regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e1
59    regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w1
60    regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f1
61    regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh1
62    regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol1
63    regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol1
64    regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound1
65    regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape1
66    if {$sq1 != $good_square
67       || $nb_v1 != $good_vertex
68       || $nb_e1 != $good_edge
69       || $nb_w1 != $good_wire
70       || $nb_f1 != $good_face
71       || $nb_sh1 != $good_shell
72       || $nb_sol1 != $good_solid
73       || $nb_compsol1 != $good_compsolid
74       || $compound1 != $good_compound
75       || $nb_shape1 != $good_shape } {
76          set IsOk 0
77    }    
78
79    set nb_info [nbshapes OCC9531b]
80    regexp {Mass +: +([-0-9.+eE]+)} [sprops OCC9531b] full sq2
81    regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v2
82    regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e2
83    regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w2
84    regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f2
85    regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh2
86    regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol2
87    regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol2
88    regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound2
89    regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape2
90    if {$sq2 != $good_square
91       || $nb_v2 != $good_vertex
92       || $nb_e2 != $good_edge
93       || $nb_w2 != $good_wire
94       || $nb_f2 != $good_face
95       || $nb_sh2 != $good_shell
96       || $nb_sol2 != $good_solid
97       || $nb_compsol2 != $good_compsolid
98       || $compound2 != $good_compound
99       || $nb_shape2 != $good_shape } {
100          set IsOk 0
101    }    
102
103    if { ${IsOk}  == 0 } {
104       puts "${BugNumber}: Faulty"
105    } else {
106       puts "${BugNumber}: OK"
107    }
108 }
109
110 renamevar OCC9531b result
111 set 2dviewer 0