0031939: Coding - correction of spelling errors in comments [part 7]
[occt.git] / tests / bugs / caf / bug23766_5
CommitLineData
7dcac1df 1puts "=========="
2puts "OCC23766"
3puts "=========="
4puts ""
5########################################################
7b5e532f 6# Shape orientation processing mechanism, redesign
7dcac1df 7########################################################
8
9## test for keeping Orientation (std)
10
11erase
e837410d 12NewDocument D BinOcaf
7dcac1df 13#1 - create box
14NewCommand D
15set B2 [AddObject D]; ## add object
16set F2 [AddFunction D $B2 Box]; ## add function
7b5e532f 17BoxDX D $B2 190; ## set arguments of this function
7dcac1df 18BoxDY D $B2 290
19BoxDZ D $B2 390
20InitLogBook D; ## initialize (clean) internal maps of labels
21AddDriver D Box Attach
22ComputeFun D $F2; ## compute the function
23GetShape D $F2:2 Box2; ## check result
24
25#2 - make selections keeping orientation
26explode Box2 F
27explode Box2_1 E
28explode Box2_3 E
29don Box2_1_1 Box2_3_4
30set Sel1 [AttachShape D Box2_1_1 ${B2} ${B2} 1]; ## set attachment keeping orientation of the edge
31set Sel2 [AttachShape D Box2_3_4 ${B2} ${B2} 1]; ## set attachment keeping orientation of the edge
32
33#3 - check orientation of the selected shapes
34GetShape D 0:1:2:1:2 E1
35set info1 [whatis E1]
36## to be: E1 is a shape EDGE FORWARD Modified Orientable
37if { [regexp "FORWARD" $info1] != 1 } {
38 puts "Error: orientation of E1 is incorrect"
39} else {
40 puts "OK: orientation of E1 is correct"
41}
42
43GetShape D 0:1:3:1:2 E2
44set info2 [whatis E2]
45## to be: E2 is a shape EDGE REVERSED Modified Orientable
46if { [regexp "REVERSED" $info2] != 1 } {
47 puts "Error: orientation of E2 is incorrect"
48} else {
49 puts "OK: orientation of E2 is correct"
50}
51
52#4 - test persistence: check orientation after retrieving (to be the same as before)
e837410d 53file delete -force ${imagedir}/bug23766_ttt1.cbf
7dcac1df 54NewCommand D
e837410d 55SaveAs D ${imagedir}/bug23766_ttt1.cbf
7dcac1df 56Close D
57##unset D
e837410d 58Open ${imagedir}/bug23766_ttt1.cbf D
7dcac1df 59GetShape D 0:1:2:1:2 E1
60set info3 [whatis E1]
61## to be: E1 is a shape EDGE FORWARD Modified Orientable
62if { [regexp "FORWARD" $info3] != 1 } {
63 puts "Error: orientation of E1 is incorrect"
64} else {
65 puts "OK: orientation of E1 is correct"
66}
67
68GetShape D 0:1:3:1:2 E2
69set info4 [whatis E2]
70## to be: E2 is a shape EDGE REVERSED Modified Orientable
71if { [regexp "REVERSED" $info4] != 1 } {
72 puts "Error: orientation of E2 is incorrect"
73} else {
74 puts "OK: orientation of E2 is correct"
75}