0023950: Names and visibility of points not saved when writing XCAF Document into...
[occt.git] / tests / bugs / xde / bug1669
CommitLineData
3bea4c16 1puts "================"
2puts "OCC1669"
3puts "================"
4puts ""
5#################################################################
6# Wrong name mapping of the instances of assembly into STEP file.
7#################################################################
8
9set BugNumber OCC1669
10
11catch {pload DCAF}
12
13XNewDoc SA
14
15box b1 10 10 10
16box b2 20 10 10
17ttranslate b1 10 0 0
18ttranslate b2 20 0 0
19compound b1 b2 bl
20copy bl nbl
21ttranslate nbl 30 0 0
22compound bl nbl ryad
23copy ryad hryad
24ttranslate hryad -10 0 10
25copy ryad uryad
26ttranslate uryad 0 0 20
27compound ryad hryad uryad stena
28
29XAddShape SA stena 1
30
31SetName SA 0:1:1:1 Wall
32SetName SA 0:1:1:2 Block-Array
33SetName SA 0:1:1:3 Block
34SetName SA 0:1:1:4 Half-Brick
35SetName SA 0:1:1:5 Brick
36
37SetName SA 0:1:1:1:1 base-array
38SetName SA 0:1:1:1:2 next-array
39SetName SA 0:1:1:1:3 top-array
40
41SetName SA 0:1:1:2:1 left-block
42SetName SA 0:1:1:2:2 right-block
43
44SetName SA 0:1:1:3:1 half-brick
45SetName SA 0:1:1:3:2 brick
46
47catch { WriteStep SA $imagedir/${test_image}.stp }
48catch { ReadStep D $imagedir/${test_image}.stp }
49
50puts "Info: Now compare two documents SA and D"
51#DFBrowse SA
52#DFBrowse D
53
54set NamesList1 {Wall Block-Array Block Half-Brick Brick}
55set NamesList2 {base-array next-array top-array}
56set NamesList3 {left-block right-block}
57set NamesList4 {half-brick brick}
58
59set status 0
60
61for {set i 1} {$i <= 5} {incr i} {
62 set name [ GetName D 0:1:1:$i ]
63 set ref_name [lindex $NamesList1 $i-1]
64 if { $name != $ref_name } {
65 set status 1
66 break
67 }
68}
69
70if { $status != 1 } {
71 for {set i 1} {$i <= 3} {incr i} {
72 set name [ GetName D 0:1:1:1:$i ]
73 set ref_name [lindex $NamesList2 $i-1]
74 if { $name != $ref_name } {
75 set status 1
76 break
77 }
78 }
79}
80
81if { $status != 1 } {
82 for {set i 1} {$i <= 2} {incr i} {
83 set name [ GetName D 0:1:1:2:$i ]
84 set ref_name [lindex $NamesList3 $i-1]
85 if { $name != $ref_name } {
86 set status 1
87 break
88 }
89 }
90}
91
92if { $status != 1 } {
93 for {set i 1} {$i <= 2} {incr i} {
94 set name [ GetName D 0:1:1:3:$i ]
95 set ref_name [lindex $NamesList4 $i-1]
96 if { $name != $ref_name } {
97 set status 1
98 break
99 }
100 }
101}
102
103if { $status != 0 } {
104 puts "Faulty ${BugNumber}"
105} else {
106 puts "OK ${BugNumber}"
107}