####################################################################### # MACRO FILE NAME: exN03Vis2.mac # # # # AUTHOR(S): Satoshi Tanaka # # # # DATE: November 10, 1999 # # May 20, 2000 # # June 06, 2000 # # October 17, 2000 # # November 26, 2000 # # # # CONTENTS: A basic macro for visualization of events # # # # USAGE: % gmake visclean # # % $G4BINDIR/exampleN03 # # Idle> /control/execute visTutor/exN03Vis2.mac # # # # REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL, # # DAWN (version 3.85 or after) # # gv (Ghostview), Tcl/Tk # # # # ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: # # (See geant4/source/visualization/README for details.) # # # # % setenv OGLHOME ... (e.g. /usr/X11R6) # # % 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 # # # # ADDITIONAL NOTES: # # The compound command "/vis/open " # # 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 OGLSX (OpenGL Stored X) driver ##################################################### # Invoke the OGLSX driver /vis/open OGLSX # Create a new scene /vis/scene/create # Add detector geometry to the current scene /vis/scene/add/volume # Attach the current visualization driver # to the current scene (omitable) /vis/sceneHandler/attach # Add trajectories to the current scene # Note: This command is not necessary in exampleN03, # since the C++ method DrawTrajectory() is # described in the event action. #/vis/scene/add/trajectories # Set drawing style to "surface" /vis/viewer/set/style surface # Set camera # viewpoint : (theta,phi) = (10*deg, 10*deg). # zoom factor: 0.9 x (full screen size) /vis/camera/reset /vis/camera/viewpoint 10 10 /vis/camera/zoom 0.9 # Generate one event and visualize it. /run/beamOn 1 # Slide show (spinning). # Draw 18 frames with steps of 20 degrees. # The OGLSX driver stores the previously visualized view # in the display list. So the particle trajectories are # also rotated together with the detector geometry. # /vis/camera/spin 18 20 ########################################################## # 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 an environmental variable if you wish to # skip DAWN GUI: # % setenv G4DAWNFILE_VIEWER "dawn -d" ########################################################## # Invoke the DAWNFILE driver /vis/open DAWNFILE # Create a new scene /vis/scene/create # Add detector geometry to the current scene /vis/scene/add/volume # Attach the current visualization driver # to the current scene (omitable) /vis/sceneHandler/attach # Add trajectories to the current scene # Note: This command is not necessary in exampleN03, # since the C++ method DrawTrajectory() is # described in the event action. #/vis/scene/add/trajectories # Set the drawing style to "wireframe". /vis/viewer/set/style wireframe # Visualize many events (bird's eye view) # viewpoint : (theta,phi) = (45*deg, 45*deg) # zoom factor: 1.5 x (full screen size) /vis/camera/reset /vis/camera/viewpoint 45 45 /vis/camera/zoom 1.5 /run/beamOn 50 # Visualize many events (zoomed-up view) # viewpoint : (theta,phi) = (90*deg, 0) # zoom factor: 5 x (full screen size) /vis/camera/reset /vis/camera/viewpoint 90 0 /vis/camera/zoom 5 /run/beamOn 50