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