352ffd73 |
1 | puts "================" |
2 | puts "OCC1034" |
3 | puts "================" |
4 | puts "" |
5 | # |
6 | # Note: Numerical control of setting selection mode |
7 | # |
8 | |
9 | pload QAcommands |
10 | |
11 | NewDocument D MDTV-Standard |
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 [OCC1034_AISSelectionMode D ${aLabel1}] |
30 | set AISSelectionMode1 [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 mode |
39 | set SetSelectionMode 2 |
40 | OCC1034_AISSelectionMode D ${aLabel1} ${SetSelectionMode} |
41 | |
42 | set list [OCC1034_AISSelectionMode D ${aLabel1}] |
43 | set AISSelectionMode2 [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 [OCC1034_AISSelectionMode D ${aLabel1}] |
55 | set AISSelectionMode3 [lindex ${list} [expr [llength ${list}] - 1] ] |
56 | |
57 | # Redo |
58 | Redo D |
59 | |
60 | # Update the viewer |
61 | AISRepaint D |
62 | |
63 | set list [OCC1034_AISSelectionMode D ${aLabel1}] |
64 | set AISSelectionMode4 [lindex ${list} [expr [llength ${list}] - 1] ] |
65 | |
66 | # Check the mode |
67 | puts "AISSelectionMode1 = ${AISSelectionMode1}" |
68 | puts "AISSelectionMode2 = ${AISSelectionMode2}" |
69 | puts "AISSelectionMode3 = ${AISSelectionMode3}" |
70 | puts "AISSelectionMode4 = ${AISSelectionMode4}" |
71 | |
72 | set DefaultAISSelectionMode 0 |
73 | set status 0 |
74 | if { ${AISSelectionMode1} != ${DefaultAISSelectionMode} } { |
75 | puts "OCC1034_AISSelectionMode command: Error (case 1)" |
76 | set status 1 |
77 | } |
78 | if { ${AISSelectionMode2} != ${SetSelectionMode} } { |
79 | puts "OCC1034_AISSelectionMode command: Error (case 2)" |
80 | set status 1 |
81 | } |
82 | if { ${AISSelectionMode3} != ${DefaultAISSelectionMode} } { |
83 | puts "OCC1034_AISSelectionMode command: Error (case 3)" |
84 | set status 1 |
85 | } |
86 | if { ${AISSelectionMode4} != ${SetSelectionMode} } { |
87 | puts "OCC1034_AISSelectionMode command: Error (case 4)" |
88 | set status 1 |
89 | } |
90 | |
91 | if { ${status} == 0} { |
92 | puts "OCC1034_AISSelectionMode command: OK" |
93 | } |
94 | |