[474] | 1 | ####################################################################### |
---|
| 2 | # MACRO FILE NAME: exN03Vis3.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 basic macro for demonstrating various drawing styles # |
---|
| 17 | # # |
---|
| 18 | # USAGE: % gmake visclean # |
---|
| 19 | # % $G4BINDIR/exampleN03 # |
---|
| 20 | # Idle> /control/execute visTutor/exN03Vis3.mac # |
---|
| 21 | # # |
---|
| 22 | # REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL, # |
---|
| 23 | # DAWN (version 3.85 or after) # |
---|
| 24 | # gv (Ghostview), Tcl/Tk # |
---|
| 25 | # # |
---|
| 26 | # ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: # |
---|
| 27 | # (See geant4/source/visualization/README for details.) # |
---|
| 28 | # # |
---|
| 29 | # % setenv OGLHOME ... (e.g. /usr/local) # |
---|
| 30 | # % setenv G4VIS_BUILD_OPENGLX_DRIVER 1 # |
---|
| 31 | # # |
---|
| 32 | # ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: # |
---|
| 33 | # (See geant4/source/visualization/README for details.) # |
---|
| 34 | # # |
---|
| 35 | # % setenv G4VIS_USE_OPENGLX 1 # |
---|
| 36 | # # |
---|
| 37 | # ADDITIONAL NOTES: # |
---|
| 38 | # The compound command "/vis/open <vis-driver-name>" # |
---|
| 39 | # is equivalent to the following set of commands: # |
---|
| 40 | # # |
---|
| 41 | # /vis/sceneHandler/create $1 # |
---|
| 42 | # /vis/viewer/create # |
---|
| 43 | # # |
---|
| 44 | ####################################################################### |
---|
| 45 | |
---|
| 46 | ############################################## |
---|
| 47 | # Store particle trajactories for visualization |
---|
| 48 | ############################################## |
---|
| 49 | /tracking/storeTrajectory 1 |
---|
| 50 | |
---|
| 51 | ########################################################### |
---|
| 52 | # Visualization with the OGLIX (OpenGL Immediate X) driver |
---|
| 53 | ########################################################### |
---|
| 54 | |
---|
| 55 | # Invoke the OGLSX driver |
---|
| 56 | /vis/open OGLSX |
---|
| 57 | |
---|
| 58 | # Create an empty scene and add the detector geometry to it |
---|
| 59 | /vis/drawVolume |
---|
| 60 | |
---|
| 61 | # Add trajectories to the current scene |
---|
| 62 | # Note: This command is not necessary in exampleN03, |
---|
| 63 | # since the C++ method DrawTrajectory() is |
---|
| 64 | # described in the event action. |
---|
| 65 | #/vis/scene/add/trajectories |
---|
| 66 | |
---|
| 67 | # Bird-eye view of events with |
---|
| 68 | # the hidden-surface drawing style |
---|
| 69 | /vis/viewer/reset |
---|
| 70 | /vis/viewer/set/viewpointThetaPhi 45 45 |
---|
| 71 | /vis/viewer/set/style surface |
---|
| 72 | /run/beamOn 10 |
---|
| 73 | |
---|
| 74 | ########################################################## |
---|
| 75 | # Visualization with the DAWNFILE driver |
---|
| 76 | # |
---|
| 77 | # * Each visualized view is saved to a file "g4_XX.eps" |
---|
| 78 | # with the "vectorized" PostScript format. |
---|
| 79 | # |
---|
| 80 | # * Set an environmental variable if you wish to |
---|
| 81 | # skip DAWN GUI: |
---|
| 82 | # % setenv G4DAWNFILE_VIEWER "dawn -d" |
---|
| 83 | # |
---|
| 84 | ########################################################## |
---|
| 85 | |
---|
| 86 | # Invoke the DAWNFILE driver |
---|
| 87 | /vis/open DAWNFILE |
---|
| 88 | |
---|
| 89 | # Create an empty scene and add the detector geometry to it |
---|
| 90 | /vis/drawVolume |
---|
| 91 | |
---|
| 92 | # Add trajectories to the current scene |
---|
| 93 | # Note: This command is not necessary in exampleN03, |
---|
| 94 | # since the C++ method DrawTrajectory() is |
---|
| 95 | # described in the event action. |
---|
| 96 | #/vis/scene/add/trajectories |
---|
| 97 | |
---|
| 98 | # Bird-eye view of events with the |
---|
| 99 | # wireframe drawing style |
---|
| 100 | /vis/viewer/reset |
---|
| 101 | /vis/viewer/zoom 1.5 |
---|
| 102 | /vis/viewer/set/viewpointThetaPhi 45 45 |
---|
| 103 | /vis/viewer/set/style wireframe |
---|
| 104 | /run/beamOn 3 |
---|
| 105 | |
---|
| 106 | # Set the trajectory-accumulation mode to "accumulate". |
---|
| 107 | # Trajectories of each event are accumulated |
---|
| 108 | # and visualized at the end of one run. |
---|
| 109 | /vis/scene/endOfEventAction accumulate |
---|
| 110 | |
---|
| 111 | # Bird-eye view of events with the |
---|
| 112 | # hidden-surface drawing style |
---|
| 113 | /vis/viewer/set/style surface |
---|
| 114 | /run/beamOn 50 |
---|
| 115 | |
---|
| 116 | # Cull detector geometry and show only trajectories. |
---|
| 117 | /vis/viewer/reset |
---|
| 118 | /vis/viewer/set/culling global true |
---|
| 119 | /vis/viewer/set/culling density true 999 |
---|
| 120 | /vis/viewer/set/style wireframe |
---|
| 121 | /run/beamOn 10 |
---|
| 122 | |
---|
| 123 | # Reset the culling policy for next visualization |
---|
| 124 | # The default culling policy is: |
---|
| 125 | # global : on |
---|
| 126 | # invisible : on |
---|
| 127 | # low density : off |
---|
| 128 | # covered daughter: off |
---|
| 129 | # |
---|
| 130 | # Note: You may also use "/vis/viewer/reset" |
---|
| 131 | # for this initialization. |
---|
| 132 | /vis/viewer/set/culling density false |
---|
| 133 | |
---|
| 134 | # Reset trajectory-accumulation mode to "refresh" (default) |
---|
| 135 | # Trajectories are visualized at the end of each event. |
---|
| 136 | /vis/scene/endOfEventAction refresh |
---|