1 # =================== OCAF ======================
4 # Testing purpose: Naming selection mechanism
5 # (name = FILTERBYNEIGHBOURGS)
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'
15 # ===============================================
19 NewDocument $doc BinOcaf
20 AddDriver $doc Box Fuse Attach
22 set B1 [AddBox $doc 100 200 350]
23 set B2 [AddBox $doc 330 330 90]
24 set B3 [AddBox $doc 60 450 150]
30 set FS1 [AddFuse $doc $B1 $B2]
34 set FS2 [AddFuse $doc $B1 $B3]
36 GetShape $doc $FS2:2 fuse2
41 #4. Select fuse2_23 using Attach
42 set Sel2 [AttachShape $doc fuse2_23 $B1]
43 GetShape $doc $Sel2:1:2 nf23before
45 set info1 [whatis nf23before]
51 #6. Recompute - Alternative way of solving
58 ComputeFun $doc $Sel2:1
59 GetShape $doc $Sel2:1:2 nf23after
61 set info2 [whatis nf23after]
63 if { [regexp "shape" $info1] != 1 } {
64 puts "Error : There is not word shape in nf23after"
66 if { [regexp "FACE" $info1] != 1 } {
67 puts "Error : There is not word FACE in nf23after"
69 if { [regexp "REVERSED" $info1] != 1 } {
70 puts "Error : There is not word REVERSED in nf23after"
72 if { [regexp "Modified" $info1] != 1 } {
73 puts "Error : There is not word Modified in nf23after"
75 if { [regexp "Orientable" $info1] != 1 } {
76 puts "Error : There is not word Orientable in nf23after"
79 if { [regexp "shape" $info2] != 1 } {
80 puts "Error : There is not word shape in nf23before"
82 if { [regexp "FACE" $info2] != 1 } {
83 puts "Error : There is not word FACE in nf23before"
85 if { [regexp "REVERSED" $info2] != 1 } {
86 puts "Error : There is not word REVERSED in nf23before"
88 if { [regexp "Modified" $info2] != 1 } {
89 puts "Error : There is not word Modified in nf23before"
91 if { [regexp "Orientable" $info2] != 1 } {
92 puts "Error : There is not word Orientable in nf23before"