Import Geant4 11.4.0 source tree
This commit is contained in:
@@ -1,86 +0,0 @@
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Example vtk
|
||||
-----------
|
||||
|
||||
This example demonstrates VTK visualisation driver. The code is based on
|
||||
the basic/B1 example, although the geometry has been modified. The physical
|
||||
example is a concerete dump, so a cuboid with a cylindrical hole removed.
|
||||
|
||||
VTK is a graphical pipeline (https://book.vtk.org/en/latest/VTKBook/04Chapter4.html#pipeline-design-and-implementation)
|
||||
based renderer.
|
||||
|
||||
VTK has some visualisation commands which are not applicable to all viewers,
|
||||
which currently include cutters, clippers and geometry overlays. The VTK commands
|
||||
are in vtk.mac and you can explore apply different VTK only commands.
|
||||
|
||||
A- VISUALISATION
|
||||
================
|
||||
|
||||
This example is really for demonstration of VTK and so the easiest way to start with
|
||||
|
||||
% G4VIS_DEFAULT_DRIVER=VtkQt ./exampleVtk
|
||||
|
||||
or
|
||||
|
||||
% G4UI_USE_TCSH=1 G4VIS_DEFAULT_DRIVER=VtkNative ./exampleVtk
|
||||
|
||||
The event loop for the UI can be blocked by the VtkNative window. So if input events
|
||||
are captured by VTK, then the easiest way to exit from the viewer is to hit the 'q' button,
|
||||
then you are returned to the shell UI. To restart interaction then issue the command
|
||||
|
||||
Idle> /vis/vtk/startInteractor
|
||||
|
||||
B- USER INTERFACE
|
||||
=================
|
||||
|
||||
VTK can be used in conjunction with all UI systems. If a shell UI is used event loop for the UI can be blocked
|
||||
by the VtkNative window. So if input events are captured by VTK, then the easiest way to
|
||||
exit from the viewer is to hit the 'q' button, then you are returned to the shell UI.
|
||||
To restart interaction then issue the command
|
||||
|
||||
Idle> /vis/vtk/startInteractor
|
||||
|
||||
C- HOW TO RUN
|
||||
=============
|
||||
|
||||
Starting with VTK
|
||||
|
||||
% G4VIS_DEFAULT_DRIVER=VtkQt ./exampleVtk
|
||||
|
||||
Executing VTK specific commands
|
||||
|
||||
Idle> /control/execute vtk.mac
|
||||
|
||||
There are various pipelines and the state of the pipelines can be
|
||||
displayed by issuing this command
|
||||
|
||||
Idle> /vis/vtk/printDebug
|
||||
|
||||
Pipelines can be switched during operation. This is performed by calling
|
||||
|
||||
Idle> /vis/vtk/set/polyhedronPipeline (append/tensor/bake/separate)
|
||||
|
||||
and then a subsequent
|
||||
|
||||
Idle> /vis/viewer/flush
|
||||
|
||||
There is significantly different performance between these pipelines. Append, tensor
|
||||
and bake are all designed for large models and high performance. Separate creates
|
||||
a pipeline for each polyhedron, each pipeline will ultimately end with a draw call.
|
||||
In general with modern pipelined shaders draw calls should be kept to a minimum.
|
||||
|
||||
For debugging the VTK viewer it is possible to place a head up display (HUD) which
|
||||
gives key information on the viewer performance. The HUD is enabled by issuing
|
||||
|
||||
Idle> /vis/vtk/set/hud 1
|
||||
|
||||
Stewart Boogert
|
||||
7th November 2023
|
||||
|
||||
|
||||
|
||||
+21
-26
@@ -1,7 +1,4 @@
|
||||
///\file "visualization/vtk/.README.txt"
|
||||
///\brief Example vtk README page
|
||||
|
||||
/*! \page Examplevtk Example vtk
|
||||
\page Examplevtk Example vtk
|
||||
|
||||
This example demonstrates VTK visualisation driver. The code is based on
|
||||
the basic/B1 example, although the geometry has been modified. The physical
|
||||
@@ -19,23 +16,23 @@ are in vtk.mac and you can explore apply different VTK only commands.
|
||||
|
||||
This example is really for demonstration of VTK and so the easiest way to start with
|
||||
|
||||
\verbatim
|
||||
```
|
||||
% G4VIS_DEFAULT_DRIVER=VtkQt ./exampleVtk
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
\verbatim
|
||||
```
|
||||
% G4UI_USE_TCSH=1 G4VIS_DEFAULT_DRIVER=VtkNative ./exampleVtk
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
The event loop for the UI can be blocked by the VtkNative window. So if input events
|
||||
are captured by VTK, then the easiest way to exit from the viewer is to hit the 'q' button,
|
||||
then you are returned to the shell UI. To restart interaction then issue the command
|
||||
|
||||
\verbatim
|
||||
```
|
||||
Idle> /vis/vtk/startInteractor
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
B- USER INTERFACES
|
||||
==================
|
||||
@@ -45,43 +42,43 @@ by the VtkNative window. So if input events are captured by VTK, then the easies
|
||||
exit from the viewer is to hit the 'q' button, then you are returned to the shell UI.
|
||||
To restart interaction then issue the command
|
||||
|
||||
\verbatim
|
||||
```
|
||||
Idle> /vis/vtk/startInteractor
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
C- HOW TO RUN
|
||||
=============
|
||||
|
||||
Starting with VTK
|
||||
|
||||
\verbatim
|
||||
```
|
||||
% G4VIS_DEFAULT_DRIVER=VtkQt ./exampleVtk
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
Executing VTK specific commands
|
||||
|
||||
\verbatim
|
||||
```
|
||||
Idle> /control/execute vtk.mac
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
There are various pipelines and the state of the pipelines can be
|
||||
displayed by issuing this command
|
||||
|
||||
\verbatim
|
||||
```
|
||||
/vis/vtk/printDebug
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
Pipelines can be switched during operation. This is performed by calling
|
||||
|
||||
\verbatim
|
||||
```
|
||||
/vis/vtk/set/polyhedronPipeline (append/tensor/bake/separate)
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
and then a subsequent
|
||||
|
||||
\verbatim
|
||||
```
|
||||
/vis/viewer/flush
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
There is significantly different performance between these pipelines. Append, tensor
|
||||
and bake are all designed for large models and high performance. Separate creates
|
||||
@@ -91,12 +88,10 @@ In general with modern pipelined shaders draw calls should be kept to a minimum.
|
||||
For debugging the VTK viewer it is possible to place a head up display (HUD) which
|
||||
gives key information on the viewer performance. The HUD is enabled by issuing
|
||||
|
||||
\verbatim
|
||||
```
|
||||
/vis/vtk/set/hud 1
|
||||
\endverbatim
|
||||
```
|
||||
|
||||
|
||||
Stewart Boogert
|
||||
7th November 2023
|
||||
|
||||
*/
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file exampleB1.cc
|
||||
/// \brief Main program of the B1 example
|
||||
/// \file exampleVtk.cc
|
||||
/// \brief Main program of the visualization/vtk example
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/include/ActionInitialization.hh
|
||||
/// \brief Definition of the B1::ActionInitialization class
|
||||
/// \file ActionInitialization.hh
|
||||
/// \brief Definition of the VtkVis::ActionInitialization class
|
||||
|
||||
#ifndef B1ActionInitialization_h
|
||||
#define B1ActionInitialization_h 1
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/include/DetectorConstruction.hh
|
||||
/// \brief Definition of the B1::DetectorConstruction class
|
||||
/// \file DetectorConstruction.hh
|
||||
/// \brief Definition of the VtkVis::DetectorConstruction class
|
||||
|
||||
#ifndef B1DetectorConstruction_h
|
||||
#define B1DetectorConstruction_h 1
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/include/EventAction.hh
|
||||
/// \brief Definition of the B1::EventAction class
|
||||
/// \file EventAction.hh
|
||||
/// \brief Definition of the VtkVis::EventAction class
|
||||
|
||||
#ifndef B1EventAction_h
|
||||
#define B1EventAction_h 1
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/include/PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the B1::PrimaryGeneratorAction class
|
||||
/// \file PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the VtkVis::PrimaryGeneratorAction class
|
||||
|
||||
#ifndef B1PrimaryGeneratorAction_h
|
||||
#define B1PrimaryGeneratorAction_h 1
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/include/RunAction.hh
|
||||
/// \brief Definition of the B1::RunAction class
|
||||
/// \file RunAction.hh
|
||||
/// \brief Definition of the VtkVis::RunAction class
|
||||
|
||||
#ifndef B1RunAction_h
|
||||
#define B1RunAction_h 1
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/include/SteppingAction.hh
|
||||
/// \brief Definition of the B1::SteppingAction class
|
||||
/// \file SteppingAction.hh
|
||||
/// \brief Definition of the VtkVis::SteppingAction class
|
||||
|
||||
#ifndef B1SteppingAction_h
|
||||
#define B1SteppingAction_h 1
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/src/ActionInitialization.cc
|
||||
/// \brief Implementation of the B1::ActionInitialization class
|
||||
/// \file ActionInitialization.cc
|
||||
/// \brief Implementation of the VtkVis::ActionInitialization class
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/src/DetectorConstruction.cc
|
||||
/// \brief Implementation of the B1::DetectorConstruction class
|
||||
/// \file DetectorConstruction.cc
|
||||
/// \brief Implementation of the VtkVis::DetectorConstruction class
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/src/EventAction.cc
|
||||
/// \brief Implementation of the B1::EventAction class
|
||||
/// \file EventAction.cc
|
||||
/// \brief Implementation of the VtkVis::EventAction class
|
||||
|
||||
#include "EventAction.hh"
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/src/PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the B1::PrimaryGeneratorAction class
|
||||
/// \file PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the VtkVis::PrimaryGeneratorAction class
|
||||
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/src/RunAction.cc
|
||||
/// \brief Implementation of the B1::RunAction class
|
||||
/// \file RunAction.cc
|
||||
/// \brief Implementation of the VtkVis::RunAction class
|
||||
|
||||
#include "RunAction.hh"
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1/src/SteppingAction.cc
|
||||
/// \brief Implementation of the B1::SteppingAction class
|
||||
/// \file SteppingAction.cc
|
||||
/// \brief Implementation of the VtkVis::SteppingAction class
|
||||
|
||||
#include "SteppingAction.hh"
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
# Other suggestions for G4VIS_DEFAULT_DRIVER (see list of registered
|
||||
# graphics systems printed at the start):
|
||||
# DAWNFILE: to create a .prim file suitable for viewing in DAWN.
|
||||
# HepRepFile: to create a .heprep file suitable for viewing in HepRApp.
|
||||
# VRML2FILE: to create a .wrl file suitable for viewing in a VRML viewer.
|
||||
# "TSG_OFFSCREEN 1200x1200": to create an image file with TSG.
|
||||
# See the tsg_offscreen.mac in examples/basic/B1 for more commands
|
||||
|
||||
Reference in New Issue
Block a user