Geant4 Cross Reference |
1 ========================================================= 2 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 3 ========================================================= 4 5 examples/extended/visualization/userVisAction 6 --------------------------------------------- 7 8 This example illustrates how to create a "vis action". 9 10 The idea is that you register a vis action with the vis manager and 11 activate it by a command /vis/scene/add/userAction. In this case, it 12 draws a simple logo. 13 14 1) UVA_VisAction.cc defines a G4VUserVisAction and implements a Draw 15 method. 16 17 2) In the main program, UVA_VisAction is instantiated and 18 its pointer registerd with the visualization manager. You may 19 optionally specify an extent at this point to assist the viewers to 20 locate the objects. 21 22 3) To visualise, use the usual Geant4 vis commands to create a view 23 and scene, then add the vis action to the scene with 24 /vis/scene/add/userAction - see vis.mac. 25 26 Note: The system needs an "extent" in order to point the virtual 27 camera and adjust its field of view, etc. This defines the "standard 28 view". You may zoom, etc., from this standard view. The extent may 29 be specified as suggested above or by using /vis/scene/add/extent. 30 31 32 John Allison 33 27th November 2014