0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
[occt.git] / tests / caf / presentation / F4
CommitLineData
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
10puts "caf003-F4"
11
12# Create two boxis
13box aBox1 100 200 300
14set aLabel1 0:2
15SetShape D ${aLabel1} aBox1
16
17box aBox2 50 50 0 100 200 300
18set aLabel2 0:3
19SetShape D ${aLabel2} aBox2
20
21# Initialize 3D viewer
22AISInitViewer D
23
24# Add AISPresentation attribute with parameter NS
25AISSet D ${aLabel1} NS
26AISSet D ${aLabel2} NS
27
28# Set shading mode
29vsetdispmode 1
30
aaf8d6a9 31# Set a color of the second shape
32AISColor D ${aLabel2} GREEN
40093367 33
34# Display presentation of NamedShape in the viewer
35AISDisplay D ${aLabel1}
36AISDisplay D ${aLabel2}
37
38# Close/Open transaction
39NewCommand D
40
41# Set a transparency of the second shape
42set SetTransparency 0.9
43AISTransparency D ${aLabel2} ${SetTransparency}
44
45# Close/Open transaction
46NewCommand D
47
48# Undo
49Undo D
50
51# Update the viewer
52AISRepaint D
53
54# Redo
55Redo D
56
57# Update the viewer
58AISRepaint D
59
60# Check the transparency
61###set aTransparency [lindex [AISTransparency D ${aLabel2}] 0]
62set list [AISTransparency D ${aLabel2}]
63set aTransparency [lindex ${list} [expr [llength ${list}] - 1] ]
64
65puts "It is not necessary to have the photo for this case."
66
67if { ${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}
73puts "The box's transparency is ${SetTransparency}; AISTransparency command: OK"