0030690: Draw Harness - provide XDisplay command for displaying XDE document
[occt.git] / tests / v3d / glsl / culldist
1 puts "========"
2 puts "0029295: Visualization, TKOpenGl - provide distance culling option"
3 puts "Check distance culling"
4 puts "========"
5
6 set THE_NB_BOXES 5
7 set THE_COLORS { RED GREEN BLUE1 YELLOW PURPLE1 }
8 set THE_PICK_PNTS1 { {  20  80 } {  60 110 } { 120 140 } { 200 180 } { 300 240 } }
9 set THE_PICK_PNTS2 { { 110 140 } { 130 150 } { 160 170 } { 200 190 } { 240 210 } }
10
11 pload MODELING VISUALIZATION
12 vclear
13 vinit View1
14 vaxo
15 vcamera -persp
16 for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { box b$x $x 0 0 0.5 0.2 0.4; vpoint p$x $x 0 0; vdisplay -mutable p$x; vdisplay -dispMode 1 b$x }
17 for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { vsetcolor b$x [lindex $THE_COLORS $x] }
18 vline l 0 0 0 5 0 0
19 vdisplay -mutable l
20 vfit
21 vzlayer default -culldist 7
22 for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1 $x] rgb name] == "BLACK" } { puts "Error: object is culled" } }
23 vdump $::imagedir/${::casename}_7.png
24
25 vzlayer default -culldist 5
26 for { set x 2 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1 $x] rgb name] == "BLACK" } { puts "Error: object is culled" } }
27 for { set x 0 } { $x < 2 }             { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1 $x] rgb name] != "BLACK" } { puts "Error: object is NOT culled" } }
28 vdump $::imagedir/${::casename}_5.png
29
30 vzoom 0.5
31 vzlayer default -culldist 10
32 for { set x 1 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2 $x] rgb name] == "BLACK" } { puts "Error: object is culled" } }
33 for { set x 0 } { $x < 1 }             { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2 $x] rgb name] != "BLACK" } { puts "Error: object is NOT culled" } }
34 vdump $::imagedir/${::casename}_10.png