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