0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / tests / caf / named_shape / C1
1 #INTERFACE CAF
2 # NamedShape
3 #
4 # Testing attribute: TNaming_NamedShape
5 #
6 # Testing command:   GetShape
7 #
8
9 puts "caf002-C1"
10
11 # Create a box
12 set aSetX1 10
13 set aSetY1 20
14 set aSetZ1 30
15 set aSetDX1 100
16 set aSetDY1 200
17 set aSetDZ1 300
18
19 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
20
21 bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
22
23 # Create a label
24 set aLabel 0:2
25 Label D ${aLabel}
26
27 # Close/Open transaction
28 NewCommand D
29
30 # Set a shape to the label
31 SetShape D ${aLabel} aBox1
32
33 # Close/Open transaction
34 NewCommand D
35
36 # Save the document
37 set aFile ${imagedir}/caf002-C1.cbf
38 file delete ${aFile}
39 SaveAs D ${aFile}
40 #catch {exec chmod 777 ${aFile}}
41 if { ![file exists ${aFile}] } {
42         puts "There is not ${aFile} file; SaveAs command: Error"
43         return
44 }
45
46 # Restore the document
47 Close D
48 Open ${aFile} DD
49
50 # Get a shape from the label
51 set IsDone [catch {GetShape DD ${aLabel} aBox3} aResult]
52 if { ${IsDone} != 0 } {
53         puts ${aResult}
54         puts "Get a value of TNaming_NamedShape attribute from restoring document: Error"
55         return
56 }
57
58 bounding aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
59
60 if { [dval X1_Box1] != [dval X1_Box3] || 
61      [dval Y1_Box1] != [dval Y1_Box3] || 
62      [dval Z1_Box1] != [dval Z1_Box3] || 
63      [dval X2_Box1] != [dval X2_Box3] || 
64      [dval Y2_Box1] != [dval Y2_Box3] || 
65      [dval Z2_Box1] != [dval Z2_Box3] } {
66         puts "X1_Box1=[dval X1_Box1] X1_Box3=[dval X1_Box3]"
67         puts "Y1_Box1=[dval Y1_Box1] Y1_Box3=[dval Y1_Box3]"
68         puts "Z1_Box1=[dval Z1_Box1] Z1_Box3=[dval Z1_Box3]"
69         puts "X2_Box1=[dval X2_Box1] X2_Box3=[dval X2_Box3]"
70         puts "Y2_Box1=[dval Y2_Box1] Y2_Box3=[dval Y2_Box3]"
71         puts "Z2_Box1=[dval Z2_Box1] Z2_Box3=[dval Z2_Box3]"
72         puts "Get a value of TNaming_NamedShape attribute from restoring document: Error"
73         return
74 }
75
76 puts "Get a value of TNaming_NamedShape attribute from restoring document: OK"