a87752f3 |
1 | puts "===========" |
2 | puts "OCC73" |
3 | puts "BUC61050" |
4 | puts "===========" |
5 | |
6 | pload QAcommands |
7 | |
e837410d |
8 | NewDocument D BinOcaf |
a87752f3 |
9 | UndoLimit D 10 |
10 | |
11 | # Close/Open transaction |
12 | NewCommand D |
13 | |
14 | # Set NamedShape attribute |
15 | box aBox1 100 200 300 |
16 | set aLabel 0:2 |
17 | SetShape D ${aLabel} aBox1 |
18 | |
19 | # Initialize 3D viewer |
20 | AISInitViewer D |
21 | |
22 | # Add AISPresentation attribute with parameter NS |
23 | AISSet D ${aLabel} NS |
24 | |
25 | # Display presentation of NamedShape in the viewer |
26 | AISDisplay D ${aLabel} |
27 | |
28 | # Get a selection mode of the shape |
29 | set SelectionMode0 [OCC73_SelectionMode D ${aLabel}] |
30 | |
31 | # Set a selection mode of the shape as 1 |
32 | set SelectionMode 1 |
33 | OCC73_SelectionMode D ${aLabel} ${SelectionMode} |
34 | |
35 | # Get a selection mode of the shape |
36 | set SelectionMode1 [OCC73_SelectionMode D ${aLabel}] |
37 | |
38 | # Close/Open transaction |
39 | NewCommand D |
40 | |
41 | # Forget the attribute |
42 | ForgetAll D ${aLabel} |
43 | NewCommand D |
44 | |
45 | # Undo-Redo-Undo |
46 | Undo D |
47 | Redo D |
48 | Undo D |
49 | |
50 | # Get a selection mode of the shape |
51 | set IsDone [catch {set SelectionMode2 [OCC73_SelectionMode D ${aLabel}]} aResult] |
52 | |
53 | if { ${IsDone} != 0 } { |
54 | puts "OCC73: Error" |
55 | puts ${aResult} |
56 | } else { |
57 | |
58 | puts "SelectionMode0 = ${SelectionMode0}" |
59 | puts "SelectionMode1 = ${SelectionMode1}" |
60 | puts "SelectionMode = ${SelectionMode}" |
61 | puts "SelectionMode2 = ${SelectionMode2}" |
62 | |
63 | if {${SelectionMode0} == ${SelectionMode1} || ${SelectionMode1} != ${SelectionMode} || ${SelectionMode1} != ${SelectionMode2}} then { |
64 | puts "OCC73: Error" |
65 | } else { |
66 | puts "OCC73: OK" |
67 | } |
68 | |
69 | } |