0028913: UnifySameDomain crashes with error: "a shape is modified and removed simulta...
[occt.git] / tests / heal / unify_same_domain / end
CommitLineData
f523acf0 1if {[isdraw result]} {
2 # check history information
3
4 # get resulting edges
5 eval compound [explode result v] res_verts
6 eval compound [explode result e] res_edges
7
8 # get all vertices and edges of the input shape
9 eval compound [explode a v] input_verts
10 eval compound [explode a e] input_edges
11
12 # check deleted
13
14 # get removed vertices through the history
15 compound rem_verts
16 foreach v [explode input_verts] {
17 if {[regexp "The shape has been deleted" [unifysamedomisdel $v]]} {
18 add $v rem_verts;
19 }
20 }
21
22 # get removed edges through the history
23 compound rem_edges
24 foreach e [explode input_edges] {
25 if {[regexp "The shape has been deleted" [unifysamedomisdel $e]]} {
26 add $e rem_edges;
27 }
28 }
29
30 # check that all removed shapes are not present in the result
31 bsection sec_v res_verts rem_verts
32 if {[llength [explode sec_v v]]} {
33 puts "Error: the history of the removed vertices is incorrect."
34 }
35
36 bsection sec_e res_edges rem_edges
37 if {[llength [explode sec_e e]]} {
38 puts "Error: the history of the removed edges is incorrect."
39 }
40
41 # faces should not be removed at all
42 foreach f [explode a f] {
43 if {[regexp "The shape has been deleted" [unifysamedomisdel $f]]} {
44 puts "Error: the faces should not be removed during unification."
45 break;
46 }
47 }
48
49
50 # check modifications
51
52 # get all modified and not removed shapes into compound and
53 # compare the contents of the compound with the result shape
54 eval compound [explode a f] input_faces
55
56 compound all_hist_shapes
57 foreach comp {input_verts input_edges input_faces} {
58 foreach s [explode $comp] {
59 if {[regexp "The shape has been deleted" [unifysamedomisdel $s]]} {
60 continue;
61 }
62 if {[regexp "The shape has not been modified" [unifysamedommod s_mod $s]]} {
63 add $s all_hist_shapes;
64 continue;
65 }
66
67 if {[regexp "COMPOUND" [whatis s_mod]]} {
68 foreach sm [explode s_mod] { add $sm all_hist_shapes }
69 } else {
70 add s_mod all_hist_shapes;
71 }
72 }
73 }
74
75 eval compound [explode result f] res_faces
76 compound all_res_shapes
77 foreach comp {res_verts res_edges res_faces} {
78 foreach s [explode $comp] { add $s all_res_shapes }
79 }
80
81 checknbshapes all_hist_shapes -ref [nbshapes all_res_shapes]
82 checkprops all_hist_shapes -s [lindex [sprops result -skip] 2] -l [lindex [lprops result -skip] 2] -skip
83}