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