0024696: Lower performance of the new Edge/Edge intersection algorithm
[occt.git] / tests / caf / tree / I2
CommitLineData
40093367 1#INTERFACE CAF
2# Tree construction attributes
3#
4# Testing attribute: TDataStd_TreeNode
5#
6# Testing command: ChildNodeIterate
7#
8# Testing command: NewChild
9# Testing command: AppendNode
10#
11
12puts "caf005-I2"
13set QA_DUP 0
14
15# Add an attribute to a data framework
16set aLabel_Root 0:2
17set aName_Root Label_1
18Label D ${aLabel_Root}
19SetName D ${aLabel_Root} ${aName_Root}
20
21set aName1 Label_1_1
22###set aChild1 [NewChild D ${aLabel_Root}]
23set aChild1 0:2:1
24Label D ${aChild1}
25SetName D ${aChild1} ${aName1}
26
27set aName2 Label_1_2
28###set aChild2 [NewChild D ${aLabel_Root}]
29set aChild2 0:2:2
30Label D ${aChild2}
31SetName D ${aChild2} ${aName2}
32
33set aName3 Label_1_1_1
34###set aChild3 [NewChild D ${aLabel_Root}]
35set aChild3 0:2:3
36Label D ${aChild3}
37SetName D ${aChild3} ${aName3}
38
39set aName4 Label_1_1_2
40###set aChild4 [NewChild D ${aLabel_Root}]
41set aChild4 0:2:4
42Label D ${aChild4}
43SetName D ${aChild4} ${aName4}
44
45set aName5 Label_1_1_3
46###set aChild5 [NewChild D ${aLabel_Root}]
47set aChild5 0:2:5
48Label D ${aChild5}
49SetName D ${aChild5} ${aName5}
50
51set aName6 Label_1_2_1
52###set aChild6 [NewChild D ${aLabel_Root}]
53set aChild6 0:2:6
54Label D ${aChild6}
55SetName D ${aChild6} ${aName6}
56
57set aName7 Label_1_2_2
58###set aChild7 [NewChild D ${aLabel_Root}]
59set aChild7 0:2:7
60Label D ${aChild7}
61SetName D ${aChild7} ${aName7}
62
63SetNode D ${aLabel_Root}
64AppendNode D ${aLabel_Root} ${aChild1}
65AppendNode D ${aLabel_Root} ${aChild2}
66AppendNode D ${aChild1} ${aChild3}
67AppendNode D ${aChild1} ${aChild4}
68AppendNode D ${aChild1} ${aChild5}
69AppendNode D ${aChild2} ${aChild6}
70AppendNode D ${aChild2} ${aChild7}
71
72# Close/Open the transaction
73NewCommand D
74
75# Forget the attribute
76ForgetAll D ${aLabel_Root}
77
78# Close/Open the transaction
79NewCommand D
80
81# Undo-Redo-Undo
82Undo D
83Redo D
84Undo D
85
86# Get a value of the attribute
87set IsDone [catch {set aListChildNodes [ChildNodeIterate D ${aLabel_Root} 0]} aResult]
88if { ${IsDone} != 0 } {
89 puts ${aResult}
90 puts "ChildNodeIterate Doc TreeNode AllLevels=0 : Error"
91 return
92}
93set aListChildNodesLength [llength ${aListChildNodes}]
94if { ${aListChildNodesLength}!=[expr 2 + 0]} {
95 puts "aListChildNodes=${aListChildNodes}"
96 puts "aListChildNodesLength=${aListChildNodesLength}"
97 puts "ChildNodeIterate Doc TreeNode AllLevels=0 : Error"
98 return
99}
100set aFirstChildNode [lindex ${aListChildNodes} 0]
101set aSecondChildNode [lindex ${aListChildNodes} 1]
102if { ${aFirstChildNode}!=${aChild1} ||
103 ${aSecondChildNode}!=${aChild2}} {
104 puts "aFirstChildNode=${aFirstChildNode} aChild1=${aChild1}"
105 puts "aSecondChildNode=${aSecondChildNode} aChild2=${aChild2}"
106 puts "ChildNodeIterate Doc TreeNode AllLevels=0 : Error"
107 return
108}
109
110puts "ChildNodeIterate Doc TreeNode AllLevels=0 : OK"