0024696: Lower performance of the new Edge/Edge intersection algorithm
[occt.git] / tests / caf / bugs / A7
CommitLineData
40093367 1#INTERFACE CAF
2puts "================"
3puts "OCC1228"
4puts "================"
5puts ""
6
7# Basic attributes
8#
9# Testing attribute: TDataStd_Point
10#
11# Testing command: SetPoint
12# Testing command: GetPoint
13#
14
15# ANALOG: puts "caf001-G3"
16
17# Create a new document and set UndoLimit
18NewDocument Doc BinOcaf
19UndoLimit Doc 100
20
21# Open a transaction
22NewCommand Doc
23
24set aTokList { :,}
25
26# Add an attribute to a data framework
27set aSetX1 10
28set aSetY1 20
29set aSetZ1 30
30point aPoint1 ${aSetX1} ${aSetY1} ${aSetZ1}
31
32set aDumpPoint1 [dump aPoint1]
33
34# [llength ${aDumpPoint1}] = 10
35# Format of ${aDumpPoint1}:
36# *********** Dump of aPoint1 *************
37# Point : 1.000000000000000e+01, 2.000000000000000e+01, 3.000000000000000e+01
38
39set X_Point1 [lindex [split [lindex ${aDumpPoint1} 7] ${aTokList}] 0]
40set Y_Point1 [lindex [split [lindex ${aDumpPoint1} 8] ${aTokList}] 0]
41set Z_Point1 [lindex [split [lindex ${aDumpPoint1} 9] ${aTokList}] 0]
42
43set aLabel 0:2
44SetPoint Doc ${aLabel} aPoint1
45
46# Close/Open the transaction
47NewCommand Doc
48
49# Save the document
8418c617 50set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf
40093367 51file delete ${aFile}
52catch {SaveAs Doc ${aFile}}
53if { ![file exists ${aFile}] } {
54 puts "There is not ${aFile} file; SaveAs command: Error"
55 puts "OCC1228: ERROR (case 1)"
56}
57#catch {exec chmod 777 ${aFile}}
58
59# Restore the document
60Close Doc
61catch {Open ${aFile} DDoc}
62
63# Get a value of the attribute
64set aGetAttr3 ""
65set IsDone [catch {set aGetAttr3 [GetPoint DDoc ${aLabel}]} aResult]
66if { ${IsDone} != 0 } {
67 puts ${aResult}
68 puts "Get a value of TDataStd_Point attribute from restoring document: Error"
69 puts "OCC1228: ERROR (case 2)"
70}
71catch {GetPoint DDoc ${aLabel} aPoint5}
72
73set aDumpPoint5 [dump aPoint5]
74set X_Point5 [lindex [split [lindex ${aDumpPoint5} 7] ${aTokList}] 0]
75set Y_Point5 [lindex [split [lindex ${aDumpPoint5} 8] ${aTokList}] 0]
76set Z_Point5 [lindex [split [lindex ${aDumpPoint5} 9] ${aTokList}] 0]
77
78if { ${X_Point1} != ${X_Point5} ||
79 ${Y_Point1} != ${Y_Point5} ||
80 ${Z_Point1} != ${Z_Point5} } {
81 puts "X_Point1=${X_Point1} X_Point5=${X_Point5}"
82 puts "Y_Point1=${Y_Point1} Y_Point5=${Y_Point5}"
83 puts "Z_Point1=${Z_Point1} Z_Point5=${Z_Point5}"
84 puts "Get a value of TDataStd_Point attribute from restoring document: Error"
85 puts "OCC1228: ERROR (case 3)"
86} else {
87 puts "Get a value of TDataStd_Point attribute from restoring document: OK"
88 puts "OCC1228: OK"
89}