| 1 | #######################################################################
|
|---|
| 2 | # MACRO FILE NAME: exN03Vis0.mac #
|
|---|
| 3 | # #
|
|---|
| 4 | # AUTHOR(S): Satoshi Tanaka #
|
|---|
| 5 | # #
|
|---|
| 6 | # DATE: #
|
|---|
| 7 | # Nov 07, 2001 #
|
|---|
| 8 | # Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
|---|
| 9 | # June 20, 2001 #
|
|---|
| 10 | # November 26, 2000 #
|
|---|
| 11 | # October 17, 2000 #
|
|---|
| 12 | # June 06, 2000 #
|
|---|
| 13 | # May 20, 2000 #
|
|---|
| 14 | # November 10, 1999 #
|
|---|
| 15 | # #
|
|---|
| 16 | # CONTENTS: A simplest macro to demonstrate visualization of #
|
|---|
| 17 | # detector geometry and events #
|
|---|
| 18 | # #
|
|---|
| 19 | # USAGE: % gmake visclean #
|
|---|
| 20 | # % $G4BINDIR/exampleN03 #
|
|---|
| 21 | # Idle> /control/execute visTutor/exN03Vis0.mac #
|
|---|
| 22 | # #
|
|---|
| 23 | # REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL, #
|
|---|
| 24 | # DAWN (version 3.85 or after) #
|
|---|
| 25 | # gv (Ghostview), Tcl/Tk #
|
|---|
| 26 | # #
|
|---|
| 27 | # ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
|---|
| 28 | # (See geant4/source/visualization/README for details.) #
|
|---|
| 29 | # #
|
|---|
| 30 | # % setenv OGLHOME ... (e.g. /usr/X11R6) #
|
|---|
| 31 | # % setenv G4VIS_BUILD_OPENGLX_DRIVER 1 #
|
|---|
| 32 | # #
|
|---|
| 33 | # ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
|---|
| 34 | # (See geant4/source/visualization/README for details.) #
|
|---|
| 35 | # #
|
|---|
| 36 | # % setenv G4VIS_USE_OPENGLX 1 #
|
|---|
| 37 | # #
|
|---|
| 38 | # ADDITIONAL NOTES: #
|
|---|
| 39 | # The compound command "/vis/open <vis-driver-name>" #
|
|---|
| 40 | # is equivalent to the following set of commands: #
|
|---|
| 41 | # #
|
|---|
| 42 | # /vis/sceneHandler/create $1 #
|
|---|
| 43 | # /vis/viewer/create #
|
|---|
| 44 | # #
|
|---|
| 45 | # The compound command "/vis/drawVolume <physical-volume-name>" #
|
|---|
| 46 | # is equivalent to the following set of commands: #
|
|---|
| 47 | # #
|
|---|
| 48 | # /vis/scene/create #
|
|---|
| 49 | # /vis/scene/add/volume $1 #
|
|---|
| 50 | # /vis/sceneHandler/attach #
|
|---|
| 51 | # #
|
|---|
| 52 | #######################################################################
|
|---|
| 53 |
|
|---|
| 54 | ##############################################
|
|---|
| 55 | # Visualization of detector geometry
|
|---|
| 56 | # with the OGLIX (OpenGL Immediate X) driver
|
|---|
| 57 | ##############################################
|
|---|
| 58 |
|
|---|
| 59 | # Invoke the OGLIX driver
|
|---|
| 60 | /vis/open OGLIX
|
|---|
| 61 | #/vis/open DAWNFILE
|
|---|
| 62 |
|
|---|
| 63 | # Set camera
|
|---|
| 64 | /vis/viewer/reset
|
|---|
| 65 | /vis/viewer/set/viewpointThetaPhi 70 20
|
|---|
| 66 |
|
|---|
| 67 | # Create an empty scene and add the detector geometry to it
|
|---|
| 68 | /vis/drawVolume
|
|---|
| 69 |
|
|---|
| 70 | # The following command "flush"
|
|---|
| 71 | # the action of the current viewer.
|
|---|
| 72 | # They are required for the post-processing drivers
|
|---|
| 73 | # such as DAWNFILE, VRMLFILE, HepRep drivers, etc.
|
|---|
| 74 | # For OpenGL drivers, these commands are not required
|
|---|
| 75 | # but harmless even if they are described.
|
|---|
| 76 | /vis/viewer/flush
|
|---|
| 77 |
|
|---|
| 78 | #########################################################
|
|---|
| 79 | # Visualization of events with the DAWNFILE driver
|
|---|
| 80 | #
|
|---|
| 81 | # * Each visualized view is saved to a file "g4_XX.eps"
|
|---|
| 82 | # with the "vectorized" PostScript format.
|
|---|
| 83 | #
|
|---|
| 84 | # * Set an environmental variable if you wish to
|
|---|
| 85 | # skip DAWN GUI:
|
|---|
| 86 | # % setenv G4DAWNFILE_VIEWER "dawn -d"
|
|---|
| 87 | ##########################################################
|
|---|
| 88 |
|
|---|
| 89 | # Invoke the DAWNFILE driver
|
|---|
| 90 | /vis/open DAWNFILE
|
|---|
| 91 |
|
|---|
| 92 | # Add the world volume to the current scene
|
|---|
| 93 | /vis/drawVolume
|
|---|
| 94 |
|
|---|
| 95 | # Add trajectories to the current scene
|
|---|
| 96 | # Note: This command is not necessary in exampleN03,
|
|---|
| 97 | # since the C++ method DrawTrajectory() is
|
|---|
| 98 | # described in the event action.
|
|---|
| 99 | #/vis/scene/add/trajectories
|
|---|
| 100 |
|
|---|
| 101 | # Set camera
|
|---|
| 102 | /vis/viewer/reset
|
|---|
| 103 | /vis/viewer/zoom 1.5
|
|---|
| 104 | /vis/viewer/set/viewpointThetaPhi 70 20
|
|---|
| 105 |
|
|---|
| 106 | # Visualize events added to the current scene
|
|---|
| 107 | /tracking/storeTrajectory 1
|
|---|
| 108 | /run/beamOn 3
|
|---|