352ffd73 |
1 | puts "================" |
2 | puts "OCC1030" |
3 | puts "================" |
4 | # |
5 | # Note: Numerical control of setting color |
6 | # |
7 | |
8 | pload QAcommands |
9 | |
10 | NewDocument D MDTV-Standard |
11 | UndoLimit D 100 |
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 | # Close/Open transaction |
29 | NewCommand D |
30 | |
31 | set list [OCC1030_AISColor D ${aLabel}] |
32 | set AISColor1 [lindex ${list} [expr [llength ${list}] - 1] ] |
33 | |
34 | # Set a color of the shape as NOC_GREEN |
35 | set GreenColor 229 |
36 | AISColor D ${aLabel} ${GreenColor} |
37 | |
38 | set list [OCC1030_AISColor D ${aLabel}] |
39 | set AISColor2 [lindex ${list} [expr [llength ${list}] - 1] ] |
40 | |
41 | # Close/Open transaction |
42 | NewCommand D |
43 | |
44 | # Undo |
45 | Undo D |
46 | |
47 | # Update the viewer |
48 | AISRepaint D |
49 | |
50 | set list [OCC1030_AISColor D ${aLabel}] |
51 | set AISColor3 [lindex ${list} [expr [llength ${list}] - 1] ] |
52 | |
53 | # Redo |
54 | Redo D |
55 | |
56 | # Update the viewer |
57 | AISRepaint D |
58 | |
59 | set list [OCC1030_AISColor D ${aLabel}] |
60 | set AISColor4 [lindex ${list} [expr [llength ${list}] - 1] ] |
61 | |
62 | # Check the color |
63 | puts "AISColor1 = ${AISColor1}" |
64 | puts "AISColor2 = ${AISColor2}" |
65 | puts "AISColor3 = ${AISColor3}" |
66 | puts "AISColor4 = ${AISColor4}" |
67 | |
68 | set DefaultAISColor 516 |
69 | set status 0 |
70 | if { ${AISColor1} != ${DefaultAISColor} } { |
71 | puts "OCC1030_AISColor command: Error (case 1)" |
72 | set status 1 |
73 | } |
74 | |
75 | if { ${AISColor2} != ${GreenColor} } { |
76 | puts "OCC1030_AISColor command: Error (case 2)" |
77 | set status 1 |
78 | } |
79 | |
80 | if { ${AISColor3} != ${DefaultAISColor} } { |
81 | puts "OCC1030_AISColor command: Error (case 3)" |
82 | set status 1 |
83 | } |
84 | |
85 | if { ${AISColor4} != ${GreenColor} } { |
86 | puts "OCC1030_AISColor command: Error (case 4)" |
87 | set status 1 |
88 | } |
89 | |
90 | if { ${status} == 0} { |
91 | puts "OCC1030_AISColor command: OK" |
92 | } |
93 | |
94 | |