0028095: Draw Harness, ViewerTest - use RGBA format instead of BGRA within vreadpixel
[occt.git] / tests / caf / named_shape / B1
CommitLineData
40093367 1#INTERFACE CAF
2# NamedShape
3#
4# Testing attribute: TNaming_NamedShape
5#
6# Testing command: NewShape
7#
8
9puts "caf002-B1"
10
11# Create a box
12set aSetX1 10
13set aSetY1 20
14set aSetZ1 30
15set aSetDX1 100
16set aSetDY1 200
17set aSetDZ1 300
18
19box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
20
21set aBoundingBox1 [bounding aBox1]
22set X1_Box1 [lindex ${aBoundingBox1} 0]
23set Y1_Box1 [lindex ${aBoundingBox1} 1]
24set Z1_Box1 [lindex ${aBoundingBox1} 2]
25set X2_Box1 [lindex ${aBoundingBox1} 3]
26set Y2_Box1 [lindex ${aBoundingBox1} 4]
27set Z2_Box1 [lindex ${aBoundingBox1} 5]
28
29# Create a label
30set aLabel 0:2
31Label D ${aLabel}
32
33# Close/Open transaction
34NewCommand D
35
36# Set a shape to the label
37NewShape D ${aLabel} aBox1
38
39# Close/Open transaction
40NewCommand D
41
42# Undo
43Undo D
44
45# Get a shape from the label
46catch {GetShape D ${aLabel} aBox2}
47
48# Redo
49Redo D
50
51# Get a shape from the label
52GetShape D ${aLabel} aBox3
53
54set aBoundingBox3 [bounding aBox3]
55set X1_Box3 [lindex ${aBoundingBox3} 0]
56set Y1_Box3 [lindex ${aBoundingBox3} 1]
57set Z1_Box3 [lindex ${aBoundingBox3} 2]
58set X2_Box3 [lindex ${aBoundingBox3} 3]
59set Y2_Box3 [lindex ${aBoundingBox3} 4]
60set Z2_Box3 [lindex ${aBoundingBox3} 5]
61
62if { ${X1_Box1} != ${X1_Box3} ||
63 ${Y1_Box1} != ${Y1_Box3} ||
64 ${Z1_Box1} != ${Z1_Box3} ||
65 ${X2_Box1} != ${X2_Box3} ||
66 ${Y2_Box1} != ${Y2_Box3} ||
67 ${Z2_Box1} != ${Z2_Box3} ||
68 [info exists aBox2] } {
69 puts "X1_Box1=${X1_Box1} X1_Box3=${X1_Box3}"
70 puts "Y1_Box1=${Y1_Box1} Y1_Box3=${Y1_Box3}"
71 puts "Z1_Box1=${Z1_Box1} Z1_Box3=${Z1_Box3}"
72 puts "X2_Box1=${X2_Box1} X2_Box3=${X2_Box3}"
73 puts "Y2_Box1=${Y2_Box1} Y2_Box3=${Y2_Box3}"
74 puts "Z2_Box1=${Z2_Box1} Z2_Box3=${Z2_Box3}"
75 puts "NewShape command: Error"
76 return
77}
78
79puts "NewShape command: OK"