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

Applications | User Support | Publications | Collaboration