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.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]
1 -------------------------------------------------------------------
2
3 =========================================================
4 Geant4 - an Object-Oriented Toolkit for Simulation in HEP
5 =========================================================
6
7 Example vtk
8 -----------
9
10 This example demonstrates VTK visualisation driver. The code is based on
11 the basic/B1 example, although the geometry has been modified. The physical
12 example is a concerete dump, so a cuboid with a cylindrical hole removed.
13
14 VTK is a graphical pipeline (https://book.vtk.org/en/latest/VTKBook/04Chapter4.html#pipeline-design-and-implementation)
15 based renderer.
16
17 VTK has some visualisation commands which are not applicable to all viewers,
18 which currently include cutters, clippers and geometry overlays. The VTK commands
19 are in vtk.mac and you can explore apply different VTK only commands.
20
21 A- VISUALISATION
22 ================
23
24 This example is really for demonstration of VTK and so the easiest way to start with
25
26 % G4VIS_DEFAULT_DRIVER=VtkQt ./exampleVtk
27
28 or
29
30 % G4UI_USE_TCSH=1 G4VIS_DEFAULT_DRIVER=VtkNative ./exampleVtk
31
32 The event loop for the UI can be blocked by the VtkNative window. So if input events
33 are captured by VTK, then the easiest way to exit from the viewer is to hit the 'q' button,
34 then you are returned to the shell UI. To restart interaction then issue the command
35
36 Idle> /vis/vtk/startInteractor
37
38 B- USER INTERFACE
39 =================
40
41 VTK can be used in conjunction with all UI systems. If a shell UI is used event loop for the UI can be blocked
42 by the VtkNative window. So if input events are captured by VTK, then the easiest way to
43 exit from the viewer is to hit the 'q' button, then you are returned to the shell UI.
44 To restart interaction then issue the command
45
46 Idle> /vis/vtk/startInteractor
47
48 C- HOW TO RUN
49 =============
50
51 Starting with VTK
52
53 % G4VIS_DEFAULT_DRIVER=VtkQt ./exampleVtk
54
55 Executing VTK specific commands
56
57 Idle> /control/execute vtk.mac
58
59 There are various pipelines and the state of the pipelines can be
60 displayed by issuing this command
61
62 Idle> /vis/vtk/printDebug
63
64 Pipelines can be switched during operation. This is performed by calling
65
66 Idle> /vis/vtk/set/polyhedronPipeline (append/tensor/bake/separate)
67
68 and then a subsequent
69
70 Idle> /vis/viewer/flush
71
72 There is significantly different performance between these pipelines. Append, tensor
73 and bake are all designed for large models and high performance. Separate creates
74 a pipeline for each polyhedron, each pipeline will ultimately end with a draw call.
75 In general with modern pipelined shaders draw calls should be kept to a minimum.
76
77 For debugging the VTK viewer it is possible to place a head up display (HUD) which
78 gives key information on the viewer performance. The HUD is enabled by issuing
79
80 Idle> /vis/vtk/set/hud 1
81
82 Stewart Boogert
83 7th November 2023
84
85
86