0014531: Boolean Operation Algorithm fails
[occt.git] / tests / bugs / caf / bug2932_12
CommitLineData
61c421bf 1puts "================"
2puts "OCC2932"
3puts "================"
4puts ""
5#######################################################################################
6# Create Attribute Delta depending on actual change of the attribute
7#######################################################################################
8# Case 10 (TDataStd_PatternStd)
9#######################################################################################
10
11# Create a new document and set UndoLimit
e837410d 12NewDocument D BinOcaf
61c421bf 13UndoLimit D 100
14
15# Create a label and set attributes
16NewCommand D
17set Label 0:2
18
19############################################
20# Create a box
21set X 10
22set Y 20
23set Z 30
24set DX 100
25set DY 200
26set DZ 300
27box Box ${X} ${Y} ${Z} ${DX} ${DY} ${DZ}
28
29# Set a shape to the label
30set BoxLabel 0:3
31SetShape D ${BoxLabel} Box
32
33# Set a real attribute
34set RealLabel 0:4
35set RealPattern 123.456789
36SetReal D ${RealLabel} ${RealPattern}
37
38# Set an integer attribute
39set IntegerLabel 0:5
40set IntegerPattern 123456789
41SetInteger D ${IntegerLabel} ${IntegerPattern}
42
43# Set a signature
44set signature 1
45############################################
46
47set Real1 300.
48set Real2 400.
49set modified_attribute TDataStd_Real
50
51############################################
52# Set TDataStd_PatternStd
53Label D ${Label}
54SetPattern D ${Label} ${signature} ${BoxLabel} ${RealLabel} ${IntegerLabel}
55############################################
56
57SetReal D ${Label} ${Real1}
58set list [DumpCommand D]
59
60# Open a transaction
61NewCommand D
62set list [DumpCommand D]
63
64############################################
65# Set old value for TDataStd_PatternStd
66SetPattern D ${Label} ${signature} ${BoxLabel} ${RealLabel} ${IntegerLabel}
67############################################
68
69# Set new value for TDataStd_Real
70SetReal D ${Label} ${Real2}
71set list [DumpCommand D]
72
73# Open a transaction
74NewCommand D
75set list [DumpCommand D]
76
77# Checking
78set ll [llength ${list}]
79set good_length 17
80puts "length = ${ll}"
81puts "good_length = ${good_length}"
82
83if { ${ll} != ${good_length} } {
84 puts "OCC2932 Error (case 1)"
85} else {
86 set name_attribute [lindex ${list} [expr ${good_length} - 1]]
87 puts "name_attribute = ${name_attribute}"
88 puts "modified_attribute = ${modified_attribute}"
89 if {[string compare ${name_attribute} ${modified_attribute}] == 0} {
90 puts "OCC2932 OK"
91 } else {
92 puts "OCC2932 Error (case 2)"
93 }
94}