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