1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00
occt/tests/v3d/glsl/tiles
osa 3bffef5524 0022582: Visualization - provide an API for dumping a sub-region of the viewport
Graphic3d_Camera definition has been exended by optional Tile property (Graphic3d_CameraTile structure).
V3d_View::ToPixMap() now performs tiled dump when image size exceeds hardware limits.

OpenGl_View::Redraw() - fixed dump of immediate Z layers in no stereo and no MSAA case.

OpenGl_Context now tracks viewport values.
Draw Harness command vdump has been extended with new argument -tileSize.
2016-09-01 13:19:11 +03:00

95 lines
4.0 KiB
Plaintext

puts "========"
puts "Tiled image dump"
puts "========"
set aFontFile ""
catch { set aFontFile [locate_data_file DejaVuSans.ttf] }
pload MODELING VISUALIZATION
box b 2 3 1
box b2 50 20 30
set aLabelFont "Arial"
if { "$aFontFile" != "" } {
vfont add "$aFontFile" SansFont
set aLabelFont "SansFont"
}
vclear
vinit View1
vraytrace 0
vsetgradientbg 180 200 255 180 180 180 2
vsetdispmode 0
vdisplay -dispMode 1 b
vfit
vrotate 0.5 0 0
vzbufftrihedron
catch { vzlayer del 1 }
vzlayer add 1
vzlayer enable 1 depthclear
vtrihedron trh
vdisplay -noupdate trh -layer 1 -trsfPers trihedron -trsfPersPos 1 1 100
text2brep tcc "Center" -font $aLabelFont -height 30 -pos -40 0 0
vdisplay -noupdate tcc -2d -layer 1 -dispMode 1
polyline lcc -50 -50 0 -50 50 0 50 50 0 50 0 0 0 -50 0 -50 -50 0
vdisplay -noupdate lcc -2d -layer 1
vsetwidth -noupdate lcc 2
text2brep tbl "Bottom-Left" -font $aLabelFont -height 30 -pos 0 3 5
vdisplay -noupdate tbl -2d -layer 1 -trsfPersPos -1 -1 -dispMode 1
polyline lbl 0 0 0 0 100 0 100 100 0 100 50 0 50 0 0 0 0 0
vdisplay -noupdate lbl -2d -layer 1 -trsfPersPos -1 -1
vsetwidth -noupdate lbl 2
text2brep ttl "Top-Left" -font $aLabelFont -height 30 -pos 0 -30 0
vdisplay -noupdate ttl -2d -layer 1 -trsfPersPos -1 1 -dispMode 1
polyline ltl 0 -100 0 0 0 0 100 0 0 100 -50 0 50 -100 0 0 -100 0
vdisplay -noupdate ltl -2d -layer 1 -trsfPersPos -1 1
vsetwidth -noupdate ltl 2
text2brep ttr "Top-Right" -font $aLabelFont -height 30 -pos -130 -30 0
vdisplay -noupdate ttr -2d -layer 1 -trsfPersPos 1 1 -dispMode 1
polyline ltr -100 -100 0 -100 0 0 0 0 0 0 -50 0 -50 -100 0 -100 -100 0
vdisplay -noupdate ltr -2d -layer 1 -trsfPersPos 1 1
vsetwidth -noupdate ltr 2
text2brep tbr "Bottom-Right" -font $aLabelFont -height 30 -pos -180 3 0
vdisplay -noupdate tbr -2d -layer 1 -trsfPersPos 1 -1 -dispMode 1
polyline lbr -100 0 0 -100 100 0 0 100 0 0 50 0 -50 0 0 -100 0 0
vdisplay -noupdate lbr -2d -layer 1 -trsfPersPos 1 -1
vsetwidth -noupdate lbr 2
vdrawtext t2 "Label" -pos 1 0 1 -font $aLabelFont
vdisplay b2 -trsfPers zoom -trsfPersPos 1 0 1
vdump $::imagedir/${::casename}_409x409@tile0.png
vdump $::imagedir/${::casename}_409x409@tile128.png -tileSize 128
vdump $::imagedir/${::casename}_409x409@tile1024.png -tileSize 1024
vdump $::imagedir/${::casename}_1920x1080@tile0.png -width 1920 -height 1920
vdump $::imagedir/${::casename}_1920x1080@tile128.png -width 1920 -height 1920 -tileSize 128
vdump $::imagedir/${::casename}_1920x1080@tile1024.png -width 1920 -height 1920 -tileSize 1024
diffimage $::imagedir/${::casename}_409x409@tile0.png $::imagedir/${::casename}_409x409@tile128.png 0 0 0 $::imagedir/${::casename}_409x409@tile128diff.png
# check dump with stereo
vstereo anaglyph
vdump $::imagedir/${::casename}_409x409@stereotile0.png -stereo blend
vdump $::imagedir/${::casename}_409x409@stereotile128.png -stereo blend -tileSize 128
vdump $::imagedir/${::casename}_409x409@stereotile1024.png -stereo blend -tileSize 1024
vdump $::imagedir/${::casename}_1920x1080@stereotile0.png -width 1920 -height 1920 -stereo blend
vdump $::imagedir/${::casename}_1920x1080@stereotile128.png -width 1920 -height 1920 -stereo blend -tileSize 128
vdump $::imagedir/${::casename}_1920x1080@stereotile1024.png -width 1920 -height 1920 -stereo blend -tileSize 1024
diffimage $::imagedir/${::casename}_409x409@stereotile0.png $::imagedir/${::casename}_409x409@stereotile128.png 0 0 0 $::imagedir/${::casename}_409x409@stereotile128diff.png
# check dump with Ray Tracing
vraytrace 1
vdump $::imagedir/${::casename}_409x409@rttile0.png -stereo blend
vdump $::imagedir/${::casename}_409x409@rttile128.png -stereo blend -tileSize 128
vdump $::imagedir/${::casename}_409x409@rttile1024.png -stereo blend -tileSize 1024
vdump $::imagedir/${::casename}_1920x1080@rttile0.png -width 1920 -height 1920 -stereo blend
vdump $::imagedir/${::casename}_1920x1080@rttile128.png -width 1920 -height 1920 -stereo blend -tileSize 128
vdump $::imagedir/${::casename}_1920x1080@rttile1024.png -width 1920 -height 1920 -stereo blend -tileSize 1024
vraytrace 0