0031221: Visualization - selection filter in context
[occt.git] / tests / bugs / vis / bug26028
1 puts "============="
2 puts "Drawing mesh as closed object."
3 puts "============="
4 puts ""
5
6 pload XDE
7
8 set aMeshFile [locate_data_file sh1.stl]
9
10 vclear
11 vinit View1
12 vaxo
13
14 meshfromstl  m0 "$aMeshFile"
15 vsetdispmode m0 2
16
17 vsetlocation -noupdate m0 -100 0 0
18 meshfromstl m1 "$aMeshFile"
19 meshcolors  m1 elem1 0
20 vsetlocation -noupdate m1    0 0 0
21
22 meshfromstl m2 "$aMeshFile"
23 meshcolors  m2 elem2 0
24 vsetlocation -noupdate m2  100 0 0
25
26 meshfromstl m3 "$aMeshFile"
27 meshcolors  m3 nodal 1
28 vsetlocation -noupdate m3    0 0 100
29
30 meshfromstl m4 "$aMeshFile"
31 meshcolors  m4 nodaltex 1
32 vsetlocation -noupdate m4  100 0 100
33 vfit
34
35 vclipplane create p
36 vclipplane change p equation 0 1 0 0
37 vclipplane change p capping on
38 vclipplane change p capping color 0.9 0.9 0.9
39 vclipplane set    p view Driver1/Viewer1/View1
40
41 for {set i 0} {$i < 5} {incr i} { meshclosed m$i 0 }
42 vdump ${imagedir}/${casename}_open.png
43
44 for {set i 0} {$i < 5} {incr i} { meshclosed m$i 1 }
45 set aColor0 [vreadpixel 125 200 rgb name]
46 set aColor1 [vreadpixel 225 300 rgb name]
47 set aColor2 [vreadpixel 325 325 rgb name]
48 set aColor3 [vreadpixel 225 150 rgb name]
49 set aColor4 [vreadpixel 325 200 rgb name]
50
51 # note that aColor2 is not expected to be capped
52 if { "$aColor0" != "GRAY72" || "$aColor1" != "GRAY72" || "$aColor2" == "GRAY72" || "$aColor3" != "GRAY72" || "$aColor4" != "GRAY72" } {
53   puts "Error: capping color does not match"
54 }
55
56 vdump ${imagedir}/${casename}_closed.png