Warning, /geant4/examples/basic/B5/tsg_offscreen.mac is written in an unsupported language. File is not indexed.
0001
0002 #//////////////////////////////////////////////////////////////////////
0003 #//////////////////////////////////////////////////////////////////////
0004 #//////////////////////////////////////////////////////////////////////
0005
0006 # Default file format is zb_png. Then a picture produced by using the
0007 # tools::sg offscreen zbuffer, and put in a png file with the tools::fpng png
0008 # file writer.
0009
0010 # Default file name is:
0011 # g4tsg_offscreen_[format]_[index].[suffix]
0012 # with:
0013 # - index: starting at one and incremented at each file production.
0014 # - format:
0015 # zb_png: tools::sg offscreen zbuffer put in a png file.
0016 # zb_jpeg: tools::sg offscreen zbuffer put in a jpeg file.
0017 # zb_ps: tools::sg offscreen zbuffer put in a PostScript file.
0018 # gl2ps_eps: gl2ps producing eps
0019 # gl2ps_ps: gl2ps producing ps
0020 # gl2ps_pdf: gl2ps producing pdf
0021 # gl2ps_svg: gl2ps producing svg
0022 # gl2ps_tex: gl2ps producing tex
0023 # gl2ps_pgf: gl2ps producing pgf
0024 # - suffix: according to the choosen file format: eps, ps, pdf, svg, tex, pgf, png, jpeg.
0025
0026 # You can change the file name with:
0027 # /vis/tsg/offscreen/set/file <file name>
0028 # You can change the automatic file name construction with:
0029 # /vis/tsg/offscreen/set/file auto <prefix> <true|false to reset the index>
0030
0031 # Default picture size, in pixels, is the one given when doing a:
0032 # /vis/open TSG_OFFSCREEN [width]x[height]
0033 # for example:
0034 # /vis/open TSG_OFFSCREEN 1200x1200
0035 # or by taking the default G4/vis viewer size (600x600):
0036 # /vis/open TSG_OFFSCREEN
0037
0038 # About the picture size, note that the gl2ps files will grow with the number of primitives
0039 # (gl2ps does not have a zbuffer logic). The "zb" files will not grow with the number of
0040 # primitives, but with the size of the viewer. It should be preferred for scenes with
0041 # a lot of objects to render. With zb, to have a better rendering, do not hesitate to
0042 # have a large viewer size.
0043
0044 # About transparency, the zb formats handle it. The gl2ps formats don't, in this case you can use:
0045 # /vis/tsg/offscreen/set/transparency false
0046 # to not draw the transparent objects.
0047
0048 #//////////////////////////////////////////////////////////////////////
0049 #//////////////////////////////////////////////////////////////////////
0050 #//////////////////////////////////////////////////////////////////////
0051 # Below is a sequence to produce files at the various formats
0052 # (execute vis.mac first to have some scene to visualize).
0053 # Note that a TSG offscreen viewer is not an "auto refresh" one, then
0054 # to produce a picture, you have to do:
0055 # /vis/viewer/rebuild
0056 # (a /vis/viewer/refresh or flush may not be sufficient, for example with plotting).
0057
0058 /vis/verbose confirmations
0059
0060 /vis/open TSG_OFFSCREEN
0061 /vis/viewer/rebuild # to produce the default g4tsg_offscreen_zb_png_1.png file.
0062 /run/beamOn 10
0063 /vis/viewer/rebuild # to produce g4tsg_offscreen_zb_png_2.png file.
0064
0065 /vis/tsg/offscreen/set/file auto B5_ true #true is to reset the index.
0066 /vis/viewer/rebuild # to produce B5_1.png file.
0067 /run/beamOn 10
0068 /vis/viewer/rebuild # to produce B5_2.png file.
0069
0070 /vis/tsg/offscreen/set/format zb_png
0071 /vis/tsg/offscreen/set/file B5_zb.png
0072 /vis/viewer/rebuild
0073
0074 /vis/tsg/offscreen/set/format zb_jpeg
0075 /vis/tsg/offscreen/set/file B5_zb.jpeg
0076 /vis/viewer/rebuild
0077
0078 /vis/tsg/offscreen/set/format gl2ps_ps
0079 /vis/tsg/offscreen/set/file B5_gl2ps.ps
0080 /vis/viewer/rebuild
0081
0082 # gl2ps does not handle transparency, it could
0083 # be usefull to not draw the transparent objects:
0084 /vis/tsg/offscreen/set/transparency false
0085 /vis/tsg/offscreen/set/file B5_no_transparency_gl2ps.ps
0086 /vis/viewer/rebuild
0087 /vis/tsg/offscreen/set/transparency true
0088
0089 # change picture size:
0090 /vis/tsg/offscreen/set/size 2000 1500
0091 /vis/tsg/offscreen/set/format zb_jpeg
0092 /vis/tsg/offscreen/set/file B5_2000_1500_zb.jpeg
0093 /vis/viewer/rebuild
0094
0095 # return to the "/vis/open" (/vis/viewer/create in fact) picture size:
0096 /vis/tsg/offscreen/set/size 0 0
0097
0098 /vis/tsg/offscreen/set/format zb_jpeg
0099 /vis/tsg/offscreen/set/file B5_600_600_zb.jpeg
0100 /vis/viewer/rebuild
0101
0102 /vis/verbose warnings