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