Adjusting bugs group for current state of OCCT
[occt.git] / tests / bugs / caf / bug1029
CommitLineData
352ffd73 1puts "================"
2puts "OCC1029"
3puts "================"
4puts ""
5#
6# Note: Numerical control of setting transparency
7#
8
9pload QAcommands
10
11NewDocument D MDTV-Standard
12UndoLimit D 100
13NewCommand D
14
15# Create two boxis
16box aBox1 100 200 300
17set aLabel1 0:2
18SetShape D ${aLabel1} aBox1
19
20box aBox2 50 50 0 100 200 300
21set aLabel2 0:3
22SetShape D ${aLabel2} aBox2
23
24# Initialize 3D viewer
25AISInitViewer D
26
27# Add AISPresentation attribute with parameter NS
28AISSet D ${aLabel1} NS
29AISSet D ${aLabel2} NS
30
31# Set shading mode
32vsetdispmode 1
33
34# Set a color of the second shape as NOC_GREEN
35AISColor D ${aLabel2} 229
36
37# Display presentation of NamedShape in the viewer
38AISDisplay D ${aLabel1}
39AISDisplay D ${aLabel2}
40
41# Close/Open transaction
42NewCommand D
43
44# Set a transparency of the second shape
45set SetTransparency 0.9
46OCC1029_AISTransparency D ${aLabel2} ${SetTransparency}
47
48set list [OCC1029_AISTransparency D ${aLabel2}]
49set Transparency1 [lindex ${list} [expr [llength ${list}] - 1] ]
50
51# Close/Open transaction
52NewCommand D
53
54# Undo
55Undo D
56
57# Update the viewer
58AISRepaint D
59
60set list [OCC1029_AISTransparency D ${aLabel2}]
61set Transparency2 [lindex ${list} [expr [llength ${list}] - 1] ]
62
63# Redo
64Redo D
65
66# Update the viewer
67AISRepaint D
68
69set list [OCC1029_AISTransparency D ${aLabel2}]
70set Transparency3 [lindex ${list} [expr [llength ${list}] - 1] ]
71
72# Check the transparency
73puts "Transparency1 = ${Transparency1}"
74puts "Transparency2 = ${Transparency2}"
75puts "Transparency3 = ${Transparency3}"
76
77set status 0
78if { ${Transparency1} != ${SetTransparency} } {
79 puts "OCC1029_Transparency command: Error (case 1)"
80 set status 1
81}
82
83if { ${Transparency2} != 0. } {
84 puts "OCC1029_Transparency command: Error (case 2)"
85 set status 1
86}
87
88if { ${Transparency3} != ${SetTransparency} } {
89 puts "OCC1029_Transparency command: Error (case 3)"
90 set status 1
91}
92
93if { ${status} == 0} {
94 puts "OCC1029_Transparency command: OK"
95}
96