0031918: Application Framework - New binary format for fast reading part of OCAF...
[occt.git] / tests / bugs / caf / bug26155
1 puts "============"
2 puts "OCC26155"
3 puts "============"
4 puts ""
5 ###################################################################################
6 # TNaming, CurrentShape: order of shapes in Modification compound is unpredictable.
7 ###################################################################################
8
9 pload QAcommands
10
11 NewDocument D BinOcaf
12
13 set x_ref 0.0
14 set x_tol 0.1
15 set result 1
16
17 for {set i 1} {$i <= 50} {incr i} {
18   set lab $i:1
19
20   box b   0 0 0 10 10 10
21   box b_1 0 0 0  5 10 10
22   box b_2 5 0 0  5 10 10
23
24   BuildNamedShape D [set lab]:1 PRIMITIVE b
25   BuildNamedShape D [set lab]:1:1 MODIFY b b_1
26   BuildNamedShape D [set lab]:1:2 MODIFY b b_2
27   CurrentShape D "[set lab]:1" r
28   explode r so
29   regexp {X += +([-0-9.+eE]+)} [vprops r_1 $x_tol] full x_1
30
31   if { $x_ref == 0 } {
32     set x_ref $x_1
33   } elseif { [expr abs ($x_1 - $x_ref)] > $x_tol } {
34     puts "Error: order of components of modified shape compound is not permanent."
35     break
36   }
37 }