0027860: Visualization - clean up Transformation Persistence API
[occt.git] / tests / v3d / glsl / tiles
1 puts "========"
2 puts "Tiled image dump"
3 puts "========"
4
5 set aFontFile ""
6 catch { set aFontFile [locate_data_file DejaVuSans.ttf] }
7
8 pload MODELING VISUALIZATION
9 box b 2 3 1
10 box b2 50 20 30
11
12 set aLabelFont "Arial"
13 if { "$aFontFile" != "" } {
14   vfont add "$aFontFile" SansFont
15   set aLabelFont "SansFont"
16 }
17
18 vclear
19 vinit View1
20 vraytrace 0
21 vsetgradientbg 180 200 255 180 180 180 2
22 vsetdispmode 0
23 vdisplay -dispMode 1 b
24 vfit
25 vrotate 0.5 0 0
26 vzbufftrihedron
27
28 catch { vzlayer del 1 }
29 vzlayer add 1
30 vzlayer enable 1 depthclear
31
32 vtrihedron trh
33 vdisplay  -noupdate trh -layer 1 -trihedron topRight 100 100
34
35 text2brep tcc "Center" -font $aLabelFont -height 30 -pos -40 0 0
36 vdisplay  -noupdate tcc -2d center -layer 1 -dispMode 1
37 polyline  lcc -50 -50 0 -50 50 0 50 50 0 50 0 0 0 -50 0 -50 -50 0
38 vdisplay  -noupdate lcc -2d center -layer 1
39 vsetwidth -noupdate lcc 2
40
41 text2brep tbl "Bottom-Left" -font $aLabelFont -height 30 -pos 0 3 5
42 vdisplay  -noupdate tbl -2d bottomLeft -layer 1 -dispMode 1
43 polyline  lbl 0 0 0 0 100 0 100 100 0 100 50 0 50 0 0 0 0 0
44 vdisplay  -noupdate lbl -2d bottomLeft -layer 1
45 vsetwidth -noupdate lbl 2
46
47 text2brep ttl "Top-Left" -font $aLabelFont -height 30 -pos 0 -30 0
48 vdisplay  -noupdate ttl -2d topLeft -layer 1 -dispMode 1
49 polyline  ltl 0 -100 0 0 0 0 100 0 0 100 -50 0 50 -100 0 0 -100 0
50 vdisplay  -noupdate ltl -2d topLeft -layer 1
51 vsetwidth -noupdate ltl 2
52
53 text2brep ttr "Top-Right" -font $aLabelFont -height 30 -pos -130 -30 0
54 vdisplay  -noupdate ttr -2d topRight -layer 1 -dispMode 1
55 polyline  ltr -100 -100 0 -100 0 0 0 0 0 0 -50 0 -50 -100 0 -100 -100 0
56 vdisplay  -noupdate ltr -2d topRight -layer 1
57 vsetwidth -noupdate ltr 2
58
59 text2brep tbr "Bottom-Right" -font $aLabelFont -height 30 -pos -180 3 0
60 vdisplay  -noupdate tbr -2d bottomRight -layer 1 -dispMode 1
61 polyline  lbr -100 0 0 -100 100 0 0 100 0 0 50 0 -50 0 0 -100 0 0
62 vdisplay  -noupdate lbr -2d bottomRight -layer 1
63 vsetwidth -noupdate lbr 2
64
65 vdrawtext t2 "Label" -pos 1 0 1 -font $aLabelFont
66 vdisplay b2 -trsfPers zoom -trsfPersPos 1 0 1
67
68 vdump $::imagedir/${::casename}_409x409@tile0.png
69 vdump $::imagedir/${::casename}_409x409@tile128.png  -tileSize 128
70 vdump $::imagedir/${::casename}_409x409@tile1024.png -tileSize 1024
71 vdump $::imagedir/${::casename}_1920x1080@tile0.png    -width 1920 -height 1920
72 vdump $::imagedir/${::casename}_1920x1080@tile128.png  -width 1920 -height 1920 -tileSize 128
73 vdump $::imagedir/${::casename}_1920x1080@tile1024.png -width 1920 -height 1920 -tileSize 1024
74 diffimage $::imagedir/${::casename}_409x409@tile0.png $::imagedir/${::casename}_409x409@tile128.png 0 0 0 $::imagedir/${::casename}_409x409@tile128diff.png
75
76 # check dump with stereo
77 vstereo anaglyph
78 vdump $::imagedir/${::casename}_409x409@stereotile0.png      -stereo blend
79 vdump $::imagedir/${::casename}_409x409@stereotile128.png    -stereo blend -tileSize 128
80 vdump $::imagedir/${::casename}_409x409@stereotile1024.png   -stereo blend -tileSize 1024
81 vdump $::imagedir/${::casename}_1920x1080@stereotile0.png    -width 1920 -height 1920 -stereo blend
82 vdump $::imagedir/${::casename}_1920x1080@stereotile128.png  -width 1920 -height 1920 -stereo blend -tileSize 128
83 vdump $::imagedir/${::casename}_1920x1080@stereotile1024.png -width 1920 -height 1920 -stereo blend -tileSize 1024
84 diffimage $::imagedir/${::casename}_409x409@stereotile0.png $::imagedir/${::casename}_409x409@stereotile128.png 0 0 0 $::imagedir/${::casename}_409x409@stereotile128diff.png
85
86 # check dump with Ray Tracing
87 vraytrace 1
88 vdump $::imagedir/${::casename}_409x409@rttile0.png      -stereo blend
89 vdump $::imagedir/${::casename}_409x409@rttile128.png    -stereo blend -tileSize 128
90 vdump $::imagedir/${::casename}_409x409@rttile1024.png   -stereo blend -tileSize 1024
91 vdump $::imagedir/${::casename}_1920x1080@rttile0.png    -width 1920 -height 1920 -stereo blend
92 vdump $::imagedir/${::casename}_1920x1080@rttile128.png  -width 1920 -height 1920 -stereo blend -tileSize 128
93 vdump $::imagedir/${::casename}_1920x1080@rttile1024.png -width 1920 -height 1920 -stereo blend -tileSize 1024
94 vraytrace 0