0024696: Lower performance of the new Edge/Edge intersection algorithm
[occt.git] / tests / caf / basic / H1
CommitLineData
40093367 1#INTERFACE CAF
2# Basic attributes
3#
4# Testing attribute: TDataStd_Axis
5#
6# Testing command: SetAxis
7# Testing command: GetAxis
8#
9
10puts "caf001-H1"
11
12set aTokList { :,}
13
14# Add an attribute to a data framework
15set aSetX1 10
16set aSetY1 20
17set aSetZ1 30
18set aSetDX1 100
19set aSetDY1 200
20set aSetDZ1 300
21line aLine1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
22
23set aDumpLine1 [dump aLine1]
24
25# [llength ${aDumpLine1}] = 14
26# Format of ${aDumpLine1}:
27# *********** Dump of aLine1 *************
28# Line
29# Origin :10, 20, 30
30# Axis :0.267261241912424, 0.534522483824849, 0.801783725737273
31
32set anOriginX_Line1 [lindex [split [lindex ${aDumpLine1} 7] ${aTokList}] 1]
33set anOriginY_Line1 [lindex [split [lindex ${aDumpLine1} 8] ${aTokList}] 0]
34set anOriginZ_Line1 [lindex [split [lindex ${aDumpLine1} 9] ${aTokList}] 0]
35set anAxisDX_Line1 [lindex [split [lindex ${aDumpLine1} 11] ${aTokList}] 1]
36set anAxisDY_Line1 [lindex [split [lindex ${aDumpLine1} 12] ${aTokList}] 0]
37set anAxisDZ_Line1 [lindex [split [lindex ${aDumpLine1} 13] ${aTokList}] 0]
38
39set aLabel 0:2
40SetAxis D ${aLabel} aLine1
41
42# Close/Open the transaction
43NewCommand D
44
45# Forget the attribute
46ForgetAll D ${aLabel}
47
48# Close/Open the transaction
49NewCommand D
50
51# Undo-Redo-Undo
52Undo D
53Redo D
54Undo D
55
56# Get a value of the attribute
57GetAxis D ${aLabel} anAxis1
58
59# [llength ${aDumpAxis1}] = 14
60# Format of ${aDumpAxis1}:
61# *********** Dump of anAxis1 *************
62# Line
63# Origin :10, 20, 30
64# Axis :0.267261241912424, 0.534522483824849, 0.801783725737273
65
66set aDumpAxis1 [dump anAxis1]
67set anOriginX_Axis1 [lindex [split [lindex ${aDumpAxis1} 7] ${aTokList}] 1]
68set anOriginY_Axis1 [lindex [split [lindex ${aDumpAxis1} 8] ${aTokList}] 0]
69set anOriginZ_Axis1 [lindex [split [lindex ${aDumpAxis1} 9] ${aTokList}] 0]
70set anAxisDX_Axis1 [lindex [split [lindex ${aDumpAxis1} 11] ${aTokList}] 1]
71set anAxisDY_Axis1 [lindex [split [lindex ${aDumpAxis1} 12] ${aTokList}] 0]
72set anAxisDZ_Axis1 [lindex [split [lindex ${aDumpAxis1} 13] ${aTokList}] 0]
73
74if { ${anOriginX_Line1} != ${anOriginX_Axis1} ||
75 ${anOriginY_Line1} != ${anOriginY_Axis1} ||
76 ${anOriginZ_Line1} != ${anOriginZ_Axis1} ||
77 ${anAxisDX_Line1} != ${anAxisDX_Axis1} ||
78 ${anAxisDY_Line1} != ${anAxisDY_Axis1} ||
79 ${anAxisDZ_Line1} != ${anAxisDZ_Axis1} } {
80 puts "anOriginX_Line1=${anOriginX_Line1} anOriginX_Axis1=${anOriginX_Axis1}"
81 puts "anOriginY_Line1=${anOriginY_Line1} anOriginY_Axis1=${anOriginY_Axis1}"
82 puts "anOriginZ_Line1=${anOriginZ_Line1} anOriginZ_Axis1=${anOriginZ_Axis1}"
83 puts "anAxisDX_Line1=${anAxisDX_Line1} anAxisDX_Axis1=${anAxisDX_Axis1}"
84 puts "anAxisDY_Line1=${anAxisDY_Line1} anAxisDY_Axis1=${anAxisDY_Axis1}"
85 puts "anAxisDZ_Line1=${anAxisDZ_Line1} anAxisDZ_Axis1=${anAxisDZ_Axis1}"
86 puts "Add TDataStd_Axis attribute: Error"
87 return
88}
89puts "Add TDataStd_Axis attribute: OK"