1# Macro file for the visualization setting in the initialization phase
2# of the B1 example when running in interactive mode
7# Specify a viewer, e.g., /vis/open OGL, or allow a system choice:
9# This chooses a graphics system (in order of priority):
10# - by argument in G4VisExecutive construction.
11# - by environment variable, G4VIS_DEFAULT_DRIVER.
12# - by information in ~/.g4session.
13# - by mode (batch/interactive) and if interactive, by your build flags.
14# See "Choosing a graphics viewer" in the Application Guide for details.
15# For example, with environment variable G4VIS_DEFAULT_DRIVER:
16# The format is <graphics-system> [<window-size-hint>]. Set this, e.g:
17# (bash) export G4VIS_DEFAULT_DRIVER=TSG
18# (tcsh) setenv G4VIS_DEFAULT_DRIVER OI
19# or on the command line, precede the app invocation, e.g:
20# G4VIS_DEFAULT_DRIVER=Vtk ./<application-name>
21# The window-size-hint can optionally be added, e.g:
22# (bash) export G4VIS_DEFAULT_DRIVER="OGLSX 1000x1000-0+0"
23# Other suggestions for G4VIS_DEFAULT_DRIVER (see list of registered
24# graphics systems printed at the start):
25# DAWNFILE: to create a .prim file suitable for viewing in DAWN.
26# HepRepFile: to create a .heprep file suitable for viewing in HepRApp.
27# VRML2FILE: to create a .wrl file suitable for viewing in a VRML viewer.
28# "TSG_OFFSCREEN 1200x1200": to create an image file with TSG.
29# See the tsg_offscreen.mac in examples/basic/B1 for more commands
30# to change the file format, file name, picture size, etc.
32# Disable auto refresh and quieten vis messages whilst scene and
33# trajectories are established:
34/vis/viewer/set/autoRefresh false
41/vis/viewer/set/viewpointVector -1 0 0
42/vis/viewer/set/lightsVector -1 0 0
44# Specify style (surface, wireframe, auxiliary edges,...)
45/vis/viewer/set/style wireframe
46/vis/viewer/set/auxiliaryEdge true
47/vis/viewer/set/lineSegmentsPerCircle 100
49# Draw smooth trajectories at end of event, showing trajectory points
50# as markers 2 pixels wide:
51/vis/scene/add/trajectories smooth
52/vis/modeling/trajectories/create/drawByCharge
53/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
54/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
55# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
57# Draw hits at end of event:
61#/vis/filtering/trajectories/create/particleFilter
62#/vis/filtering/trajectories/particleFilter-0/add gamma
64# To invert the above, drawing all particles except gammas,
65# keep the above two lines but also add:
66#/vis/filtering/trajectories/particleFilter-0/invert true
68# Many other options are available with /vis/modeling and /vis/filtering.
69# For example, to select colour by particle ID:
70#/vis/modeling/trajectories/create/drawByParticleID
71#/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true
72# To select or override default colours (note: e+ is blue by default):
73#/vis/modeling/trajectories/list
74#/vis/modeling/trajectories/drawByParticleID-0/set e+ yellow
76# To superimpose all of the events from a given run:
77/vis/scene/endOfEventAction accumulate
81/vis/set/textColour green
82/vis/set/textLayout right
83/vis/scene/add/text2D 0.9 -.9 24 ! ! VTK-example
84# or, if your system does not support right-adjustment
85#/vis/scene/add/text2D 0 -.9 24 ! ! VTK-example
86/vis/set/textLayout # Revert to normal (left adjusted) layout
87/vis/set/textColour # Revert to default text colour (blue)
90/vis/scene/add/scale # Simple scale line
91/vis/scene/add/axes # Simple axes: x=red, y=green, z=blue.
92/vis/scene/add/eventID # Drawn at end of event
93/vis/scene/add/date # Date stamp
94/vis/scene/add/logo2D # Simple logo
95/vis/scene/add/logo # 3D logo
100/vis/scene/add/frame # Simple frame around the view
101/vis/set/colour # Revert to default colour (white)
102/vis/set/lineWidth # Revert to default line width (1.)
104# Attach text to one edge of Shape1, with a small, fixed offset
105/vis/scene/add/text 0 6 -4 cm 18 4 4 Shape1
106# Attach text to one corner of Shape2, with a small, fixed offset
107/vis/scene/add/text 6 7 10 cm 18 4 4 Shape2
110# Make the "World" box invisible
111/vis/geometry/set/visibility World 0 false
112# "Envelope" is transparent blue to represent water
113/vis/geometry/set/colour Envelope 0 0 0 1 .3
114/vis/viewer/set/style surface
115/vis/viewer/set/hiddenMarker true
116/vis/viewer/set/viewpointThetaPhi 120 150
118# Re-establish auto refreshing and verbosity:
119/vis/viewer/set/autoRefresh true
122# For file-based drivers, use this to create an empty detector view: