[562] | 1 | ####################################################################### |
---|
| 2 | # MACRO FILE NAME: exN03Vis14.mac # |
---|
| 3 | # # |
---|
| 4 | # AUTHOR(S): Laurent Garnier # |
---|
| 5 | # # |
---|
| 6 | # DATE: July 13, 2007 # |
---|
| 7 | # # |
---|
| 8 | # CONTENTS: A basic macro for visualization of detector geometry # |
---|
| 9 | # # |
---|
| 10 | # USAGE: % gmake visclean # |
---|
| 11 | # % $G4BINDIR/exampleN03 # |
---|
| 12 | # Idle> /control/execute visTutor/exN03Vis14.mac # |
---|
| 13 | # # |
---|
| 14 | # REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL,Qt # |
---|
| 15 | # gv (Ghostview), Tcl/Tk # |
---|
| 16 | # # |
---|
| 17 | # ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: # |
---|
| 18 | # (See geant4/source/visualization/README for details.) # |
---|
| 19 | # # |
---|
| 20 | # % setenv OGLHOME ... (e.g. /usr/X11R6) # |
---|
| 21 | # % setenv G4VIS_BUILD_OPENGLQT_DRIVER 1 # |
---|
| 22 | # # |
---|
| 23 | # ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: # |
---|
| 24 | # (See geant4/source/visualization/README for details.) # |
---|
| 25 | # # |
---|
| 26 | # % setenv G4VIS_USE_OPENGLQT 1 # |
---|
| 27 | # # |
---|
| 28 | # ADDITIONAL NOTES: # |
---|
| 29 | # The compound command "/vis/open <vis-driver-name>" # |
---|
| 30 | # is equivalent to the following set of commands: # |
---|
| 31 | # # |
---|
| 32 | # /vis/sceneHandler/create $1 # |
---|
| 33 | # /vis/viewer/create # |
---|
| 34 | # # |
---|
| 35 | # The compound command "/vis/drawVolume <physical-volume-name>" # |
---|
| 36 | # is equivalent to the following set of commands: # |
---|
| 37 | # # |
---|
| 38 | # /vis/scene/create # |
---|
| 39 | # /vis/scene/add/volume $1 # |
---|
| 40 | # /vis/sceneHandler/attach # |
---|
| 41 | # # |
---|
| 42 | ####################################################################### |
---|
| 43 | |
---|
| 44 | ########################################### |
---|
| 45 | # Visualization of detector geometry |
---|
| 46 | # with the OGLSQT (OpenGL Stored QT) driver |
---|
| 47 | ########################################### |
---|
| 48 | |
---|
[893] | 49 | # Invoke the OGLSQt driver |
---|
[887] | 50 | /vis/open OGLSQt |
---|
[562] | 51 | |
---|
[1302] | 52 | # Bird's-eye view of the whole detector components (world) |
---|
[562] | 53 | # |
---|
[1302] | 54 | # viewpoint : (theta,phi) = (35*deg, 35*deg), |
---|
| 55 | # zoom factor: 5.0 of the full screen size |
---|
| 56 | # coordinate axes: |
---|
[562] | 57 | # x-axis:red, y-axis:green, z-axis:blue |
---|
| 58 | # origin: (0,0,0), length: 500 |
---|
[1302] | 59 | # Scale: length = 10 cm, Orientation = z, color = red, |
---|
[562] | 60 | # placing_algorithm = manual, |
---|
| 61 | # center = (-2.5 cm , -5 cm, 0 cm) |
---|
| 62 | # |
---|
| 63 | /vis/viewer/reset |
---|
[1302] | 64 | /vis/viewer/zoom 5.0 |
---|
[562] | 65 | /vis/viewer/set/viewpointThetaPhi 35 35 |
---|
[1302] | 66 | /vis/drawVolume |
---|
[562] | 67 | /vis/scene/add/axes 0 0 0 500 mm |
---|
[1302] | 68 | /vis/scene/add/text 0 0 0 mm 50 -100 -240 World |
---|
[562] | 69 | /vis/scene/add/scale 10 cm z 1 0 0 manual -2.5 -5 0 cm |
---|
[1302] | 70 | #/vis/scene/add/scale 10 cm x 1 0 0 |
---|
[562] | 71 | |
---|
[1302] | 72 | # Bird's-eye view of a detector component (Absorber) |
---|
| 73 | # |
---|
| 74 | #/vis/viewer/reset |
---|
| 75 | #/vis/viewer/zoom 1.1 |
---|
| 76 | #/vis/viewer/set/viewpointThetaPhi 35 35 |
---|
| 77 | #/vis/drawVolume Absorber |
---|
| 78 | #/vis/scene/add/axes 0 0 0 500 mm |
---|
| 79 | #/vis/scene/add/text 0 0 0 mm 40 -100 -140 Absorber |
---|
| 80 | #/vis/scene/add/scale 10 cm z 1 0 0 manual -2.5 -5 0 cm |
---|
[562] | 81 | |
---|
| 82 | # Bird's-eye view of a detector component (Gap) |
---|
[1302] | 83 | # |
---|
| 84 | #/vis/viewer/reset |
---|
| 85 | #/vis/viewer/zoom 1.1 |
---|
| 86 | #/vis/viewer/set/viewpointThetaPhi 35 35 |
---|
| 87 | #/vis/drawVolume Gap |
---|
| 88 | #/vis/scene/add/axes 0 0 0 500 mm |
---|
| 89 | #/vis/scene/add/text 0 0 0 mm 50 -100 -140 Gap |
---|
| 90 | #/vis/scene/add/scale 10 cm z 1 0 0 manual -2.5 -5 0 cm |
---|
[562] | 91 | |
---|
[1302] | 92 | # Commands for setting up drawing of tracks ... |
---|
| 93 | # |
---|
| 94 | /vis/scene/add/trajectories smooth |
---|
| 95 | /vis/modeling/trajectories/create/drawByCharge |
---|
| 96 | /vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true |
---|
| 97 | /vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2 |
---|
| 98 | /vis/scene/endOfEventAction accumulate |
---|
[562] | 99 | |
---|
[1302] | 100 | # Flush the action of all the existing viewers |
---|
| 101 | # |
---|
[562] | 102 | /vis/scene/notifyHandlers |
---|
| 103 | /vis/viewer/update |
---|
| 104 | |
---|
| 105 | # Make the culling on for next visualization |
---|
[1302] | 106 | # Note: You may also use "/vis/viewer/reset" for this initialization |
---|
| 107 | # |
---|
[562] | 108 | /vis/viewer/set/culling global true |
---|