0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
[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 vclose ALL
20 vinit View1
21 vraytrace 0
22 vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
23 vsetdispmode 0
24 vdisplay -dispMode 1 b
25 vfit
26 vrotate 0.5 0 0
27 vzbufftrihedron
28
29 catch { vzlayer del 1 }
30 set aLayerId [vzlayer add]
31 vzlayer $aLayerId -enable depthClear -disable rayTracing
32
33 vtrihedron trh
34 vdisplay  -noupdate trh -layer $aLayerId -trihedron topRight 100 100
35
36 text2brep tcc "Center" -font $aLabelFont -height 30 -pos -40 0 0
37 vdisplay  -noupdate tcc -2d center -layer $aLayerId -dispMode 1
38 polyline  lcc -50 -50 0 -50 50 0 50 50 0 50 0 0 0 -50 0 -50 -50 0
39 vdisplay  -noupdate lcc -2d center -layer $aLayerId
40 vsetwidth -noupdate lcc 2
41
42 text2brep tbl "Bottom-Left" -font $aLabelFont -height 30 -pos 0 3 5
43 vdisplay  -noupdate tbl -2d bottomLeft -layer $aLayerId -dispMode 1
44 polyline  lbl 0 0 0 0 100 0 100 100 0 100 50 0 50 0 0 0 0 0
45 vdisplay  -noupdate lbl -2d bottomLeft -layer $aLayerId
46 vsetwidth -noupdate lbl 2
47
48 text2brep ttl "Top-Left" -font $aLabelFont -height 30 -pos 0 -30 0
49 vdisplay  -noupdate ttl -2d topLeft -layer $aLayerId -dispMode 1
50 polyline  ltl 0 -100 0 0 0 0 100 0 0 100 -50 0 50 -100 0 0 -100 0
51 vdisplay  -noupdate ltl -2d topLeft -layer $aLayerId
52 vsetwidth -noupdate ltl 2
53
54 text2brep ttr "Top-Right" -font $aLabelFont -height 30 -pos -130 -30 0
55 vdisplay  -noupdate ttr -2d topRight -layer $aLayerId -dispMode 1
56 polyline  ltr -100 -100 0 -100 0 0 0 0 0 0 -50 0 -50 -100 0 -100 -100 0
57 vdisplay  -noupdate ltr -2d topRight -layer $aLayerId
58 vsetwidth -noupdate ltr 2
59
60 text2brep tbr "Bottom-Right" -font $aLabelFont -height 30 -pos -180 3 0
61 vdisplay  -noupdate tbr -2d bottomRight -layer $aLayerId -dispMode 1
62 polyline  lbr -100 0 0 -100 100 0 0 100 0 0 50 0 -50 0 0 -100 0 0
63 vdisplay  -noupdate lbr -2d bottomRight -layer $aLayerId
64 vsetwidth -noupdate lbr 2
65
66 vdrawtext t2 "Label" -pos 1 0 1 -font $aLabelFont
67 vdisplay b2 -trsfPers zoom -trsfPersPos 1 0 1
68
69 vdump $::imagedir/${::casename}_409x409_tile0.png
70 vdump $::imagedir/${::casename}_409x409_tile128.png  -tileSize 128
71 vdump $::imagedir/${::casename}_409x409_tile1024.png -tileSize 1024
72 vdump $::imagedir/${::casename}_1920x1080_tile0.png    -width 1920 -height 1920
73 vdump $::imagedir/${::casename}_1920x1080_tile128.png  -width 1920 -height 1920 -tileSize 128
74 vdump $::imagedir/${::casename}_1920x1080_tile1024.png -width 1920 -height 1920 -tileSize 1024
75 diffimage $::imagedir/${::casename}_409x409_tile0.png $::imagedir/${::casename}_409x409_tile128.png 0 0 0 $::imagedir/${::casename}_409x409_tile128diff.png
76
77 # check dump with stereo
78 vstereo anaglyph
79 vdump $::imagedir/${::casename}_409x409_stereotile0.png      -stereo blend
80 vdump $::imagedir/${::casename}_409x409_stereotile128.png    -stereo blend -tileSize 128
81 vdump $::imagedir/${::casename}_409x409_stereotile1024.png   -stereo blend -tileSize 1024
82 vdump $::imagedir/${::casename}_1920x1080_stereotile0.png    -width 1920 -height 1920 -stereo blend
83 vdump $::imagedir/${::casename}_1920x1080_stereotile128.png  -width 1920 -height 1920 -stereo blend -tileSize 128
84 vdump $::imagedir/${::casename}_1920x1080_stereotile1024.png -width 1920 -height 1920 -stereo blend -tileSize 1024
85 diffimage $::imagedir/${::casename}_409x409_stereotile0.png $::imagedir/${::casename}_409x409_stereotile128.png 0 0 0 $::imagedir/${::casename}_409x409_stereotile128diff.png
86
87 # check dump with Ray Tracing
88 vraytrace 1
89 vdump $::imagedir/${::casename}_409x409_rttile0.png      -stereo blend
90 vdump $::imagedir/${::casename}_409x409_rttile128.png    -stereo blend -tileSize 128
91 vdump $::imagedir/${::casename}_409x409_rttile1024.png   -stereo blend -tileSize 1024
92 vdump $::imagedir/${::casename}_1920x1080_rttile0.png    -width 1920 -height 1920 -stereo blend
93 vdump $::imagedir/${::casename}_1920x1080_rttile128.png  -width 1920 -height 1920 -stereo blend -tileSize 128
94 vdump $::imagedir/${::casename}_1920x1080_rttile1024.png -width 1920 -height 1920 -stereo blend -tileSize 1024
95 vraytrace 0