Warning, /geant4/examples/extended/visualization/vtk/README is written in an unsupported language. File is not indexed.
0001 -------------------------------------------------------------------
0002
0003 =========================================================
0004 Geant4 - an Object-Oriented Toolkit for Simulation in HEP
0005 =========================================================
0006
0007 Example vtk
0008 -----------
0009
0010 This example demonstrates VTK visualisation driver. The code is based on
0011 the basic/B1 example, although the geometry has been modified. The physical
0012 example is a concerete dump, so a cuboid with a cylindrical hole removed.
0013
0014 VTK is a graphical pipeline (https://book.vtk.org/en/latest/VTKBook/04Chapter4.html#pipeline-design-and-implementation)
0015 based renderer.
0016
0017 VTK has some visualisation commands which are not applicable to all viewers,
0018 which currently include cutters, clippers and geometry overlays. The VTK commands
0019 are in vtk.mac and you can explore apply different VTK only commands.
0020
0021 A- VISUALISATION
0022 ================
0023
0024 This example is really for demonstration of VTK and so the easiest way to start with
0025
0026 % G4VIS_DEFAULT_DRIVER=VtkQt ./exampleVtk
0027
0028 or
0029
0030 % G4UI_USE_TCSH=1 G4VIS_DEFAULT_DRIVER=VtkNative ./exampleVtk
0031
0032 The event loop for the UI can be blocked by the VtkNative window. So if input events
0033 are captured by VTK, then the easiest way to exit from the viewer is to hit the 'q' button,
0034 then you are returned to the shell UI. To restart interaction then issue the command
0035
0036 Idle> /vis/vtk/startInteractor
0037
0038 B- USER INTERFACE
0039 =================
0040
0041 VTK can be used in conjunction with all UI systems. If a shell UI is used event loop for the UI can be blocked
0042 by the VtkNative window. So if input events are captured by VTK, then the easiest way to
0043 exit from the viewer is to hit the 'q' button, then you are returned to the shell UI.
0044 To restart interaction then issue the command
0045
0046 Idle> /vis/vtk/startInteractor
0047
0048 C- HOW TO RUN
0049 =============
0050
0051 Starting with VTK
0052
0053 % G4VIS_DEFAULT_DRIVER=VtkQt ./exampleVtk
0054
0055 Executing VTK specific commands
0056
0057 Idle> /control/execute vtk.mac
0058
0059 There are various pipelines and the state of the pipelines can be
0060 displayed by issuing this command
0061
0062 Idle> /vis/vtk/printDebug
0063
0064 Pipelines can be switched during operation. This is performed by calling
0065
0066 Idle> /vis/vtk/set/polyhedronPipeline (append/tensor/bake/separate)
0067
0068 and then a subsequent
0069
0070 Idle> /vis/viewer/flush
0071
0072 There is significantly different performance between these pipelines. Append, tensor
0073 and bake are all designed for large models and high performance. Separate creates
0074 a pipeline for each polyhedron, each pipeline will ultimately end with a draw call.
0075 In general with modern pipelined shaders draw calls should be kept to a minimum.
0076
0077 For debugging the VTK viewer it is possible to place a head up display (HUD) which
0078 gives key information on the viewer performance. The HUD is enabled by issuing
0079
0080 Idle> /vis/vtk/set/hud 1
0081
0082 Stewart Boogert
0083 7th November 2023
0084
0085
0086