####################################################################### # MACRO FILE NAME: exN03Vis1.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 detector geometry # # # # USAGE: % gmake visclean # # % $G4BINDIR/exampleN03 # # Idle> /control/execute visTutor/exN03Vis1.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 # # # # The compound command "/vis/drawVolume " # # is equivalent to the following set of commands: # # # # /vis/scene/create # # /vis/scene/add/volume $1 # # /vis/sceneHandler/attach # # /vis/viewer/refresh # # # # WARNING: You need one more command "/vis/viewer/update" for # # flushing in using post-processin visualization drivers # # such as the DAWNFILE, VRMLFILE, OpenGL Motif drivers. # # You can execute, e.g. "/vis/draw/axes" before executing # # "/vis/viewer/update" to visualize coordinate axes. # # # ####################################################################### ########################################### # Visualization of detector geometry # with the OGLSX (OpenGL Stored X) driver ########################################### # Invoke the OGLSX driver /vis/open OGLSX # Visualize the detector geometry # with the defalut camera parameters /vis/camera/reset /vis/drawVolume /vis/viewer/update # Slide show (spinning) of the view visualized above. # Draw 60 frames with steps of 3 degrees. /vis/camera/reset /vis/camera/viewpoint 20 20 /vis/camera/zoom 0.8 /vis/camera/spin 60 3 # Bird's-eye view of the detector geometry # # viewpoint : (theta,phi) = (20*deg, 70*deg), # zoom factor: 0.8 of the full screen size # coordinate axes: # x-axis:red, y-axis:green, z-axis:blue # origin: (0,0,0), length: 500 # /vis/camera/reset /vis/camera/viewpoint 20 70 /vis/camera/zoom 0.8 /vis/drawVolume /vis/draw/axes 0 0 0 500 /vis/viewer/update ########################################################## # 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 # Bird's-eye view of a detector component (Absorber) # viewpoint : (theta,phi) = (35*deg, 35*deg), # zoom factor: 0.9 of the full screen size # coordinate axes: # x-axis:red, y-axis:green, z-axis:blue # origin: (0,0,0), length: 500 # /vis/camera/reset /vis/camera/zoom 0.9 /vis/camera/viewpoint 35 35 /vis/drawVolume Absorber /vis/draw/axes 0 0 0 500 /vis/draw/text 0 0 0 mm 50 -100 -200 Absorber /vis/viewer/update # Bird's-eye view of a detector component (Gap) /vis/camera/reset /vis/camera/zoom 0.9 /vis/camera/viewpoint 35 35 /vis/drawVolume Gap /vis/draw/axes 0 0 0 500 /vis/draw/text 0 0 0 mm 50 -100 -200 Gap /vis/viewer/update # Bird's-eye view of the whole detector components # * The argument "world" of the command # "/vis/scene/add/volume" is omittable. # * "/vis/set/culling off" makes the invisible # world volume visible. # (The invisibility of the world volume is set # in ExN03DetectorConstruction.cc.) /vis/camera/reset /vis/camera/zoom 0.9 /vis/camera/viewpoint 35 35 /vis/set/culling off /vis/drawVolume /vis/draw/axes 0 0 0 500 /vis/draw/text 0 0 0 mm 50 -50 -200 world /vis/viewer/update # Make the culling on for next visualization /vis/set/culling on