#######################################################################
#  MACRO FILE NAME: exN03Vis3.mac                                     #
#                                                                     #
#  AUTHOR(S): Satoshi Tanaka                                          #
#                                                                     #
#  DATE: November 10, 1999                                            #
#        May      20, 2000                                            # 
#        June     06, 2000                                            # 
#                                                                     #
#  CONTENTS: A basic macro for demonstrating various drawing styles   #
#                                                                     #
#  USAGE:  % $G4BINDIR/exampleN03                                     #
#          Idle> /control/execute exN03Vis3.mac                       #
#                                                                     #
#  REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL,            #
#                                  DAWN (version 3.80 or after)       #
#                                  gv (Ghostview), Tcl/Tk             #
#                                                                     #
#  ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION:               #
#  (See geant4/source/visualization/README for details.)              #
#                                                                     #
#    % setenv OGLHOME     ... (e.g. /usr/local)                       #
#    % setenv G4VIS_BUILD_OPENGLX_DRIVER   1                          # 
#    % setenv G4VIS_BUILD_DAWNFILE_DRIVER  1                          #
#                                                                     #
#  ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION:                #
#  (See geant4/source/visualization/README for details.)              #
#                                                                     #
#    % setenv G4VIS_USE_OPENGLX            1                          #
#    % setenv G4VIS_USE_DAWNFILE           1                          #
#                                                                     # 
#  Addional Notes:                                                    #
#    The compound command "/vis/open <graphics-system-name>"          #
#    is equivalent to the following set of commands:                  #
#                                                                     #
#      /vis/sceneHandler/create $1                                    #
#      /vis/viewer/create                                             #
#                                                                     #
#######################################################################

##############################################
Store particle trajactories for visualization
##############################################
/tracking/storeTrajectory 1

######################################################
# Visualization with OGLIX (OpenGL Immediate X) driver
######################################################

# Invoke the OGLIX driver 
/vis/open OGLIX

# Create a new scene
/vis/scene/create

# Attach the current visualization driver 
# to the current scene
/vis/sceneHandler/attach

# Add detector geometry to the current scene
/vis/scene/add/volume

# Add trajectories to the current scene
/vis/scene/add/trajectories

# Bird-eye view of events with the hidden-surface 
#  drawing style.
/vis/camera/reset
/vis/camera/viewpoint    45 45 
/vis/set/drawing_style   2 
/run/beamOn              10

##########################################################
# Visualization with DAWNFILE driver
#
#  * Each visualized view is saved to a file "g4_XX.eps"  
#    with the "vectorized" PostScript format.
#
#  * In order to make the file "g4_XX.eps" printable, 
#    append the "showpage" PostScript command to the file. 
#    You can do it with the 4th page of the DAWN GUI panel
#    or by editing the file by hand.
#
#  * Set as follows to skip DAWN GUI:
#    % setenv G4DAWNFILE_VIEWER "dawn -d"
#
##########################################################

# Invoke the DAWNFILE driver 
/vis/open DAWNFILE

# Create a new scene
/vis/scene/create

# Attach the current visualization driver 
# to the current scene
/vis/sceneHandler/attach

# Add detector geometry to the current scene
/vis/scene/add/volume

# Add trajectories to the current scene
/vis/scene/add/trajectories

# Set camera 
#  Camera is zoomed up by 1.5 times of the standard setting.
/vis/camera/reset 
/vis/camera/zoom 1.5
/vis/camera/viewpoint    45 45 

# Bird-eye view of events with the wireframe drawing style
/vis/set/drawing_style   0 
/run/beamOn              5

# Bird-eye view of events with the hidden-surface 
#  drawing style.
/vis/set/drawing_style   2 
/run/beamOn              50

# Cull detector geometry and show only trajectories.
/vis/camera/reset 
/vis/set/culling         on 
/vis/set/cull_by_density on 999
/vis/set/drawing_style   0 
/run/beamOn              10
