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