40093367 |
1 | #INTERFACE CAF |
2 | # Presentation attributes |
3 | # |
4 | # Testing attribute: TPrsStd_AISPresentation |
5 | # |
6 | # Testing command: AISMaterial |
7 | # Testing command: AISHasOwnMaterial |
8 | # Note: AISMaterial-command: set AISMaterial and set AISHasOwnMaterial = true ( int 1 ) |
9 | # |
10 | |
11 | puts "caf003-D2" |
12 | |
13 | # Set NamedShape attribute |
14 | box aBox1 100 200 300 |
15 | set aLabel 0:2 |
16 | SetShape D ${aLabel} aBox1 |
17 | |
18 | # Initialize 3D viewer |
19 | AISInitViewer D |
20 | |
21 | # Add AISPresentation attribute with parameter NS |
22 | AISSet D ${aLabel} NS |
23 | |
24 | # Set shading mode |
25 | vsetdispmode 1 |
26 | |
27 | # Display presentation of NamedShape in the viewer |
28 | AISDisplay D ${aLabel} |
29 | |
30 | # Close/Open transaction |
31 | NewCommand D |
32 | |
33 | # Set a material of the shape as NOM_JADE |
34 | set JadeMaterial 18 |
35 | AISMaterial D ${aLabel} ${JadeMaterial} |
36 | |
37 | # Close/Open transaction |
38 | NewCommand D |
39 | |
40 | # Undo |
41 | Undo D |
42 | |
43 | # Update the viewer |
44 | AISRepaint D |
45 | |
46 | # Redo |
47 | Redo D |
48 | |
49 | # Update the viewer |
50 | AISRepaint D |
51 | |
52 | # Check own material |
53 | set HasOwnMaterial [AISHasOwnMaterial D ${aLabel}] |
54 | |
55 | puts "It is not necessary to have the photo for this case." |
56 | |
57 | if { ${HasOwnMaterial} == 0 } { |
58 | puts "HasOwnMaterial=${HasOwnMaterial}" |
59 | puts "There is not own material; AISHasOwnMaterial command: Error" |
60 | return |
61 | } |
62 | puts "There is own material; AISHasOwnMaterial command: OK" |