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