0026855: Draw commands to debug Boolean Operations Algorithm
[occt.git] / tests / bugs / caf / bug1032
1 puts "================"
2 puts "OCC1032"
3 puts "================"
4 puts ""
5 #
6 # Note:   Numerical control of setting width
7 #
8
9 pload QAcommands
10
11 NewDocument D BinOcaf
12 UndoLimit D 100
13 NewCommand D
14
15 # Set NamedShape attribute
16 box aBox1 100 200 300
17 set aLabel1 0:2
18 SetShape D ${aLabel1} aBox1
19
20 # Initialize 3D viewer
21 AISInitViewer D
22
23 # Add AISPresentation attribute with parameter NS
24 AISSet D ${aLabel1} NS
25
26 # Close/Open transaction
27 NewCommand D
28
29 set list [OCC1032_AISWidth D ${aLabel1}]
30 set AISWidth1 [lindex ${list} [expr [llength ${list}] - 1] ]
31
32 # Display presentation of NamedShape in the viewer
33 AISDisplay D ${aLabel1}
34
35 # Close/Open transaction
36 NewCommand D
37
38 # Set a width
39 set SetWidth 4.5
40 OCC1032_AISWidth D ${aLabel1} ${SetWidth}
41
42 set list [OCC1032_AISWidth D ${aLabel1}]
43 set AISWidth2 [lindex ${list} [expr [llength ${list}] - 1] ]
44
45 # Close/Open transaction
46 NewCommand D
47
48 # Undo
49 Undo D
50
51 # Update the viewer
52 AISRepaint D
53
54 set list [OCC1032_AISWidth D ${aLabel1}]
55 set AISWidth3 [lindex ${list} [expr [llength ${list}] - 1] ]
56
57 # Redo
58 Redo D
59
60 # Update the viewer
61 AISRepaint D
62
63 set list [OCC1032_AISWidth D ${aLabel1}]
64 set AISWidth4 [lindex ${list} [expr [llength ${list}] - 1] ]
65
66 # Check the mode
67 puts "AISWidth1 = ${AISWidth1}"
68 puts "AISWidth2 = ${AISWidth2}"
69 puts "AISWidth3 = ${AISWidth3}"
70 puts "AISWidth4 = ${AISWidth4}"
71
72 set DefaultAISWidth 0
73 set status 0
74 if { ${AISWidth1} != ${DefaultAISWidth} } {
75         puts "OCC1032_AISWidth command: Error (case 1)"
76         set status 1
77 }
78 if { ${AISWidth2} != ${SetWidth} } {
79         puts "OCC1032_AISWidth command: Error (case 2)"
80         set status 1
81 }
82 if { ${AISWidth3} != ${DefaultAISWidth} } {
83         puts "OCC1032_AISWidth command: Error (case 3)"
84         set status 1
85 }
86 if { ${AISWidth4} != ${SetWidth} } {
87         puts "OCC1032_AISWidth command: Error (case 4)"
88         set status 1
89 }
90
91 if { ${status} == 0} {
92         puts "OCC1032_AISWidth command: OK"
93 }
94