0029967: Draw Harness - command bounding has annoying syntax
[occt.git] / tests / caf / bugs / B7
CommitLineData
40093367 1#INTERFACE CAF
2puts "================"
3puts "OCC1228"
4puts "================"
5puts ""
6
7# XLink attributes
8#
9# Testing attribute: TDocStd_XLink
10#
11# Testing command: CopyWithLink
12#
13
14# ANALOG: puts "caf004-B3"
15
16# Create two new documents Doc1, Doc2
17NewDocument Doc1 BinOcaf
18NewDocument Doc2 BinOcaf
19
20# Set UndoLimit for them
21UndoLimit Doc1 100
22UndoLimit Doc2 100
23
24# Set a shape in Doc1 to label 'SLabel'
25set aLabel1 0:2
26Label Doc1 ${aLabel1}
27SetName Doc1 ${aLabel1} SLabel
28
29set aSetX1 10
30set aSetY1 20
31set aSetZ1 30
32set aSetDX1 100
33set aSetDY1 200
34set aSetDZ1 300
35
36box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
37
1f26f80b 38bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
40093367 39
40SetShape Doc1 ${aLabel1} aBox1
41
42# Create a new label 'TLabel1' in Doc1
43set aLabel2 0:3
44Label Doc1 ${aLabel2}
45SetName Doc1 ${aLabel2} TLabel1
46
47# Open transaction in Doc1
48NewCommand Doc1
49
50# Copy 'SLabel' to the label 'TLabel1' with link
51CopyWithLink Doc1 ${aLabel2} Doc1 ${aLabel1}
52
53# Close/Open transaction
54NewCommand Doc1
55
56# Save the document
8418c617 57set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf
40093367 58file delete ${aFile}
59catch {SaveAs Doc1 ${aFile}}
60if { ![file exists ${aFile}] } {
61 puts "There is not ${aFile} file; SaveAs command: Error"
62 puts "OCC1228: ERROR (case 1)"
63}
64#catch {exec chmod 777 ${aFile}}
65
66# Restore the document
67Close Doc1
68catch {Open ${aFile} Doc2}
69
70# Get a shape from 'TLabel1' of restoring document
71set IsDone [catch {GetShape Doc2 ${aLabel2} aBox2} aResult]
72if { ${IsDone} != 0 } {
73 puts ${aResult}
74 puts "Get a value of TNaming_NamedShape attribute from restoring document: Error"
75 puts "OCC1228: ERROR (case 2)"
76}
77
1f26f80b 78bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
1a0339b4 79
80if { [dval X1_Box1] != [dval X1_Box2] ||
81 [dval Y1_Box1] != [dval Y1_Box2] ||
82 [dval Z1_Box1] != [dval Z1_Box2] ||
83 [dval X2_Box1] != [dval X2_Box2] ||
84 [dval Y2_Box1] != [dval Y2_Box2] ||
85 [dval Z2_Box1] != [dval Z2_Box2] } {
86 puts "X1_Box1=[dval X1_Box1] X1_Box2=[dval X1_Box2]"
87 puts "Y1_Box1=[dval Y1_Box1] Y1_Box2=[dval Y1_Box2]"
88 puts "Z1_Box1=[dval Z1_Box1] Z1_Box2=[dval Z1_Box2]"
89 puts "X2_Box1=[dval X2_Box1] X2_Box2=[dval X2_Box2]"
90 puts "Y2_Box1=[dval Y2_Box1] Y2_Box2=[dval Y2_Box2]"
91 puts "Z2_Box1=[dval Z2_Box1] Z2_Box2=[dval Z2_Box2]"
40093367 92 puts "Get a link between attributes of the same document from restoring document: Error"
93 puts "OCC1228: ERROR (case 3)"
94} else {
95 puts "Get a link between attributes of the same document from restoring document: OK"
96 puts "OCC1228: OK"
97}