40093367 |
1 | #INTERFACE CAF |
2 | # Presentation attributes |
3 | # |
4 | # Testing attribute: TPrsStd_AISPresentation |
5 | # |
6 | # Testing command: AISTransparency |
7 | # Note: Numerical control of setting transparency |
8 | # |
9 | |
10 | puts "caf003-F4" |
11 | |
12 | # Create two boxis |
13 | box aBox1 100 200 300 |
14 | set aLabel1 0:2 |
15 | SetShape D ${aLabel1} aBox1 |
16 | |
17 | box aBox2 50 50 0 100 200 300 |
18 | set aLabel2 0:3 |
19 | SetShape D ${aLabel2} aBox2 |
20 | |
21 | # Initialize 3D viewer |
22 | AISInitViewer D |
23 | |
24 | # Add AISPresentation attribute with parameter NS |
25 | AISSet D ${aLabel1} NS |
26 | AISSet D ${aLabel2} NS |
27 | |
28 | # Set shading mode |
29 | vsetdispmode 1 |
30 | |
aaf8d6a9 |
31 | # Set a color of the second shape |
32 | AISColor D ${aLabel2} GREEN |
40093367 |
33 | |
34 | # Display presentation of NamedShape in the viewer |
35 | AISDisplay D ${aLabel1} |
36 | AISDisplay D ${aLabel2} |
37 | |
38 | # Close/Open transaction |
39 | NewCommand D |
40 | |
41 | # Set a transparency of the second shape |
42 | set SetTransparency 0.9 |
43 | AISTransparency D ${aLabel2} ${SetTransparency} |
44 | |
45 | # Close/Open transaction |
46 | NewCommand D |
47 | |
48 | # Undo |
49 | Undo D |
50 | |
51 | # Update the viewer |
52 | AISRepaint D |
53 | |
54 | # Redo |
55 | Redo D |
56 | |
57 | # Update the viewer |
58 | AISRepaint D |
59 | |
60 | # Check the transparency |
61 | ###set aTransparency [lindex [AISTransparency D ${aLabel2}] 0] |
62 | set list [AISTransparency D ${aLabel2}] |
63 | set aTransparency [lindex ${list} [expr [llength ${list}] - 1] ] |
64 | |
65 | puts "It is not necessary to have the photo for this case." |
66 | |
67 | if { ${aTransparency} != ${SetTransparency} } { |
68 | puts "SetTransparency=${SetTransparency}" |
69 | puts "aTransparency=${aTransparency}" |
70 | puts "The box's transparency is not ${SetTransparency}; AISTransparency command: Error" |
71 | return |
72 | } |
73 | puts "The box's transparency is ${SetTransparency}; AISTransparency command: OK" |