0024105: ShapeFix algorithm produces not correct result.
[occt.git] / tests / bugs / caf / bug2932_5
CommitLineData
61c421bf 1puts "================"
2puts "OCC2932"
3puts "================"
4puts ""
5#######################################################################################
6# Create Attribute Delta depending on actual change of the attribute
7#######################################################################################
8# Case 3 (TDataStd_Constraint)
9#######################################################################################
10
11# Create a new document and set UndoLimit
12NewDocument D MDTV-Standard
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 integer attribute
34set Integer 10
35set IntegerLabel 0:4
36SetInteger D ${IntegerLabel} ${Integer}
37
38############################################
39
40set Real1 300.
41set Real2 400.
42set modified_attribute TDataStd_Real
43
44############################################
45# Set TDataStd_Constraint
46Label D ${Label}
47SetConstraint D ${Label} "tan" ${BoxLabel}
48SetConstraint D ${Label} "plane" ${BoxLabel}
49SetConstraint D ${Label} "value" ${IntegerLabel}
50############################################
51
52SetReal D ${Label} ${Real1}
53set list [DumpCommand D]
54
55# Open a transaction
56NewCommand D
57set list [DumpCommand D]
58
59############################################
60# Set old value for TDataStd_Constraint
61SetConstraint D ${Label} "tan" ${BoxLabel}
62SetConstraint D ${Label} "plane" ${BoxLabel}
63SetConstraint D ${Label} "value" ${IntegerLabel}
64############################################
65
66# Set new value for TDataStd_Real
67SetReal D ${Label} ${Real2}
68set list [DumpCommand D]
69
70# Open a transaction
71NewCommand D
72set list [DumpCommand D]
73
74# Checking
75set ll [llength ${list}]
76set good_length 17
77puts "length = ${ll}"
78puts "good_length = ${good_length}"
79
80if { ${ll} != ${good_length} } {
81 puts "OCC2932 Error (case 1)"
82} else {
83 set name_attribute [lindex ${list} [expr ${good_length} - 1]]
84 puts "name_attribute = ${name_attribute}"
85 puts "modified_attribute = ${modified_attribute}"
86 if {[string compare ${name_attribute} ${modified_attribute}] == 0} {
87 puts "OCC2932 OK"
88 } else {
89 puts "OCC2932 Error (case 2)"
90 }
91}