4 # Testing attribute: TDocStd_XLink
6 # Testing command: UpdateLink
11 # Create two new documents Doc1, Doc2
12 NewDocument Doc1 BinOcaf
13 NewDocument Doc2 BinOcaf
15 # Set UndoLimit for them
19 # Set a shape in Doc1 to label 'SLabel'
22 SetName Doc1 ${aLabel1} SLabel
31 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
33 set aBoundingBox1 [bounding aBox1]
34 set X1_Box1 [lindex ${aBoundingBox1} 0]
35 set Y1_Box1 [lindex ${aBoundingBox1} 1]
36 set Z1_Box1 [lindex ${aBoundingBox1} 2]
37 set X2_Box1 [lindex ${aBoundingBox1} 3]
38 set Y2_Box1 [lindex ${aBoundingBox1} 4]
39 set Z2_Box1 [lindex ${aBoundingBox1} 5]
41 SetShape Doc1 ${aLabel1} aBox1
43 # Set a shape in Doc1 to label 'S2Label'
45 Label Doc1 ${aLabel12}
46 SetName Doc1 ${aLabel12} S2Label
55 box aBox12 ${aSetX12} ${aSetY12} ${aSetZ12} ${aSetDX12} ${aSetDY12} ${aSetDZ12}
57 set aBoundingBox12 [bounding aBox12]
58 set X1_Box12 [lindex ${aBoundingBox12} 0]
59 set Y1_Box12 [lindex ${aBoundingBox12} 1]
60 set Z1_Box12 [lindex ${aBoundingBox12} 2]
61 set X2_Box12 [lindex ${aBoundingBox12} 3]
62 set Y2_Box12 [lindex ${aBoundingBox12} 4]
63 set Z2_Box12 [lindex ${aBoundingBox12} 5]
65 SetShape Doc1 ${aLabel12} aBox12
67 # Create a new label 'TLabel1' in Doc2
70 SetName Doc2 ${aLabel2} TLabel1
72 # Create a new label 'T2Label1' in Doc2
74 Label Doc2 ${aLabel22}
75 SetName Doc2 ${aLabel22} T2Label1
77 # Open transaction in Doc2
80 # Copy 'SLabel' to the label 'TLabel1' with link
81 CopyWithLink Doc2 ${aLabel2} Doc1 ${aLabel1}
83 # Copy 'S2Label' to the label 'T2Label1' with link
84 CopyWithLink Doc2 ${aLabel22} Doc1 ${aLabel12}
86 # Close/Open transaction in Doc2
89 # Set new shape in Doc1 to label 'SLabel'
91 psphere aSphere ${aRadius}
92 SetShape Doc1 ${aLabel1} aSphere
94 # Set new shape in Doc1 to label 'SLabel'
96 psphere aSphere ${aRadius}
97 SetShape Doc1 ${aLabel12} aSphere
99 # Update all links in Doc2
102 # Close/Open transaction in Doc2
111 # Get a shape from 'TLabel1'
112 GetShape Doc2 ${aLabel2} aBox2
114 set aBoundingBox2 [bounding aBox2]
115 set X1_Box2 [lindex ${aBoundingBox2} 0]
116 set Y1_Box2 [lindex ${aBoundingBox2} 1]
117 set Z1_Box2 [lindex ${aBoundingBox2} 2]
118 set X2_Box2 [lindex ${aBoundingBox2} 3]
119 set Y2_Box2 [lindex ${aBoundingBox2} 4]
120 set Z2_Box2 [lindex ${aBoundingBox2} 5]
122 # Get a shape from 'T2Label1'
123 GetShape Doc2 ${aLabel22} aBox22
125 set aBoundingBox22 [bounding aBox22]
126 set X1_Box22 [lindex ${aBoundingBox22} 0]
127 set Y1_Box22 [lindex ${aBoundingBox22} 1]
128 set Z1_Box22 [lindex ${aBoundingBox22} 2]
129 set X2_Box22 [lindex ${aBoundingBox22} 3]
130 set Y2_Box22 [lindex ${aBoundingBox22} 4]
131 set Z2_Box22 [lindex ${aBoundingBox22} 5]
133 if { ${X1_Box1} == ${X1_Box2} ||
134 ${Y1_Box1} == ${Y1_Box2} ||
135 ${Z1_Box1} == ${Z1_Box2} ||
136 ${X2_Box1} == ${X2_Box2} ||
137 ${Y2_Box1} == ${Y2_Box2} ||
138 ${Z2_Box1} == ${Z2_Box2} ||
140 ${X1_Box12} == ${X1_Box22} ||
141 ${Y1_Box12} == ${Y1_Box22} ||
142 ${Z1_Box12} == ${Z1_Box22} ||
143 ${X2_Box12} == ${X2_Box22} ||
144 ${Y2_Box12} == ${Y2_Box22} ||
145 ${Z2_Box12} == ${Z2_Box22} ||
147 ${X1_Box2} == ${X1_Box22} ||
148 ${Y1_Box2} == ${Y1_Box22} ||
149 ${Z1_Box2} == ${Z1_Box22} ||
150 ${X2_Box2} == ${X2_Box22} ||
151 ${Y2_Box2} == ${Y2_Box22} ||
152 ${Z2_Box2} == ${Z2_Box22} } {
154 puts "X1_Box1=${X1_Box1} Y1_Box1=${Y1_Box1} Z1_Box1=${Z1_Box1} X2_Box1=${X2_Box1} Y2_Box1=${Y2_Box1} Z2_Box1=${Z2_Box1}"
155 puts "X1_Box2=${X1_Box2} Y1_Box2=${Y1_Box2} Z1_Box2=${Z1_Box2} X2_Box2=${X2_Box2} Y2_Box2=${Y2_Box2} Z2_Box2=${Z2_Box2}"
156 puts "X1_Box12=${X1_Box12} Y1_Box12=${Y1_Box12} Z1_Box12=${Z1_Box12} X2_Box12=${X2_Box12} Y2_Box12=${Y2_Box12} Z2_Box12=${Z2_Box12}"
157 puts "X1_Box22=${X1_Box22} Y1_Box22=${Y1_Box22} Z1_Box22=${Z1_Box22} X2_Box22=${X2_Box22} Y2_Box22=${Y2_Box22} Z2_Box22=${Z2_Box22}"
158 puts "Updating all links between attributes of the same document: Error"
162 puts "Updating all links between attributes of the same document: OK"