0024927: Getting rid of "Persistent" functionality -- Tests
[occt.git] / tests / caf / named_shape / F9
1 # =================== OCAF ======================
2 # Naming
3 #
4 # Testing purpose: Naming selection mechanism 
5 #                  (name = FILTERBYNEIGHBOURGS)
6 #                  Check type migration
7 # ===============================================
8 # Test case: F9 (testing using AttachShape & ComputeFun)
9 # 1. Create 3 boxes $B1, $B2, $B3
10 # 2. $FS1 = Fuse ($B1, $B2)
11 # 3. $FS2 = Fuse ($B1, $B3)
12 # 4. Make  selections of the face 'fuse2_23'
13 # 5. Modify B2
14 # 6. Recompute
15 # ===============================================
16
17 pload FULL
18 set doc d16
19 NewDocument $doc BinOcaf
20 AddDriver $doc Box Fuse Attach
21 #1.create 3 boxes
22 set B1 [AddBox $doc 100 200 350]
23 set B2 [AddBox $doc 330 330 90]
24 set B3 [AddBox $doc 60 450 150]
25 ComputeFun $doc $B1:1
26 ComputeFun $doc $B2:1
27 ComputeFun $doc $B3:1
28
29 #2. B1 = fuse (B1 B2)
30 set FS1 [AddFuse $doc $B1 $B2]
31 ComputeFun $doc $FS1
32
33 #3. B1 = fuse (B1 B3)
34 set FS2 [AddFuse $doc $B1 $B3]
35 ComputeFun $doc $FS2
36 GetShape $doc $FS2:2 fuse2
37 explode fuse2 f
38
39
40
41 #4. Select fuse2_23 using Attach 
42 set Sel2 [AttachShape $doc fuse2_23 $B1]
43 GetShape $doc $Sel2:1:2 nf23before
44 #nf23before is face
45 set info1 [whatis nf23before]
46
47
48 #5. Modify
49 BoxDZ $doc $B2 125
50
51 #6. Recompute - Alternative way of solving
52 InitLogBook $doc
53 ComputeFun $doc $B1:1
54 ComputeFun $doc $B2:1
55 ComputeFun $doc $B3:1
56 ComputeFun $doc $FS1
57 ComputeFun $doc $FS2
58 ComputeFun $doc $Sel2:1
59 GetShape $doc $Sel2:1:2 nf23after
60 #nf23after is face
61 set info2 [whatis nf23after]
62
63 if { [regexp "shape" $info1] != 1 } {
64     puts "Error : There is not word shape in nf23after"
65 }
66 if { [regexp "FACE" $info1] != 1 } {
67     puts "Error : There is not word FACE in nf23after"
68 }
69 if { [regexp "REVERSED" $info1] != 1 } {
70     puts "Error : There is not word REVERSED in nf23after"
71 }
72 if { [regexp "Modified" $info1] != 1 } {
73     puts "Error : There is not word Modified in nf23after"
74 }
75 if { [regexp "Orientable" $info1] != 1 } {
76     puts "Error : There is not word Orientable in nf23after"
77 }
78
79 if { [regexp "shape" $info2] != 1 } {
80     puts "Error : There is not word shape in nf23before"
81 }
82 if { [regexp "FACE" $info2] != 1 } {
83     puts "Error : There is not word FACE in nf23before"
84 }
85 if { [regexp "REVERSED" $info2] != 1 } {
86     puts "Error : There is not word REVERSED in nf23before"
87 }
88 if { [regexp "Modified" $info2] != 1 } {
89     puts "Error : There is not word Modified in nf23before"
90 }
91 if { [regexp "Orientable" $info2] != 1 } {
92     puts "Error : There is not word Orientable in nf23before"
93 }