61c421bf |
1 | puts "================" |
2 | puts "OCC2932" |
3 | puts "================" |
4 | puts "" |
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 |
e837410d |
12 | NewDocument D BinOcaf |
61c421bf |
13 | UndoLimit D 100 |
14 | |
15 | # Create a label and set attributes |
16 | NewCommand D |
17 | set Label 0:2 |
18 | |
19 | ############################################ |
20 | # Create a box |
21 | set X 10 |
22 | set Y 20 |
23 | set Z 30 |
24 | set DX 100 |
25 | set DY 200 |
26 | set DZ 300 |
27 | box Box ${X} ${Y} ${Z} ${DX} ${DY} ${DZ} |
28 | |
29 | # Set a shape to the label |
30 | set BoxLabel 0:3 |
31 | SetShape D ${BoxLabel} Box |
32 | |
33 | # Set integer attribute |
34 | set Integer 10 |
35 | set IntegerLabel 0:4 |
36 | SetInteger D ${IntegerLabel} ${Integer} |
37 | |
38 | ############################################ |
39 | |
40 | set Real1 300. |
41 | set Real2 400. |
42 | set modified_attribute TDataStd_Real |
43 | |
44 | ############################################ |
45 | # Set TDataStd_Constraint |
46 | Label D ${Label} |
47 | SetConstraint D ${Label} "tan" ${BoxLabel} |
48 | SetConstraint D ${Label} "plane" ${BoxLabel} |
49 | SetConstraint D ${Label} "value" ${IntegerLabel} |
50 | ############################################ |
51 | |
52 | SetReal D ${Label} ${Real1} |
53 | set list [DumpCommand D] |
54 | |
55 | # Open a transaction |
56 | NewCommand D |
57 | set list [DumpCommand D] |
58 | |
59 | ############################################ |
60 | # Set old value for TDataStd_Constraint |
61 | SetConstraint D ${Label} "tan" ${BoxLabel} |
62 | SetConstraint D ${Label} "plane" ${BoxLabel} |
63 | SetConstraint D ${Label} "value" ${IntegerLabel} |
64 | ############################################ |
65 | |
66 | # Set new value for TDataStd_Real |
67 | SetReal D ${Label} ${Real2} |
68 | set list [DumpCommand D] |
69 | |
70 | # Open a transaction |
71 | NewCommand D |
72 | set list [DumpCommand D] |
73 | |
74 | # Checking |
75 | set ll [llength ${list}] |
76 | set good_length 17 |
77 | puts "length = ${ll}" |
78 | puts "good_length = ${good_length}" |
79 | |
80 | if { ${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 | } |