Import Geant4 11.0.0 source tree
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
|
||||
///\file "visualization/.README.txt"
|
||||
///\brief Examples visualization README page
|
||||
|
||||
/*! \page Examples_visualization Category "visualization"
|
||||
|
||||
Examples in this directory demonstrate the use of Geant4 visualization.
|
||||
|
||||
\link Examplestandalone standalone \endlink
|
||||
|
||||
This example illustrates how one might use the Geant Visualization
|
||||
System as a "stand alone" graphics library and viewer.
|
||||
|
||||
\link Exampleperspective perspective \endlink
|
||||
|
||||
This example is another example of using the Geant Visualization
|
||||
System as a "stand-alone" graphics library and viewer.
|
||||
|
||||
\link ExampleuserVisAction userVisAction \endlink
|
||||
|
||||
This example illustrates how to create a "vis action".
|
||||
|
||||
\link Examplemovies movies \endlink
|
||||
|
||||
This example illustrates how to create movies.
|
||||
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
Geant4 extended examples - visualization
|
||||
-----------------------------------------
|
||||
|
||||
Examples in this directory demonstrate the use of Geant4 visualization.
|
||||
|
||||
standalone
|
||||
-----------
|
||||
|
||||
This example illustrates how one might use the Geant Visualization
|
||||
System as a "stand alone" graphics library and viewer.
|
||||
|
||||
perspective
|
||||
-----------
|
||||
|
||||
This example is another example of using the Geant Visualization
|
||||
System as a "stand-alone" graphics library and viewer.
|
||||
|
||||
userVisAction
|
||||
-------------
|
||||
|
||||
This example illustrates how to create a "vis action".
|
||||
|
||||
movies
|
||||
------
|
||||
|
||||
This example illustrates how to create movies.
|
||||
@@ -0,0 +1,92 @@
|
||||
///\file "visualization/movies/.README.txt"
|
||||
///\brief Example movies README page
|
||||
|
||||
/*! \page ExampleMovies Example movies
|
||||
|
||||
examples/extended/visualization/movies
|
||||
|
||||
This example illustrates how to create a movie.
|
||||
|
||||
See https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Visualization/makingamovie.html#.
|
||||
|
||||
A) USING /vis/viewer/save AND /vis/viewer/interpolate
|
||||
=====================================================
|
||||
|
||||
1) a) To see a pre-prepared example, start this example in interactive mode
|
||||
(i.e., without any command line arguments). Just type
|
||||
/vis/viewer/interpolate viewfiles/movie-1
|
||||
If you want to see an electromagnetic shower
|
||||
/run/beamOn
|
||||
/vis/viewer/interpolate viewfiles/movie-1
|
||||
|
||||
b) To make your own movie, save a sequence of views with
|
||||
"/vis/viewer/save". Then "fly through" with "/vis/viewer/interpolate".
|
||||
|
||||
The procedure is: choose a view, save, choose another view, save, and
|
||||
so on until you have, say, 10 saved views. Then you may
|
||||
/vis/viewer/interpolate
|
||||
|
||||
Note: This saves views to your current working directory. It is
|
||||
always good to remove any pre-existing saved files:
|
||||
rm *.g4view
|
||||
or save them, e.g.
|
||||
mkdir views
|
||||
mv *.g4view views
|
||||
which can subsequently be interpolated with
|
||||
/vis/viewer/interpolate views
|
||||
|
||||
c) Then you have a choice of how to export the movie - see 3 below.
|
||||
|
||||
2) You can use time-slicing to see particles progress through time
|
||||
|
||||
a) To see a pre-prepared example
|
||||
/vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns
|
||||
/run/beamOn
|
||||
/vis/viewer/interpolate viewfiles/movie-2
|
||||
|
||||
b) To make your own movie
|
||||
/vis/scene/add/trajectories rich
|
||||
/vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns
|
||||
# Optionally add features (see guidance on /vis/viewer/set/timeWindow/)
|
||||
/vis/viewer/set/timeWindow/displayLightFront true 0 0 -20 cm -0.01 ns
|
||||
/vis/viewer/set/timeWindow/displayHeadTime true
|
||||
/vis/viewer/set/timeWindow/fadeFactor 1
|
||||
/run/beamOn
|
||||
# Then set a time window and save
|
||||
/vis/viewer/set/timeWindow/startTime 0 ns .1 ns
|
||||
/vis/viewer/save
|
||||
# Then zoom, pan etc to a view of interest
|
||||
# Then set the next time window and save
|
||||
/vis/viewer/set/timeWindow/startTime .5 ns .1 ns
|
||||
/vis/viewer/save
|
||||
# Then zoom, pan etc to a view of interest
|
||||
# Then set the next time window and save
|
||||
/vis/viewer/set/timeWindow/startTime 1 ns .1 ns
|
||||
/vis/viewer/save
|
||||
# Then another view, the next time window, and a save...
|
||||
# ...repeat a few more times
|
||||
# Then try
|
||||
/vis/viewer/interpolate
|
||||
|
||||
3) How to export images using /vis/viewer/interpolate (OpenGL only)
|
||||
/vis/viewer/interpolate ! ! ! ! export
|
||||
This produces lots of files.
|
||||
You can change export format with (for example)
|
||||
/vis/ogl/set/exportFormat jpg
|
||||
Then import them into your favourite movie maker - see
|
||||
https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Visualization/makingamovie.html#
|
||||
|
||||
B) THE OLD WAY
|
||||
==============
|
||||
|
||||
These files are inherited from the old "novice" example N03. They draw (and
|
||||
optionally, save) views using a macro loop. They have not been tested
|
||||
recently. Best to run in batch mode in the build directory. E.g.
|
||||
|
||||
./movies -m visTutor/exN03Vis12.mac
|
||||
./movies -m visTutor/exN03Vis13.mac
|
||||
|
||||
|
||||
John Allison
|
||||
15th February 2021
|
||||
*/
|
||||
@@ -0,0 +1,91 @@
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
examples/extended/visualization/movies
|
||||
--------------------------------------
|
||||
|
||||
This example illustrates how to create a movie.
|
||||
|
||||
See https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Visualization/makingamovie.html#.
|
||||
|
||||
A) USING /vis/viewer/save AND /vis/viewer/interpolate
|
||||
=====================================================
|
||||
|
||||
1) a) To see a pre-prepared example, start this example in interactive mode
|
||||
(i.e., without any command line arguments). Just type
|
||||
/vis/viewer/interpolate viewfiles/movie-1
|
||||
If you want to see an electromagnetic shower
|
||||
/run/beamOn
|
||||
/vis/viewer/interpolate viewfiles/movie-1
|
||||
|
||||
b) To make your own movie, save a sequence of views with
|
||||
"/vis/viewer/save". Then "fly through" with "/vis/viewer/interpolate".
|
||||
|
||||
The procedure is: choose a view, save, choose another view, save, and
|
||||
so on until you have, say, 10 saved views. Then you may
|
||||
/vis/viewer/interpolate
|
||||
|
||||
Note: This saves views to your current working directory. It is
|
||||
always good to remove any pre-existing saved files:
|
||||
rm *.g4view
|
||||
or save them, e.g.
|
||||
mkdir views
|
||||
mv *.g4view views
|
||||
which can subsequently be interpolated with
|
||||
/vis/viewer/interpolate views
|
||||
|
||||
c) Then you have a choice of how to export the movie - see 3 below.
|
||||
|
||||
2) You can use time-slicing to see particles progress through time
|
||||
|
||||
a) To see a pre-prepared example
|
||||
/vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns
|
||||
/run/beamOn
|
||||
/vis/viewer/interpolate viewfiles/movie-2
|
||||
|
||||
b) To make your own movie
|
||||
/vis/scene/add/trajectories rich
|
||||
/vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns
|
||||
# Optionally add features (see guidance on /vis/viewer/set/timeWindow/)
|
||||
/vis/viewer/set/timeWindow/displayLightFront true 0 0 -20 cm -0.01 ns
|
||||
/vis/viewer/set/timeWindow/displayHeadTime true
|
||||
/vis/viewer/set/timeWindow/fadeFactor 1
|
||||
/run/beamOn
|
||||
# Then set a time window and save
|
||||
/vis/viewer/set/timeWindow/startTime 0 ns .1 ns
|
||||
/vis/viewer/save
|
||||
# Then zoom, pan etc to a view of interest
|
||||
# Then set the next time window and save
|
||||
/vis/viewer/set/timeWindow/startTime .5 ns .1 ns
|
||||
/vis/viewer/save
|
||||
# Then zoom, pan etc to a view of interest
|
||||
# Then set the next time window and save
|
||||
/vis/viewer/set/timeWindow/startTime 1 ns .1 ns
|
||||
/vis/viewer/save
|
||||
# Then another view, the next time window, and a save...
|
||||
# ...repeat a few more times
|
||||
# Then try
|
||||
/vis/viewer/interpolate
|
||||
|
||||
3) How to export images using /vis/viewer/interpolate (OpenGL only)
|
||||
/vis/viewer/interpolate ! ! ! ! export
|
||||
This produces lots of files.
|
||||
You can change export format with (for example)
|
||||
/vis/ogl/set/exportFormat jpg
|
||||
Then import them into your favourite movie maker - see
|
||||
https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Visualization/makingamovie.html#
|
||||
|
||||
B) THE OLD WAY
|
||||
==============
|
||||
|
||||
These files are inherited from the old "novice" example N03. They draw (and
|
||||
optionally, save) views using a macro loop. They have not been tested
|
||||
recently. Best to run in batch mode in the build directory. E.g.
|
||||
|
||||
./movies -m visTutor/exN03Vis12.mac
|
||||
./movies -m visTutor/exN03Vis13.mac
|
||||
|
||||
|
||||
John Allison
|
||||
15th February 2021
|
||||
@@ -0,0 +1,28 @@
|
||||
///\file "visualization/perspective/.README.txt"
|
||||
///\brief Example perspective README page
|
||||
|
||||
/*! \page Exampleperspective Example perspective
|
||||
|
||||
examples/extended/visualization/perspective
|
||||
|
||||
This example is another example of using the Geant Visualization
|
||||
System as a "stand-alone" graphics library and viewer. See
|
||||
\ref Examplestandalone for a simpler introductory explanation.
|
||||
|
||||
The particular feature of this example is the addition of "perspective
|
||||
lines". The direction of these lines is controlled by
|
||||
|
||||
\verbatim
|
||||
/perspectiveDemo/optionString x
|
||||
\endverbatim
|
||||
|
||||
See vis.mac.
|
||||
|
||||
Notes:
|
||||
- /perspectiveDemo/scene is not used at present.
|
||||
- visXm.mac is specially for use with G4UIXm and OGL*Xm.
|
||||
|
||||
John Allison
|
||||
11th June 2012
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,25 @@
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
examples/extended/visualization/perspective
|
||||
------------------------------------------
|
||||
|
||||
This example is another example of using the Geant Visualization
|
||||
System as a "stand-alone" graphics library and viewer. See
|
||||
examples/extended/visualization/standalone for a simpler
|
||||
introductory explanation.
|
||||
|
||||
The particular feature of this example is the addition of "perspective
|
||||
lines". The direction of these lines is controlled by
|
||||
|
||||
/perspectiveDemo/optionString x
|
||||
|
||||
See vis.mac.
|
||||
|
||||
Notes:
|
||||
- /perspectiveDemo/scene is not used at present.
|
||||
- visXm.mac is specially for use with G4UIXm and OGL*Xm.
|
||||
|
||||
John Allison
|
||||
11th June 2012
|
||||
@@ -0,0 +1,41 @@
|
||||
///\file "visualization/standalone/.README.txt"
|
||||
///\brief Example standalone README page
|
||||
|
||||
/*! \page Examplestandalone Example standalone
|
||||
|
||||
examples/extended/visualization/standalone
|
||||
|
||||
|
||||
This example illustrates how one might use the Geant Visualization
|
||||
System as a "stand alone" graphics library and viewer. It makes use
|
||||
of the "user action" feature of the Geant4 vis manager - for a fuller
|
||||
example of the use of this feature see
|
||||
examples/extended/visualization/userVisAction.
|
||||
|
||||
1) Define a G4VUserVisAction that implements a Draw method. An
|
||||
example is provided - see StandaloneVisAction.hh/cc.
|
||||
StandaloneVisAction::Draw illustrates:
|
||||
a) a simple box;
|
||||
b) a Boolean solid;
|
||||
c) an alternative way of drawing a solid by obtaining the
|
||||
polyhedral representation.
|
||||
The last is included for interest, not as a recommendation.
|
||||
|
||||
2) In the main () program (see standalone.cc), StandaloneVisAction must be instantiated and
|
||||
its pointer registered with the visualization manager. You may
|
||||
optionally specify an extent at this point to assist the viewers to
|
||||
locate the objects.
|
||||
|
||||
3) To visualise, use the usual Geant4 vis commands to create a view
|
||||
and scene, then add the vis action to the scene, optionally with an
|
||||
extent - see standalone.mac.
|
||||
|
||||
Note: The system needs an "extent" in order to point the virtual
|
||||
camera and adjust its field of view, etc. This defines the "standard
|
||||
view". You may zoom, etc., from this standard view. The extent may
|
||||
be specified as suggested above or by using /vis/scene/add/extent.
|
||||
|
||||
|
||||
John Allison
|
||||
27th November 2014
|
||||
*/
|
||||
@@ -0,0 +1,39 @@
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
examples/extended/visualization/standalone
|
||||
------------------------------------------
|
||||
|
||||
This example illustrates how one might use the Geant Visualization
|
||||
System as a "stand alone" graphics library and viewer. It makes use
|
||||
of the "user action" feature of the Geant4 vis manager - for a fuller
|
||||
example of the use of this feature see
|
||||
examples/extended/visualization/userVisAction.
|
||||
|
||||
1) Define a G4VUserVisAction that implements a Draw method. An
|
||||
example is provided - see StandaloneVisAction.hh/cc.
|
||||
StandaloneVisAction::Draw illustrates:
|
||||
a) a simple box;
|
||||
b) a Boolean solid;
|
||||
c) an alternative way of drawing a solid by obtaining the
|
||||
polyhedral representation.
|
||||
The last is included for interest, not as a recommendation.
|
||||
|
||||
2) In the main program, StandaloneVisAction must be instantiated and
|
||||
its pointer registered with the visualization manager. You may
|
||||
optionally specify an extent at this point to assist the viewers to
|
||||
locate the objects.
|
||||
|
||||
3) To visualise, use the usual Geant4 vis commands to create a view
|
||||
and scene, then add the vis action to the scene, optionally with an
|
||||
extent - see standalone.mac.
|
||||
|
||||
Note: The system needs an "extent" in order to point the virtual
|
||||
camera and adjust its field of view, etc. This defines the "standard
|
||||
view". You may zoom, etc., from this standard view. The extent may
|
||||
be specified as suggested above or by using /vis/scene/add/extent.
|
||||
|
||||
|
||||
John Allison
|
||||
27th November 2014
|
||||
@@ -0,0 +1,38 @@
|
||||
///\file "visualization/userVisAction/.README.txt"
|
||||
///\brief Example userVisAction README page
|
||||
|
||||
/*! \page ExampleuserVisAction Example userVisAction
|
||||
|
||||
examples/extended/visualization/userVisAction
|
||||
|
||||
This example illustrates how to create a "vis action".
|
||||
|
||||
The idea is that you register a vis action with the vis manager and
|
||||
activate it by a command /vis/scene/add/userAction. In this case, it
|
||||
draws a simple logo.
|
||||
|
||||
1) UVA_VisAction.cc defines a G4VUserVisAction and implements a Draw
|
||||
method.
|
||||
|
||||
2) In the main () program (see userVisAction.cc), UVA_VisAction is instantiated and
|
||||
its pointer registerd with the visualization manager. You may
|
||||
optionally specify an extent at this point to assist the viewers to
|
||||
locate the objects.
|
||||
|
||||
3) To visualise, use the usual Geant4 vis commands to create a view
|
||||
and scene, then add the vis action to the scene with
|
||||
\verbatim
|
||||
/vis/scene/add/userAction
|
||||
\endverbatim
|
||||
see vis.mac.
|
||||
|
||||
Note: The system needs an "extent" in order to point the virtual
|
||||
camera and adjust its field of view, etc. This defines the "standard
|
||||
view". You may zoom, etc., from this standard view. The extent may
|
||||
be specified as suggested above or by using /vis/scene/add/extent.
|
||||
|
||||
|
||||
John Allison
|
||||
27th November 2014
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,33 @@
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
examples/extended/visualization/userVisAction
|
||||
---------------------------------------------
|
||||
|
||||
This example illustrates how to create a "vis action".
|
||||
|
||||
The idea is that you register a vis action with the vis manager and
|
||||
activate it by a command /vis/scene/add/userAction. In this case, it
|
||||
draws a simple logo.
|
||||
|
||||
1) UVA_VisAction.cc defines a G4VUserVisAction and implements a Draw
|
||||
method.
|
||||
|
||||
2) In the main program, UVA_VisAction is instantiated and
|
||||
its pointer registerd with the visualization manager. You may
|
||||
optionally specify an extent at this point to assist the viewers to
|
||||
locate the objects.
|
||||
|
||||
3) To visualise, use the usual Geant4 vis commands to create a view
|
||||
and scene, then add the vis action to the scene with
|
||||
/vis/scene/add/userAction - see vis.mac.
|
||||
|
||||
Note: The system needs an "extent" in order to point the virtual
|
||||
camera and adjust its field of view, etc. This defines the "standard
|
||||
view". You may zoom, etc., from this standard view. The extent may
|
||||
be specified as suggested above or by using /vis/scene/add/extent.
|
||||
|
||||
|
||||
John Allison
|
||||
27th November 2014
|
||||
Reference in New Issue
Block a user