0032705: Test - name clashes within temporary files within bugs/caf/bug23766_X
[occt.git] / tests / bugs / caf / bug23766_4
CommitLineData
7dcac1df 1puts "=========="
2puts "OCC23766"
3puts "=========="
4puts ""
5########################################################
7b5e532f 6# Shape orientation processing mechanism, redesign
7dcac1df 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
7b5e532f 18BoxDX D $B2 190; ## set arguments of this function
7dcac1df 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)
7dcac1df 54NewCommand D
30fa5f67 55set aTmpFile ${imagedir}/${casename}.cbf
56SaveAs D $aTmpFile
7dcac1df 57Close D
58##unset D
30fa5f67 59Open $aTmpFile D
60file delete -force $aTmpFile
61
7dcac1df 62GetShape D 0:1:2:1:2 E1
63set info3 [whatis E1]
64## to be: E1 is a shape EDGE FORWARD Modified Orientable
65if { [regexp "FORWARD" $info3] != 1 } {
66 puts "Error: orientation of E1 is incorrect"
67} else {
68 puts "OK: orientation of E1 is correct"
69}
70
71GetShape D 0:1:3:1:2 E2
72set info4 [whatis E2]
73## to be: E2 is a shape EDGE REVERSED Modified Orientable
74if { [regexp "REVERSED" $info4] != 1 } {
75 puts "Error: orientation of E2 is incorrect"
76} else {
77 puts "OK: orientation of E2 is correct"
78}