0023087: Upgrade of the OCCT test system
[occt.git] / tests / caf / presentation / C1
1 #INTERFACE CAF
2 # Presentation attributes
3 #
4 # Testing attribute: TPrsStd_AISPresentation
5 #
6 # Testing command:   AISDefaultColor
7 # Testing command:   AISHasOwnColor
8 # Note:   After call of  AISDefaultColor-command : AISHasOwnColor = false ( int 0 )
9 #
10
11 puts "caf003-C1"
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 # Display presentation of NamedShape in the viewer
25 AISDisplay D ${aLabel}
26
27 # Set a color of the shape as NOC_GREEN
28 set GreenColor 229
29 AISColor D ${aLabel} ${GreenColor}
30
31 # Close/Open transaction
32 NewCommand D
33
34 # Check own color of the shape 
35 set HasOwnColor1 [AISHasOwnColor D ${aLabel}]
36
37 # Get current color of the shape 
38 set aColor [lindex [AISColor D ${aLabel}] 0]
39
40 # Set default color of the shape
41 AISDefaultColor D ${aLabel}
42
43 # Close/Open transaction
44 NewCommand D
45
46 # Undo
47 Undo D
48
49 # Update the viewer
50 AISRepaint D
51
52 # Redo
53 Redo D
54
55 # Update the viewer
56 AISRepaint D
57
58 # Check own color of the shape 
59 set HasOwnColor2 [AISHasOwnColor D ${aLabel}]
60
61 puts "It is not necessary to have the photo for this case."
62
63 if { ${HasOwnColor1} == 0 || 
64      ${HasOwnColor2} > 0 } {
65         puts "HasOwnColor1=${HasOwnColor1} HasOwnColor2=${HasOwnColor2}"
66         puts "AISDefaultColor command: Error"
67         return
68 }
69 puts "AISDefaultColor command: OK"