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