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