40093367 |
1 | #INTERFACE CAF |
2 | # Presentation attributes |
3 | # |
4 | # Testing attribute: TPrsStd_AISPresentation |
5 | # |
6 | # Testing command: AISUnset |
7 | # |
8 | |
9 | puts "caf003-K2" |
10 | |
11 | # Create two boxis |
12 | box aBox1 100 200 300 |
13 | set aLabel1 0:2 |
14 | SetShape D ${aLabel1} aBox1 |
15 | |
16 | box aBox2 50 50 0 100 200 300 |
17 | set aLabel2 0:3 |
18 | SetShape D ${aLabel2} aBox2 |
19 | |
20 | # Initialize 3D viewer |
21 | AISInitViewer D |
22 | |
23 | # Add AISPresentation attribute with parameter NS |
24 | AISSet D ${aLabel1} NS |
25 | AISSet D ${aLabel2} NS |
26 | |
27 | # Set shading mode |
28 | vsetdispmode 1 |
29 | |
30 | # Set a color of the second shape as NOC_GREEN |
31 | AISColor D ${aLabel2} 229 |
32 | |
33 | # Display presentation of NamedShape in the viewer |
34 | AISDisplay D ${aLabel1} |
35 | AISDisplay D ${aLabel2} |
36 | |
37 | # Close/Open transaction |
38 | NewCommand D |
39 | |
40 | # Unset TPrsStd_AISPresentation attribute from ${aLabel1} |
41 | AISUnset D ${aLabel1} |
42 | |
43 | # Close/Open transaction |
44 | NewCommand D |
45 | |
46 | # Undo |
47 | Undo D |
48 | |
49 | # Update the viewer |
50 | AISRepaint D |
51 | |
52 | ###puts "There are two boxis" |
53 | |
54 | # Redo |
55 | Redo D |
56 | |
57 | # Update the viewer |
58 | AISRepaint D |
59 | |
60 | # 15. Get current color of ${aLabel1} |
61 | set IsDone [catch {set aColor [lindex [AISColor D ${aLabel1}] 0]} aResult] |
62 | if { ${IsDone} == 0 } { |
63 | puts ${aResult} |
64 | puts "AISUnset command: Error" |
65 | return |
66 | } else { |
67 | puts "AISUnset command: OK" |
68 | } |
69 | |
70 | puts "There is one box" |