Import Geant4 10.5.0 source tree
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# $Id: GNUmakefile 99176 2016-09-07 09:46:36Z gcosmo $
|
||||
# -------------------------------------------------------------
|
||||
# GNUmakefile for visualization library. John Allison, 5/7/95.
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
$Id: History 110513 2018-05-28 07:37:38Z gcosmo $
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
@@ -26,6 +25,116 @@ committal in the CVS repository !
|
||||
History file for visualization management sub-category
|
||||
------------------------------------------------------
|
||||
|
||||
14 November 2018 John Allison (visman-V10-04-28)
|
||||
- G4VisCommandsSceneAdd.cc: /vis/scene/add/userAction:
|
||||
o Fix bug whereby success was branded unsuccessful when verbosity <= warnings.
|
||||
- G4VisCommandsCompound.cc: /vis/drawLogicalVolume:
|
||||
o Warn the user if style and/or hidden marker condition is changed.
|
||||
|
||||
08 November 2018 John Allison (visman-V10-04-26)
|
||||
- G4VisCommandsSceneAdd.cc:
|
||||
o /vis/scene/add/logicalVolume:
|
||||
. Overlap checking now in text and drawing.
|
||||
|
||||
07 November 2018 John Allison (visman-V10-04-25)
|
||||
- G4VisCommandsTouchable.cc:
|
||||
o /vis/touchable/findPath: Correct a bug in guidance.
|
||||
- G4VisCommandsSceneAdd.cc:
|
||||
o /vis/scene/add/logicalVolume:
|
||||
. Overlap checking only in text output at present.
|
||||
|
||||
24 October 2018 John Allison (visman-V10-04-24)
|
||||
- G4VVisCommand:
|
||||
o Replace fCurrentTouchablePath by fCurrentTouchableProperties.
|
||||
- G4VisCommandsTouchableSet:
|
||||
o /vis/touchable/set/...:
|
||||
. Replace fCurrentTouchablePath by
|
||||
fCurrentTouchableProperties.fTouchablePath.
|
||||
- G4VisCommandsTouchable:
|
||||
o /vis/touchable/dump: Simplify.
|
||||
o /vis/touchable/findPath: Add (see guidance for description).
|
||||
- G4VisCommandSet:
|
||||
o /vis/set/touchable: Add validity check.
|
||||
- G4VViewer:::TouchableSetColour, TouchableSetVisibility:
|
||||
o Conform to modeling-V10-04-15.
|
||||
|
||||
19 October 2018 John Allison (visman-V10-04-23)
|
||||
- Requires greps-V10-04-08: G4VisExtent::GetNullExtent().
|
||||
- G4VSceneHandler::ProcessScene: Use G4VisExtent::GetNullExtent().
|
||||
- G4VVisCommand: Replace
|
||||
UpdateVisManagerScene(const G4String& sceneName)
|
||||
by
|
||||
CheckSceneAndNotifyHandlers(G4Scene* pScene)
|
||||
and fix minor bug.
|
||||
- G4VisCommandsScene.cc, G4VisCommandsSceneAdd.cc, G4VisCommandsViewer.cc:
|
||||
Migrate to CheckSceneAndNotifyHandlers.
|
||||
|
||||
17 October 2018 John Allison (visman-V10-04-22)
|
||||
- /vis/scene/add/volume (and, consequently, /vis/drawVolume):
|
||||
o Improve guidance: describe the use of a regular expression.
|
||||
If physical-volume-name is "world" (the default), the top of the
|
||||
main geometry tree (material world) is added. If "worlds", the
|
||||
top of all worlds - material world and parallel worlds, if any - are
|
||||
added. Otherwise a search of all worlds is made.
|
||||
In the last case (a search of all worlds) all physical volume names are
|
||||
matched against the first argument of this command. If this is of the
|
||||
form "/regexp/", where regexp is a regular expression (see C++ regex),
|
||||
the physical volume name is matched against regexp by the usual rules
|
||||
of regular expression matching. Otherwise an exact match is required.
|
||||
For example, "/Shap/" matches "Shape1" and "Shape2".
|
||||
|
||||
15 October 2018 John Allison (visman-V10-04-21)
|
||||
- G4VSceneHandler.cc: Tidy.
|
||||
|
||||
8 October 2018 John Allison (visman-V10-04-20)
|
||||
- Fix bug in visman-V10-04-19.
|
||||
o Change G4UIcmdWithAString to G4UIcommand in /vis/drawVolume.
|
||||
|
||||
6 October 2018 John Allison (visman-V10-04-19)
|
||||
- G4VisManager.cc: Move creation of top level commands to end.
|
||||
- /vis/drawVolume and /vis/draw/logicalVolume:
|
||||
o Pick up guidance and parameters from /vis/scene/add/...
|
||||
- /vis/scene/add/trajectories: avoid adding new model if one exists.
|
||||
o If no trajectories model exists in the scene create a new one...
|
||||
...else it already exists and there is no need to add a new one
|
||||
because G4TrajectoriesModel simply describes trajectories in the
|
||||
trajectories store whatever the type.
|
||||
|
||||
10 September 2018 John Allison (visman-V10-04-18)
|
||||
- G4VSceneHandler.cc: Tidy.
|
||||
- G4VisCommandsSceneAdd.cc: /vis/scene/add/volume:
|
||||
o Change to G4PhysicalVolumesSearchScene, which returns ALL occurrences
|
||||
of a physical volume.
|
||||
|
||||
29 August 2018 John Allison (visman-V10-04-17)
|
||||
- G4VisCommandsTouchable.cc:
|
||||
o Fix bug for multiple worlds in /vis/touchable/dump.
|
||||
|
||||
14 August 2018 John Allison (visman-V10-04-16)
|
||||
- G4VViewer::G4Spline: Reinstate.
|
||||
|
||||
12 August 2018 John Allison (visman-V10-04-15)
|
||||
- G4ViewParameters:
|
||||
o Small bug fix in operator << (std::ostream& os, const G4ViewParameters& v).
|
||||
|
||||
11 August 2018 John Allison (visman-V10-04-14)
|
||||
- G4VViewer::G4Spline: Remove.
|
||||
- /vis/viewer/set/timeWindow/displayLightFront: change defaults.
|
||||
- /vis/viewer/colourByDensity: change defaults.
|
||||
|
||||
24 July 2018 John Allison (visman-V10-04-13)
|
||||
- G4VisCommandsViewer.cc:
|
||||
o /vis/viewer/interpolate: Fix gcc8 warnings.
|
||||
o /vis/viewer/colourByDensity: Change defaults:
|
||||
. Algorithm 1 is default.
|
||||
. gm/cm3 is default unit.
|
||||
. Subsequent parameters are not omitable.
|
||||
|
||||
12 July 2018 Gabriele Cosmo (visman-V10-04-12)
|
||||
- G4VisManager: obtain geometry and solids workspaces through calls to
|
||||
the templated workspace pool class.
|
||||
- Coworks with tags in geometry and run.
|
||||
|
||||
25 May 2018 John Allison (visman-V10-04-11)
|
||||
- Introduce /vis/drawLogicalVolume:
|
||||
o Synonymous with /vis/specify.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GraphicsSystemList.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 2nd April 1996
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Scene.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Scene John Allison 19th July 1996.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Scene.icc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Scene data John Allison 19th July 1996.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SceneHandlerList.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison May 1996
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SceneList.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 9th August 1998
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VGraphicsSystem.hh 91686 2015-07-31 09:40:08Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 27th March 1996
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VSceneHandler.hh 101714 2016-11-22 08:53:13Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VSceneHandler.icc 101714 2016-11-22 08:53:13Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserVisAction.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VViewer.hh 108859 2018-03-12 07:44:53Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 27th March 1996
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VViewer.icc 101714 2016-11-22 08:53:13Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 30th December 1996
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisCommand.hh 109186 2018-04-03 07:22:18Z gcosmo $
|
||||
|
||||
// Base class for visualization commands - John Allison 9th August 1998
|
||||
// It is really a messenger - we have one command per messenger.
|
||||
@@ -95,7 +94,7 @@ protected:
|
||||
// Return false if there's a problem
|
||||
|
||||
// Other utilities.
|
||||
void UpdateVisManagerScene (const G4String& sceneName = "");
|
||||
void CheckSceneAndNotifyHandlers (G4Scene* = nullptr);
|
||||
|
||||
// Data members.
|
||||
static G4VisManager* fpVisManager;
|
||||
@@ -106,14 +105,14 @@ protected:
|
||||
// Current quantities for use in appropriate commands
|
||||
static G4int fCurrentArrow3DLineSegmentsPerCircle;
|
||||
static G4Colour fCurrentColour;
|
||||
//static G4VMarker::FillStyle fCurrentFillStyle; Not yet used.
|
||||
//static G4VMarker::SizeType fCurrentSizeType; Not yet used.
|
||||
static G4double fCurrentLineWidth;
|
||||
//static G4VisAttributes::LineStyle fCurrentLineStyle; Not yet used.
|
||||
//static G4VMarker::FillStyle fCurrentFillStyle; Not yet used.
|
||||
//static G4VMarker::SizeType fCurrentSizeType; Not yet used.
|
||||
static G4Colour fCurrentTextColour;
|
||||
static G4Text::Layout fCurrentTextLayout;
|
||||
static G4double fCurrentTextSize;
|
||||
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath;
|
||||
static G4PhysicalVolumeModel::TouchableProperties fCurrentTouchableProperties;
|
||||
};
|
||||
|
||||
#include "G4VVisCommand.icc"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisCommand.icc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
// Base class for visualization commands - John Allison 9th August 1998
|
||||
// It is really a messenger - we have one command per messenger.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ViewParameters.hh 109510 2018-04-26 07:15:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ViewParameters.icc 109510 2018-04-26 07:15:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ViewerList.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison May 1996
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisCommandModelCreate.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl October 2005
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommands.hh 106384 2017-10-09 09:34:51Z gcosmo $
|
||||
|
||||
// /vis/ top level commands - John Allison 5th February 2001
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsCompound.hh 110513 2018-05-28 07:37:38Z gcosmo $
|
||||
|
||||
// Compound /vis/ commands - John Allison 15th May 2000
|
||||
|
||||
@@ -74,7 +73,7 @@ public:
|
||||
private:
|
||||
G4VisCommandDrawVolume (const G4VisCommandDrawVolume&);
|
||||
G4VisCommandDrawVolume& operator = (const G4VisCommandDrawVolume&);
|
||||
G4UIcmdWithAString* fpCommand;
|
||||
G4UIcommand* fpCommand;
|
||||
};
|
||||
|
||||
class G4VisCommandOpen: public G4VVisCommand {
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsGeometry.hh 66870 2013-01-14 23:38:59Z adotti $
|
||||
|
||||
// /vis/geometry commands - John Allison 31st January 2006
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsGeometrySet.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
// /vis/geometry commands - John Allison 31st January 2006
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisCommandsListManager.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl October 2005
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsMultithreading.hh 66264 2012-12-14 10:17:44Z allison $
|
||||
|
||||
// /vis/multithreading commands - John Allison 29th September 2015
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsScene.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
// /vis/scene commands - John Allison 9th August 1998
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsSceneAdd.hh 104163 2017-05-15 06:52:42Z gcosmo $
|
||||
|
||||
// /vis/scene commands - John Allison 9th August 1998
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsSceneHandler.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
// /vis/sceneHandler commands - John Allison 10th October 1998
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommands.hh,v 1.8 2009-03-09 12:42:00 allison Exp $
|
||||
|
||||
// /vis/set - John Allison 21st March 2012
|
||||
// Set quantities for use in appropriate future commands.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsTouchableSet.hh 66264 2012-12-14 10:17:44Z allison $
|
||||
|
||||
// /vis/touchable/set commands - John Allison 14th May 2014
|
||||
|
||||
@@ -33,6 +32,7 @@
|
||||
|
||||
#include "G4VisCommands.hh"
|
||||
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
class G4VisCommandsTouchable: public G4VVisCommand {
|
||||
@@ -44,7 +44,8 @@ public:
|
||||
private:
|
||||
G4VisCommandsTouchable (const G4VisCommandsTouchable&);
|
||||
G4VisCommandsTouchable& operator = (const G4VisCommandsTouchable&);
|
||||
G4UIcmdWithoutParameter* fpCommandDump;
|
||||
G4UIcmdWithoutParameter* fpCommandDump;
|
||||
G4UIcmdWithAString* fpCommandFindPath;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsTouchableSet.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
// /vis/touchable/set commands - John Allison 8th October 2012
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsViewer.hh 109510 2018-04-26 07:15:57Z gcosmo $
|
||||
|
||||
// /vis/viewer commands - John Allison 25th October 1998
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsDefault.hh,v 1.3 2006-06-29 21:28:34 gunter Exp $
|
||||
|
||||
// /vis/viewer/default commands - John Allison 30th October 2011
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsViewerSet.hh 108131 2018-01-09 13:23:26Z gcosmo $
|
||||
|
||||
// /vis/viewer/set commands - John Allison 16th May 2000
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisExecutive.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 2nd February 2005 (based on MyVisManager, 24th January 1998).
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisExecutive.icc 98766 2016-08-09 14:17:17Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
@@ -89,6 +88,10 @@
|
||||
#include "G4OpenInventorXtExtended.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIQT
|
||||
#include "G4OpenInventorQt.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
@@ -227,6 +230,10 @@ G4VisExecutive::RegisterGraphicsSystems () {
|
||||
RegisterGraphicsSystem (new G4OpenInventorXtExtended);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIQT
|
||||
RegisterGraphicsSystem(new G4OpenInventorQt);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_RAYTRACERX
|
||||
RegisterGraphicsSystem (new G4RayTracerX);
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisFilterManager.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
// Filter manager. Manages filter models, factories, messengers,
|
||||
// command placement, filter mode etc
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisListManager.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl October 2005
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisManager.hh 106384 2017-10-09 09:34:51Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisManager.icc 105349 2017-07-21 12:23:24Z gcosmo $
|
||||
//
|
||||
//
|
||||
// GEANT4 Visualization Manager - John Allison 02/Jan/1996.
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisModelManager.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
// Generic model manager. Manages models, associated
|
||||
// factories, messengers, command placement etc
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisStateDependent.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
// A "state dependent" service class for G4VisManager.
|
||||
// John Allison 29th November 1999
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake 99176 2016-09-07 09:46:36Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GraphicsSystemList.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
#include "G4GraphicsSystemList.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Scene.cc 101958 2016-12-12 08:04:35Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Scene data John Allison 19th July 1996.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SceneHandlerList.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
#include "G4SceneHandlerList.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SceneList.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
#include "G4SceneList.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VGraphicsSystem.cc 99418 2016-09-21 09:18:42Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 27th March 1996
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VSceneHandler.cc 109510 2018-04-26 07:15:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996
|
||||
@@ -615,6 +614,13 @@ void G4VSceneHandler::ProcessScene () {
|
||||
|
||||
if (!fpScene) return;
|
||||
|
||||
if (fpScene->GetExtent() == G4VisExtent::GetNullExtent()) {
|
||||
G4Exception
|
||||
("G4VSceneHandler::ProcessScene",
|
||||
"visman0106", JustWarning,
|
||||
"The scene has no extent.");
|
||||
}
|
||||
|
||||
G4VisManager* visManager = G4VisManager::GetInstance();
|
||||
|
||||
if (!visManager->GetConcreteInstance()) return;
|
||||
@@ -646,19 +652,20 @@ void G4VSceneHandler::ProcessScene () {
|
||||
|
||||
for (size_t i = 0; i < runDurationModelList.size (); i++) {
|
||||
if (runDurationModelList[i].fActive) {
|
||||
G4VModel* pModel = runDurationModelList[i].fpModel;
|
||||
fpModel = runDurationModelList[i].fpModel;
|
||||
// Note: this is not the place to take action on
|
||||
// pModel->GetTransformation(). The model must take care of
|
||||
// this in pModel->DescribeYourselfTo(*this). See, for example,
|
||||
// G4PhysicalVolumeModel and /vis/scene/add/logo.
|
||||
pModel -> SetModelingParameters (pMP);
|
||||
SetModel (pModel); // Store for use by derived class.
|
||||
pModel -> DescribeYourselfTo (*this);
|
||||
pModel -> SetModelingParameters (0);
|
||||
fpModel -> SetModelingParameters (pMP);
|
||||
fpModel -> DescribeYourselfTo (*this);
|
||||
fpModel -> SetModelingParameters (0);
|
||||
}
|
||||
}
|
||||
|
||||
fpModel = 0;
|
||||
delete pMP;
|
||||
|
||||
EndModeling ();
|
||||
}
|
||||
|
||||
@@ -742,15 +749,14 @@ void G4VSceneHandler::DrawEvent(const G4Event* event)
|
||||
pMP->SetEvent(event);
|
||||
for (size_t i = 0; i < nModels; i++) {
|
||||
if (EOEModelList[i].fActive) {
|
||||
G4VModel* pModel = EOEModelList[i].fpModel;
|
||||
pModel -> SetModelingParameters(pMP);
|
||||
SetModel (pModel);
|
||||
pModel -> DescribeYourselfTo (*this);
|
||||
pModel -> SetModelingParameters(0);
|
||||
fpModel = EOEModelList[i].fpModel;
|
||||
fpModel -> SetModelingParameters(pMP);
|
||||
fpModel -> DescribeYourselfTo (*this);
|
||||
fpModel -> SetModelingParameters(0);
|
||||
}
|
||||
}
|
||||
fpModel = 0;
|
||||
delete pMP;
|
||||
SetModel (0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -764,15 +770,14 @@ void G4VSceneHandler::DrawEndOfRunModels()
|
||||
pMP->SetEvent(0);
|
||||
for (size_t i = 0; i < nModels; i++) {
|
||||
if (EORModelList[i].fActive) {
|
||||
G4VModel* pModel = EORModelList[i].fpModel;
|
||||
pModel -> SetModelingParameters(pMP);
|
||||
SetModel (pModel);
|
||||
pModel -> DescribeYourselfTo (*this);
|
||||
pModel -> SetModelingParameters(0);
|
||||
fpModel = EORModelList[i].fpModel;
|
||||
fpModel -> SetModelingParameters(pMP);
|
||||
fpModel -> DescribeYourselfTo (*this);
|
||||
fpModel -> SetModelingParameters(0);
|
||||
}
|
||||
}
|
||||
fpModel = 0;
|
||||
delete pMP;
|
||||
SetModel (0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VViewer.cc 101714 2016-11-22 08:53:13Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 27th March 1996
|
||||
@@ -157,7 +156,7 @@ void G4VViewer::TouchableSetVisibility
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASVisibility,
|
||||
fullPath));
|
||||
G4PhysicalVolumeModel::GetPVNameCopyNoPath(fullPath)));
|
||||
// G4ModelingParameters::VASVisibility (VAS = Vis Attribute Signifier)
|
||||
// signifies that it is the visibility that should be picked out
|
||||
// and merged with the touchable's normal vis attributes.
|
||||
@@ -192,7 +191,7 @@ void G4VViewer::TouchableSetColour
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASColour,
|
||||
fullPath));
|
||||
G4PhysicalVolumeModel::GetPVNameCopyNoPath(fullPath)));
|
||||
// G4ModelingParameters::VASColour (VAS = Vis Attribute Signifier)
|
||||
// signifies that it is the colour that should be picked out
|
||||
// and merged with the touchable's normal vis attributes.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisCommand.cc 109510 2018-04-26 07:15:57Z gcosmo $
|
||||
|
||||
// Base class for visualization commands - John Allison 9th August 1998
|
||||
// It is really a messenger - we have one command per messenger.
|
||||
@@ -48,7 +47,7 @@ G4double G4VVisCommand::fCurrentLineWidth = 1.; // pixels
|
||||
// Not yet used: G4VisAttributes::LineStyle G4VVisCommand::fCurrentLineStyle = G4VisAttributes::unbroken;
|
||||
// Not yet used: G4VMarker::FillStyle G4VVisCommand::fCurrentFillStyle = G4VMarker::filled;
|
||||
// Not yet used: G4VMarker::SizeType G4VVisCommand::fCurrentSizeType = G4VMarker::screen;
|
||||
G4ModelingParameters::PVNameCopyNoPath G4VVisCommand::fCurrentTouchablePath;
|
||||
G4PhysicalVolumeModel::TouchableProperties G4VVisCommand::fCurrentTouchableProperties;
|
||||
|
||||
G4VVisCommand::G4VVisCommand () {}
|
||||
|
||||
@@ -188,41 +187,32 @@ G4bool G4VVisCommand::ProvideValueOfUnit
|
||||
return success;
|
||||
}
|
||||
|
||||
void G4VVisCommand::UpdateVisManagerScene
|
||||
(const G4String& sceneName) {
|
||||
|
||||
void G4VVisCommand::CheckSceneAndNotifyHandlers(G4Scene* pScene)
|
||||
{
|
||||
G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
|
||||
|
||||
const G4SceneList& sceneList = fpVisManager -> GetSceneList ();
|
||||
|
||||
G4int iScene, nScenes = sceneList.size ();
|
||||
for (iScene = 0; iScene < nScenes; iScene++) {
|
||||
if (sceneList [iScene] -> GetName () == sceneName) break;
|
||||
}
|
||||
|
||||
G4Scene* pScene = 0; // Zero unless scene has been found...
|
||||
if (iScene < nScenes) {
|
||||
pScene = sceneList [iScene];
|
||||
}
|
||||
|
||||
if (!pScene) {
|
||||
if (verbosity >= G4VisManager::warnings) {
|
||||
G4cout << "WARNING: Scene \"" << sceneName << "\" not found."
|
||||
<< G4endl;
|
||||
G4cout << "WARNING: Scene pointer is null."
|
||||
<< G4endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fpVisManager -> SetCurrentScene (pScene);
|
||||
|
||||
// Scene has changed. Refresh viewers of all sceneHandlers using
|
||||
// this scene...
|
||||
G4VViewer* pViewer = fpVisManager -> GetCurrentViewer();
|
||||
G4VSceneHandler* sceneHandler = fpVisManager -> GetCurrentSceneHandler();
|
||||
if (sceneHandler && sceneHandler -> GetScene ()) {
|
||||
if (pViewer) {
|
||||
G4UImanager::GetUIpointer () ->
|
||||
ApplyCommand ("/vis/scene/notifyHandlers");
|
||||
G4VSceneHandler* pSceneHandler = fpVisManager -> GetCurrentSceneHandler();
|
||||
if (!pSceneHandler) {
|
||||
if (verbosity >= G4VisManager::warnings) {
|
||||
G4cout << "WARNING: Scene handler not found." << G4endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Scene has changed. If it is the scene of the currrent scene handler
|
||||
// refresh viewers of all scene handlers using this scene. If not, it may be
|
||||
// a scene that the user is building up before attaching to a scene handler,
|
||||
// so do nothing.
|
||||
if (pScene == pSceneHandler->GetScene()) {
|
||||
G4UImanager::GetUIpointer () -> ApplyCommand ("/vis/scene/notifyHandlers");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ViewParameters.cc 109510 2018-04-26 07:15:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996
|
||||
@@ -1003,7 +1002,7 @@ std::ostream& operator << (std::ostream& os, const G4ViewParameters& v) {
|
||||
os
|
||||
<< "\n Light front position: "
|
||||
<< v.fDisplayLightFrontX/mm << ' ' << v.fDisplayLightFrontY/mm
|
||||
<< v.fDisplayLightFrontZ/mm << " mm"
|
||||
<< ' ' << v.fDisplayLightFrontZ/mm << " mm"
|
||||
<< "\n Light front time: " << v.fDisplayLightFrontT/ns << " ns"
|
||||
<< "\n Light front colour: " << v.fDisplayLightFrontRed
|
||||
<< ' ' << v.fDisplayLightFrontGreen << ' ' << v.fDisplayLightFrontBlue;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ViewerList.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
#include "G4ViewerList.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommands.cc 106384 2017-10-09 09:34:51Z gcosmo $
|
||||
|
||||
// /vis/ top level commands - John Allison 5th February 2001
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsCompound.cc 110513 2018-05-28 07:37:38Z gcosmo $
|
||||
|
||||
// Compound /vis/ commands - John Allison 15th May 2000
|
||||
|
||||
@@ -32,6 +31,7 @@
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
|
||||
#include <sstream>
|
||||
@@ -198,48 +198,31 @@ void G4VisCommandDrawView::SetNewValue(G4UIcommand*, G4String newValue) {
|
||||
UImanager->SetVerboseLevel(keepVerbose);
|
||||
}
|
||||
|
||||
////////////// /vis/specify ///////////////////////////////////////
|
||||
////////////// /vis/drawLogicalVolume ///////////////////////////////////////
|
||||
|
||||
G4VisCommandDrawLogicalVolume::G4VisCommandDrawLogicalVolume() {
|
||||
G4bool omitable;
|
||||
fpCommand = new G4UIcommand("/vis/drawLogicalVolume", this);
|
||||
fpCommand->SetGuidance
|
||||
("Draws logical volume with Boolean components, voxels and readout geometry.");
|
||||
("Draws logical volume with additional components.");
|
||||
fpCommand->SetGuidance
|
||||
("Synonymous with \"/vis/specify\".");
|
||||
fpCommand->SetGuidance
|
||||
("Creates a scene consisting of this logical volume and asks the"
|
||||
"\n current viewer to draw it to the specified depth of descent"
|
||||
"\n showing boolean components (if any), voxels (if any),"
|
||||
"\n readout geometry (if any), local axes and overlaps (if any),"
|
||||
"\n under control of the appropriate flag.");
|
||||
fpCommand->SetGuidance
|
||||
("Note: voxels are not constructed until start of run - /run/beamOn."
|
||||
"\n (For voxels without a run, \"/run/beamOn 0\".)");
|
||||
fpCommand->SetGuidance("The scene becomes current.");
|
||||
G4UIparameter* parameter;
|
||||
parameter = new G4UIparameter("logical-volume-name", 's', omitable = false);
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("depth-of-descent", 'i', omitable = true);
|
||||
parameter->SetDefaultValue(1);
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("booleans-flag", 'b', omitable = true);
|
||||
parameter->SetDefaultValue(true);
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("voxels-flag", 'b', omitable = true);
|
||||
parameter->SetDefaultValue(true);
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("readout-flag", 'b', omitable = true);
|
||||
parameter->SetDefaultValue(true);
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("axes-flag", 'b', omitable = true);
|
||||
parameter->SetDefaultValue(true);
|
||||
parameter -> SetGuidance ("Set \"false\" to suppress axes.");
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("check-overlap-flag", 'b', omitable = true);
|
||||
parameter->SetDefaultValue(true);
|
||||
parameter -> SetGuidance ("Set \"false\" to suppress overlap check.");
|
||||
fpCommand->SetParameter(parameter);
|
||||
"\n current viewer to draw it. The scene becomes current.");
|
||||
const G4UIcommandTree* tree = G4UImanager::GetUIpointer()->GetTree();
|
||||
const G4UIcommand* addLogVolCmd = tree->FindPath("/vis/scene/add/logicalVolume");
|
||||
// Pick up guidance from /vis/scene/add/logicalVolume
|
||||
G4int nGuideEntries = addLogVolCmd->GetGuidanceEntries();
|
||||
for (G4int i = 0; i < nGuideEntries; ++i) {
|
||||
const G4String& guidance = addLogVolCmd->GetGuidanceLine(i);
|
||||
fpCommand->SetGuidance(guidance);
|
||||
}
|
||||
// Pick up parameters from /vis/scene/add/logicalVolume
|
||||
G4int nParEntries = addLogVolCmd->GetParameterEntries();
|
||||
for (G4int i = 0; i < nParEntries; ++i) {
|
||||
G4UIparameter* parameter = new G4UIparameter(*(addLogVolCmd->GetParameter(i)));
|
||||
fpCommand->SetParameter(parameter);
|
||||
}
|
||||
}
|
||||
|
||||
G4VisCommandDrawLogicalVolume::~G4VisCommandDrawLogicalVolume() {
|
||||
@@ -254,11 +237,46 @@ void G4VisCommandDrawLogicalVolume::SetNewValue(G4UIcommand*, G4String newValue)
|
||||
if (keepVerbose >= 2 || verbosity >= G4VisManager::confirmations)
|
||||
newVerbose = 2;
|
||||
UImanager->SetVerboseLevel(newVerbose);
|
||||
// UImanager->ApplyCommand(G4String("/geometry/print " + newValue));
|
||||
G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
|
||||
const G4ViewParameters& currentViewParams = currentViewer->GetViewParameters();
|
||||
G4bool keepAutoRefresh = currentViewParams.IsAutoRefresh();
|
||||
if (keepAutoRefresh) UImanager->ApplyCommand("/vis/viewer/set/autoRefresh false");
|
||||
UImanager->ApplyCommand("/vis/scene/create");
|
||||
UImanager->ApplyCommand(G4String("/vis/scene/add/logicalVolume " + newValue));
|
||||
UImanager->ApplyCommand("/vis/sceneHandler/attach");
|
||||
G4ViewParameters::DrawingStyle keepDrawingStyle = currentViewParams.GetDrawingStyle();
|
||||
if(keepDrawingStyle != G4ViewParameters::wireframe) UImanager->ApplyCommand("/vis/viewer/set/style wireframe");
|
||||
G4bool keepMarkerNotHidden = currentViewParams.IsMarkerNotHidden();
|
||||
if (!keepMarkerNotHidden) UImanager->ApplyCommand("/vis/viewer/set/hiddenMarker false");
|
||||
if (keepAutoRefresh) UImanager->ApplyCommand("/vis/viewer/set/autoRefresh true");
|
||||
UImanager->SetVerboseLevel(keepVerbose);
|
||||
if (verbosity >= G4VisManager::warnings) {
|
||||
if (keepDrawingStyle != currentViewParams.GetDrawingStyle()) {
|
||||
G4cout
|
||||
<< "Drawing style changed to wireframe. To restore previous style:";
|
||||
G4String style, edge;
|
||||
switch (keepDrawingStyle) {
|
||||
case G4ViewParameters::wireframe:
|
||||
style = "wireframe"; edge = "false"; break;
|
||||
case G4ViewParameters::hlr:
|
||||
style = "wireframe"; edge = "true"; break;
|
||||
case G4ViewParameters::hsr:
|
||||
style = "surface"; edge = "false"; break;
|
||||
case G4ViewParameters::hlhsr:
|
||||
style = "surface"; edge = "true"; break;
|
||||
}
|
||||
G4cout
|
||||
<< "\n /vis/viewer/set/style " + style
|
||||
<< "\n /vis/viewer/set/hiddenEdge " + edge
|
||||
<< G4endl;
|
||||
}
|
||||
if (keepMarkerNotHidden != currentViewParams.IsMarkerNotHidden()) {
|
||||
G4cout
|
||||
<< "Markers changed to \"not hidden\". To restore previous condition:"
|
||||
<< "\n /vis/viewer/set/hiddenmarker true"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
static G4bool warned = false;
|
||||
if (verbosity >= G4VisManager::confirmations && !warned) {
|
||||
G4cout <<
|
||||
@@ -272,21 +290,24 @@ void G4VisCommandDrawLogicalVolume::SetNewValue(G4UIcommand*, G4String newValue)
|
||||
////////////// /vis/drawVolume ///////////////////////////////////////
|
||||
|
||||
G4VisCommandDrawVolume::G4VisCommandDrawVolume() {
|
||||
G4bool omitable;
|
||||
fpCommand = new G4UIcmdWithAString("/vis/drawVolume", this);
|
||||
fpCommand = new G4UIcommand("/vis/drawVolume", this);
|
||||
fpCommand->SetGuidance
|
||||
("Creates a scene containing this physical volume and asks the"
|
||||
"\ncurrent viewer to draw it. The scene becomes current.");
|
||||
fpCommand -> SetGuidance
|
||||
("If physical-volume-name is \"world\" (the default), the main geometry"
|
||||
"\ntree (material world) is drawn. If \"worlds\", all worlds - material"
|
||||
"\nworld and parallel worlds, if any - are drawn. Otherwise a search of"
|
||||
"\nall worlds is made, taking the first matching occurence only. To see"
|
||||
"\na representation of the geometry hierarchy of the worlds, try"
|
||||
"\n\"/vis/drawTree worlds\" or one of the driver/browser combinations"
|
||||
"\nthat have the required functionality, e.g., HepRepFile/HepRApp.");
|
||||
fpCommand->SetParameterName("physical-volume-name", omitable = true);
|
||||
fpCommand->SetDefaultValue("world");
|
||||
("Creates a scene containing this physical volume and asks the"
|
||||
"\ncurrent viewer to draw it. The scene becomes current.");
|
||||
const G4UIcommandTree* tree = G4UImanager::GetUIpointer()->GetTree();
|
||||
const G4UIcommand* addVolCmd = tree->FindPath("/vis/scene/add/volume");
|
||||
// Pick up guidance from /vis/scene/add/volume
|
||||
G4int nGuideEntries = addVolCmd->GetGuidanceEntries();
|
||||
for (G4int i = 0; i < nGuideEntries; ++i) {
|
||||
const G4String& guidance = addVolCmd->GetGuidanceLine(i);
|
||||
fpCommand->SetGuidance(guidance);
|
||||
}
|
||||
// Pick up parameters from /vis/scene/add/volume
|
||||
G4int nParEntries = addVolCmd->GetParameterEntries();
|
||||
for (G4int i = 0; i < nParEntries; ++i) {
|
||||
G4UIparameter* parameter = new G4UIparameter(*(addVolCmd->GetParameter(i)));
|
||||
fpCommand->SetParameter(parameter);
|
||||
}
|
||||
}
|
||||
|
||||
G4VisCommandDrawVolume::~G4VisCommandDrawVolume() {
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsGeometry.cc 88762 2015-03-09 12:25:11Z gcosmo $
|
||||
|
||||
// /vis/geometry commands - John Allison 31st January 2006
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsGeometrySet.cc 104123 2017-05-11 13:51:32Z gcosmo $
|
||||
|
||||
// /vis/geometry commands - John Allison 31st January 2006
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsMultithreading.cc 88742 2015-03-08 13:12:57Z allison $
|
||||
|
||||
// /vis/multithreading commands - John Allison 29th September 2015
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsScene.cc 87360 2014-12-01 16:07:16Z gcosmo $
|
||||
|
||||
// /vis/scene commands - John Allison 9th August 1998
|
||||
|
||||
@@ -185,8 +184,7 @@ void G4VisCommandSceneActivateModel::SetNewValue (G4UIcommand*,
|
||||
return;
|
||||
}
|
||||
|
||||
const G4String& currentSceneName = pScene -> GetName ();
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/create ///////////////////////////////////////
|
||||
@@ -819,5 +817,6 @@ void G4VisCommandSceneSelect::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
G4cout << "Scene \"" << selectName
|
||||
<< "\" selected." << G4endl;
|
||||
}
|
||||
UpdateVisManagerScene (selectName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (sceneList [iScene]);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsSceneAdd.cc 110480 2018-05-25 07:25:18Z gcosmo $
|
||||
// /vis/scene/add commands - John Allison 9th August 1998
|
||||
|
||||
#include "G4VisCommandsSceneAdd.hh"
|
||||
@@ -44,7 +43,7 @@
|
||||
#include "G4TextModel.hh"
|
||||
#include "G4ArrowModel.hh"
|
||||
#include "G4AxesModel.hh"
|
||||
#include "G4PhysicalVolumeSearchScene.hh"
|
||||
#include "G4PhysicalVolumesSearchScene.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ApplicationState.hh"
|
||||
@@ -166,7 +165,8 @@ void G4VisCommandSceneAddArrow::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/add/arrow2D ///////////////////////////////////////
|
||||
@@ -228,7 +228,8 @@ void G4VisCommandSceneAddArrow2D::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
G4VisCommandSceneAddArrow2D::Arrow2D::Arrow2D
|
||||
@@ -375,7 +376,8 @@ void G4VisCommandSceneAddAxes::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/add/date ///////////////////////////////////////
|
||||
@@ -462,7 +464,8 @@ void G4VisCommandSceneAddDate::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
void G4VisCommandSceneAddDate::Date::operator()
|
||||
@@ -529,7 +532,8 @@ void G4VisCommandSceneAddDigis::SetNewValue (G4UIcommand*, G4String) {
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/add/eventID ///////////////////////////////////////
|
||||
@@ -608,7 +612,8 @@ void G4VisCommandSceneAddEventID::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
void G4VisCommandSceneAddEventID::EventID::operator()
|
||||
@@ -772,7 +777,8 @@ void G4VisCommandSceneAddExtent::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
G4VisCommandSceneAddExtent::Extent::Extent
|
||||
@@ -841,7 +847,8 @@ void G4VisCommandSceneAddFrame::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
void G4VisCommandSceneAddFrame::Frame::operator()
|
||||
@@ -928,7 +935,8 @@ void G4VisCommandSceneAddFrame::Frame::operator()
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/add/hits ///////////////////////////////////////
|
||||
@@ -973,7 +981,8 @@ void G4VisCommandSceneAddHits::SetNewValue (G4UIcommand*, G4String) {
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/add/line ///////////////////////////////////////
|
||||
@@ -1046,7 +1055,8 @@ void G4VisCommandSceneAddLine::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
G4VisCommandSceneAddLine::Line::Line
|
||||
@@ -1130,7 +1140,8 @@ void G4VisCommandSceneAddLine2D::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
G4VisCommandSceneAddLine2D::Line2D::Line2D
|
||||
@@ -1328,7 +1339,7 @@ void G4VisCommandSceneAddLogicalVolume::SetNewValue (G4UIcommand*,
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
|
||||
@@ -1633,7 +1644,8 @@ void G4VisCommandSceneAddLogo::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
G4VisCommandSceneAddLogo::G4Logo::G4Logo
|
||||
@@ -1796,7 +1808,8 @@ void G4VisCommandSceneAddLogo2D::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
void G4VisCommandSceneAddLogo2D::Logo2D::operator()
|
||||
@@ -1891,7 +1904,8 @@ void G4VisCommandSceneAddMagneticField::SetNewValue
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/add/psHits ///////////////////////////////////////
|
||||
@@ -1949,7 +1963,8 @@ void G4VisCommandSceneAddPSHits::SetNewValue
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/add/scale //////////////////////////////////
|
||||
@@ -2328,7 +2343,8 @@ void G4VisCommandSceneAddScale::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
|
||||
@@ -2424,7 +2440,8 @@ void G4VisCommandSceneAddText::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
|
||||
@@ -2514,7 +2531,8 @@ void G4VisCommandSceneAddText2D::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
}
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
G4VisCommandSceneAddText2D::G4Text2D::G4Text2D(const G4Text& text):
|
||||
@@ -2583,6 +2601,7 @@ void G4VisCommandSceneAddTrajectories::SetNewValue (G4UIcommand*,
|
||||
}
|
||||
return;
|
||||
}
|
||||
const G4String& currentSceneName = pScene -> GetName ();
|
||||
|
||||
G4bool smooth = false;
|
||||
G4bool rich = false;
|
||||
@@ -2636,9 +2655,19 @@ void G4VisCommandSceneAddTrajectories::SetNewValue (G4UIcommand*,
|
||||
}
|
||||
}
|
||||
|
||||
G4VModel* model = new G4TrajectoriesModel();
|
||||
const G4String& currentSceneName = pScene -> GetName ();
|
||||
pScene -> AddEndOfEventModel (model, warn);
|
||||
const auto& eoeList = pScene->GetEndOfEventModelList();
|
||||
auto eoeModel = eoeList.begin();
|
||||
for (; eoeModel != eoeList.end(); ++eoeModel) {
|
||||
const auto* actualModel = eoeModel->fpModel;
|
||||
if (dynamic_cast<const G4TrajectoriesModel*>(actualModel)) break;
|
||||
}
|
||||
if (eoeModel == eoeList.end()) {
|
||||
// No trajectories model exists in the scene so create a new one...
|
||||
G4VModel* model = new G4TrajectoriesModel();
|
||||
pScene -> AddEndOfEventModel (model, warn);
|
||||
} // ...else it already exists and there is no need to add a new one
|
||||
// because G4TrajectoriesModel simply describes trajectories in the
|
||||
// trajectories store whatever the type.
|
||||
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
G4cout << "Default trajectory type " << defaultTrajectoryType
|
||||
@@ -2653,7 +2682,8 @@ void G4VisCommandSceneAddTrajectories::SetNewValue (G4UIcommand*,
|
||||
"\n reversed with \"/tracking/storeTrajectory 0\"."
|
||||
<< G4endl;
|
||||
}
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
////////////// /vis/scene/add/userAction ///////////////////////////////////
|
||||
@@ -2736,8 +2766,7 @@ void G4VisCommandSceneAddUserAction::SetNewValue
|
||||
return;
|
||||
}
|
||||
|
||||
const G4String& currentSceneName = pScene -> GetName ();
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
CheckSceneAndNotifyHandlers (pScene);
|
||||
}
|
||||
|
||||
void G4VisCommandSceneAddUserAction::AddVisAction
|
||||
@@ -2778,14 +2807,16 @@ void G4VisCommandSceneAddUserAction::AddVisAction
|
||||
successful = pScene -> AddEndOfRunModel (model, warn);
|
||||
break;
|
||||
}
|
||||
if (successful && verbosity >= G4VisManager::confirmations) {
|
||||
const G4String& currentSceneName = pScene -> GetName ();
|
||||
G4cout << "User Vis Action added to scene \""
|
||||
<< currentSceneName << "\"";
|
||||
if (verbosity >= G4VisManager::parameters) {
|
||||
G4cout << "\n with extent " << extent;
|
||||
if (successful) {
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
const G4String& currentSceneName = pScene -> GetName ();
|
||||
G4cout << "User Vis Action added to scene \""
|
||||
<< currentSceneName << "\"";
|
||||
if (verbosity >= G4VisManager::parameters) {
|
||||
G4cout << "\n with extent " << extent;
|
||||
}
|
||||
G4cout << G4endl;
|
||||
}
|
||||
G4cout << G4endl;
|
||||
}
|
||||
else G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
}
|
||||
@@ -2801,10 +2832,18 @@ G4VisCommandSceneAddVolume::G4VisCommandSceneAddVolume () {
|
||||
("If physical-volume-name is \"world\" (the default), the top of the"
|
||||
"\nmain geometry tree (material world) is added. If \"worlds\", the"
|
||||
"\ntop of all worlds - material world and parallel worlds, if any - are"
|
||||
"\nadded. Otherwise a search of all worlds is made, taking the first"
|
||||
"\nmatching occurence only. To see a representation of the geometry"
|
||||
"\nhierarchy of the worlds, try \"/vis/drawTree [worlds]\" or one of the"
|
||||
"\ndriver/browser combinations that have the required functionality, e.g., HepRep.");
|
||||
"\nadded. Otherwise a search of all worlds is made.");
|
||||
fpCommand -> SetGuidance
|
||||
("In the last case (a search of all worlds) all physical volume names are"
|
||||
"\nmatched against the first argument of this command. If this is of the"
|
||||
"\nform \"/regexp/\", where regexp is a regular expression (see C++ regex),"
|
||||
"\nthe physical volume name is matched against regexp by the usual rules"
|
||||
"\nof regular expression matching. Otherwise an exact match is required."
|
||||
"\nFor example, \"/Shap/\" matches \"Shape1\" and \"Shape2\".");
|
||||
fpCommand -> SetGuidance
|
||||
("It may help to see a textual representation of the geometry hierarchy of"
|
||||
"\nthe worlds. Try \"/vis/drawTree [worlds]\" or one of the driver/browser"
|
||||
"\ncombinations that have the required functionality, e.g., HepRep.");
|
||||
fpCommand -> SetGuidance
|
||||
("If clip-volume-type is specified, the subsequent parameters are used to"
|
||||
"\nto define a clipping volume. For example,"
|
||||
@@ -2903,6 +2942,20 @@ void G4VisCommandSceneAddVolume::SetNewValue (G4UIcommand*,
|
||||
param1 *= unit; param2 *= unit; param3 *= unit;
|
||||
param4 *= unit; param5 *= unit; param6 *= unit;
|
||||
|
||||
G4VSolid* clippingSolid = nullptr;
|
||||
if (clipVolumeType == "box") {
|
||||
const G4double dX = (param2 - param1) / 2.;
|
||||
const G4double dY = (param4 - param3) / 2.;
|
||||
const G4double dZ = (param6 - param5) / 2.;
|
||||
const G4double x0 = (param2 + param1) / 2.;
|
||||
const G4double y0 = (param4 + param3) / 2.;
|
||||
const G4double z0 = (param6 + param5) / 2.;
|
||||
clippingSolid = new G4DisplacedSolid
|
||||
("_displaced_clipping_box",
|
||||
new G4Box("_clipping_box",dX,dY,dZ),
|
||||
G4Translate3D(x0,y0,z0));
|
||||
}
|
||||
|
||||
G4TransportationManager* transportationManager =
|
||||
G4TransportationManager::GetTransportationManager ();
|
||||
|
||||
@@ -2941,26 +2994,16 @@ void G4VisCommandSceneAddVolume::SetNewValue (G4UIcommand*,
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<G4PhysicalVolumeModel*> models;
|
||||
std::vector<G4VPhysicalVolume*> foundVolumes;
|
||||
G4VPhysicalVolume* foundWorld = 0;
|
||||
typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
|
||||
typedef std::vector<PVNodeID> PVPath;
|
||||
PVPath foundFullPVPath;
|
||||
std::vector<G4int> foundDepths;
|
||||
std::vector<G4Transform3D> transformations;
|
||||
std::vector<G4PhysicalVolumesSearchScene::Findings> findingsVector;
|
||||
|
||||
if (name == "world") {
|
||||
|
||||
models.push_back
|
||||
(new G4PhysicalVolumeModel (world, requestedDepthOfDescent));
|
||||
foundVolumes.push_back(world);
|
||||
foundDepths.push_back(0);
|
||||
transformations.push_back(G4Transform3D());
|
||||
findingsVector.push_back
|
||||
(G4PhysicalVolumesSearchScene::Findings(world,world));
|
||||
|
||||
} else if (name == "worlds") {
|
||||
|
||||
if (nWorlds == 0) {
|
||||
if (nWorlds <= 1) {
|
||||
if (verbosity >= G4VisManager::warnings) {
|
||||
G4cout <<
|
||||
"WARNING: G4VisCommandSceneAddVolume::SetNewValue:"
|
||||
@@ -2972,106 +3015,78 @@ void G4VisCommandSceneAddVolume::SetNewValue (G4UIcommand*,
|
||||
std::vector<G4VPhysicalVolume*>::iterator iterWorld =
|
||||
transportationManager->GetWorldsIterator();
|
||||
for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
|
||||
models.push_back
|
||||
(new G4PhysicalVolumeModel (*iterWorld, requestedDepthOfDescent));
|
||||
foundVolumes.push_back(*iterWorld);
|
||||
foundDepths.push_back(0);
|
||||
transformations.push_back(G4Transform3D());
|
||||
findingsVector.push_back
|
||||
(G4PhysicalVolumesSearchScene::Findings
|
||||
(*iterWorld,*iterWorld));
|
||||
}
|
||||
|
||||
} else { // Search all worlds...
|
||||
|
||||
|
||||
std::vector<G4VPhysicalVolume*>::iterator iterWorld =
|
||||
transportationManager->GetWorldsIterator();
|
||||
for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
|
||||
G4PhysicalVolumeModel searchModel (*iterWorld); // Unlimited depth.
|
||||
G4ModelingParameters mp; // Default - no culling.
|
||||
searchModel.SetModelingParameters (&mp);
|
||||
G4PhysicalVolumeSearchScene searchScene (&searchModel, name, copyNo);
|
||||
G4PhysicalVolumesSearchScene searchScene (&searchModel, name, copyNo);
|
||||
searchModel.DescribeYourselfTo (searchScene); // Initiate search.
|
||||
G4VPhysicalVolume* foundVolume = searchScene.GetFoundVolume ();
|
||||
if (foundVolume) {
|
||||
foundWorld = *iterWorld;
|
||||
foundVolumes.push_back(foundVolume);
|
||||
foundFullPVPath = searchScene.GetFoundFullPVPath();
|
||||
foundDepths.push_back(searchScene.GetFoundDepth());
|
||||
transformations.push_back(searchScene.GetFoundTransformation());
|
||||
break;
|
||||
for (const auto& findings: searchScene.GetFindings()) {
|
||||
findingsVector.push_back(findings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundVolumes.size()) {
|
||||
for (size_t i = 0; i < foundVolumes.size(); ++i) {
|
||||
G4PhysicalVolumeModel* foundPVModel = new G4PhysicalVolumeModel
|
||||
(foundVolumes[i], requestedDepthOfDescent, transformations[i]);
|
||||
foundFullPVPath.pop_back(); // "Base" is "Found - 1".
|
||||
foundPVModel->SetBaseFullPVPath(foundFullPVPath);
|
||||
models.push_back(foundPVModel);
|
||||
for (const auto& findings: findingsVector) {
|
||||
// Set copy number from search findings to cope with replicas.
|
||||
findings.fpFoundPV->SetCopyNo(findings.fFoundPVCopyNo);
|
||||
// Create a physical volume model...
|
||||
G4PhysicalVolumeModel* foundPVModel = new G4PhysicalVolumeModel
|
||||
(findings.fpFoundPV,
|
||||
requestedDepthOfDescent,
|
||||
findings.fFoundObjectTransformation,
|
||||
0, // No modelling parameters (these are set later by the scene handler).
|
||||
false, // Do not use full extent - only use non-culled extent.
|
||||
findings.fFoundBasePVPath);
|
||||
if (clippingSolid) {
|
||||
foundPVModel->SetClippingSolid(clippingSolid);
|
||||
foundPVModel->SetClippingMode(clippingMode);
|
||||
}
|
||||
// ...and add it to the scene.
|
||||
G4bool successful = pScene->AddRunDurationModel(foundPVModel,warn);
|
||||
if (successful) {
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
G4cout << "\"" << findings.fpFoundPV->GetName()
|
||||
<< "\", copy no. " << findings.fFoundPVCopyNo
|
||||
<< ",\n found in searched volume \""
|
||||
<< findings.fpSearchPV->GetName()
|
||||
<< "\" at depth " << findings.fFoundDepth
|
||||
<< ",\n base path: \"" << findings.fFoundBasePVPath
|
||||
<< "\",\n with a requested depth of further descent of ";
|
||||
if (requestedDepthOfDescent < 0) {
|
||||
G4cout << "<0 (unlimited)";
|
||||
}
|
||||
else {
|
||||
G4cout << requestedDepthOfDescent;
|
||||
}
|
||||
G4cout << ",\n has been added to scene \"" << pScene->GetName() << "\"."
|
||||
<< G4endl;
|
||||
}
|
||||
} else {
|
||||
if (verbosity >= G4VisManager::errors) {
|
||||
G4cerr << "ERROR: Volume \"" << name << "\"";
|
||||
if (copyNo >= 0) {
|
||||
G4cerr << ", copy no. " << copyNo << ",";
|
||||
}
|
||||
G4cerr << " not found." << G4endl;
|
||||
}
|
||||
return;
|
||||
G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
}
|
||||
}
|
||||
|
||||
if (clipVolumeType == "box") {
|
||||
const G4double dX = (param2 - param1) / 2.;
|
||||
const G4double dY = (param4 - param3) / 2.;
|
||||
const G4double dZ = (param6 - param5) / 2.;
|
||||
const G4double x0 = (param2 + param1) / 2.;
|
||||
const G4double y0 = (param4 + param3) / 2.;
|
||||
const G4double z0 = (param6 + param5) / 2.;
|
||||
G4VSolid* clippingSolid =
|
||||
new G4DisplacedSolid
|
||||
("_displaced_clipping_box",
|
||||
new G4Box("_clipping_box",dX,dY,dZ),
|
||||
G4Translate3D(x0,y0,z0));
|
||||
for (size_t i = 0; i < foundVolumes.size(); ++i) {
|
||||
models[i]->SetClippingSolid(clippingSolid);
|
||||
models[i]->SetClippingMode(clippingMode);
|
||||
}
|
||||
} // If any other shape consider NumberOfRotationSides!!!!!!!!!!!
|
||||
|
||||
const G4String& currentSceneName = pScene -> GetName ();
|
||||
G4bool failure = true;
|
||||
for (size_t i = 0; i < foundVolumes.size(); ++i) {
|
||||
G4bool successful = pScene -> AddRunDurationModel (models[i], warn);
|
||||
if (successful) {
|
||||
failure = false;
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
G4cout << "First occurrence of \""
|
||||
<< foundVolumes[i] -> GetName ()
|
||||
<< "\"";
|
||||
if (copyNo >= 0) {
|
||||
G4cout << ", copy no. " << copyNo << ",";
|
||||
}
|
||||
G4cout << "\n found ";
|
||||
if (foundWorld)
|
||||
G4cout << "in world \"" << foundWorld->GetName() << "\" ";
|
||||
G4cout << "at depth " << foundDepths[i]
|
||||
<< ",\n with a requested depth of further descent of ";
|
||||
if (requestedDepthOfDescent < 0) {
|
||||
G4cout << "<0 (unlimited)";
|
||||
}
|
||||
else {
|
||||
G4cout << requestedDepthOfDescent;
|
||||
}
|
||||
G4cout << ",\n has been added to scene \"" << currentSceneName << "\"."
|
||||
<< G4endl;
|
||||
if (findingsVector.empty()) {
|
||||
if (verbosity >= G4VisManager::errors) {
|
||||
G4cerr << "ERROR: Volume \"" << name << "\"";
|
||||
if (copyNo >= 0) {
|
||||
G4cerr << ", copy no. " << copyNo << ",";
|
||||
}
|
||||
G4cerr << " not found." << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (failure) {
|
||||
G4VisCommandsSceneAddUnsuccessful(verbosity);
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateVisManagerScene (currentSceneName);
|
||||
CheckSceneAndNotifyHandlers(pScene);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsSceneHandler.cc 99418 2016-09-21 09:18:42Z gcosmo $
|
||||
|
||||
// /vis/sceneHandler commands - John Allison 10th October 1998
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommands.cc,v 1.24 2009-03-09 12:42:00 allison Exp $
|
||||
|
||||
// /vis/set - John Allison 21st March 2012
|
||||
// Set quantities for use in appropriate future commands.
|
||||
@@ -35,6 +34,8 @@
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4TouchablePropertiesScene.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include <sstream>
|
||||
|
||||
////////////// /vis/set/arrow3DLineSegmentsPerCircle ////////////////////////////////////
|
||||
@@ -392,12 +393,41 @@ void G4VisCommandSetTouchable::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
(G4ModelingParameters::PVNameCopyNo(name,copyNo));
|
||||
iBegin = newValue.find_first_not_of(' ',iEnd);
|
||||
}
|
||||
|
||||
fCurrentTouchablePath = currentTouchablePath;
|
||||
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
G4cout << fCurrentTouchablePath
|
||||
<< G4endl;
|
||||
|
||||
// Check validity
|
||||
G4bool successful = false;
|
||||
G4TransportationManager* transportationManager =
|
||||
G4TransportationManager::GetTransportationManager ();
|
||||
size_t nWorlds = transportationManager->GetNoWorlds();
|
||||
std::vector<G4VPhysicalVolume*>::iterator iterWorld =
|
||||
transportationManager->GetWorldsIterator();
|
||||
for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
|
||||
G4PhysicalVolumeModel pvModel (*iterWorld); // Unlimited depth.
|
||||
G4ModelingParameters mp; // Default - no culling.
|
||||
pvModel.SetModelingParameters (&mp);
|
||||
G4TouchablePropertiesScene scene (&pvModel,currentTouchablePath);
|
||||
pvModel.DescribeYourselfTo (scene); // Initiate geometry tree traversal.
|
||||
if (scene.GetFoundTouchableProperties().fpTouchablePV) {
|
||||
successful = true;
|
||||
fCurrentTouchableProperties = scene.GetFoundTouchableProperties();
|
||||
break; // Found, so no need to scan more worlds.
|
||||
}
|
||||
}
|
||||
|
||||
if (successful) {
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
G4cout <<
|
||||
"Current touchable: " << fCurrentTouchableProperties.fTouchablePath
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (verbosity >= G4VisManager::warnings) {
|
||||
G4cout <<
|
||||
"WARNING: G4VisCommandSetTouchable::SetNewValue"
|
||||
"\n Touchable not found."
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,15 +24,19 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsTouchable.cc 75794 2013-11-06 13:25:30Z allison $
|
||||
|
||||
// /vis/touchable commands - John Allison 14th May 2014
|
||||
|
||||
#include "G4VisCommandsTouchable.hh"
|
||||
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4TouchableDumpScene.hh"
|
||||
#include "G4TouchableUtils.hh"
|
||||
#include "G4PhysicalVolumesSearchScene.hh"
|
||||
#include "G4AttDef.hh"
|
||||
#include "G4AttValue.hh"
|
||||
#include "G4AttCheck.hh"
|
||||
|
||||
G4VisCommandsTouchable::G4VisCommandsTouchable()
|
||||
{
|
||||
@@ -42,6 +46,22 @@ G4VisCommandsTouchable::G4VisCommandsTouchable()
|
||||
("Use \"/vis/set/touchable\" to set current touchable.");
|
||||
fpCommandDump->SetGuidance
|
||||
("Use \"/vis/touchable/set\" to set attributes.");
|
||||
|
||||
fpCommandFindPath = new G4UIcmdWithAString("/vis/touchable/findPath",this);
|
||||
fpCommandFindPath->SetGuidance
|
||||
("Prints the path to touchable and its logical volume mother"
|
||||
"\ngiven a physical volume name.");
|
||||
fpCommandFindPath -> SetGuidance
|
||||
("A search of all worlds is made and all physical volume names are"
|
||||
"\nmatched against the argument of this command. If this is of the"
|
||||
"\nform \"/regexp/\", where regexp is a regular expression (see C++ regex),"
|
||||
"\nthe physical volume name is matched against regexp by the usual rules"
|
||||
"\nof regular expression matching. Otherwise an exact match is required."
|
||||
"\nFor example, \"/Shap/\" matches \"Shape1\" and \"Shape2\".");
|
||||
fpCommandFindPath -> SetGuidance
|
||||
("It may help to see a textual representation of the geometry hierarchy of"
|
||||
"\nthe worlds. Try \"/vis/drawTree [worlds]\" or one of the driver/browser"
|
||||
"\ncombinations that have the required functionality, e.g., HepRep.");
|
||||
}
|
||||
|
||||
G4VisCommandsTouchable::~G4VisCommandsTouchable() {
|
||||
@@ -53,7 +73,7 @@ G4String G4VisCommandsTouchable::GetCurrentValue(G4UIcommand*) {
|
||||
}
|
||||
|
||||
void G4VisCommandsTouchable::SetNewValue
|
||||
(G4UIcommand* command,G4String)
|
||||
(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
|
||||
|
||||
@@ -74,24 +94,67 @@ void G4VisCommandsTouchable::SetNewValue
|
||||
return;
|
||||
}
|
||||
|
||||
if (command == fpCommandDump)
|
||||
{
|
||||
G4bool found = false;
|
||||
std::vector<G4VPhysicalVolume*>::iterator iterWorld =
|
||||
transportationManager->GetWorldsIterator();
|
||||
for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
|
||||
G4PhysicalVolumeModel pvModel (*iterWorld); // Unlimited depth.
|
||||
G4ModelingParameters mp; // Default - no culling.
|
||||
pvModel.SetModelingParameters (&mp);
|
||||
G4TouchableDumpScene dumpScene (G4cout,&pvModel,fCurrentTouchablePath);
|
||||
pvModel.DescribeYourselfTo (dumpScene); // Initiate dump.
|
||||
if (dumpScene.IsFound()) found = true;
|
||||
}
|
||||
if (!found) {
|
||||
if (command == fpCommandDump) {
|
||||
|
||||
G4PhysicalVolumeModel::TouchableProperties properties =
|
||||
G4TouchableUtils::FindTouchableProperties(fCurrentTouchableProperties.fTouchablePath);
|
||||
if (properties.fpTouchablePV) {
|
||||
G4PhysicalVolumeModel pvModel
|
||||
(properties.fpTouchablePV,
|
||||
G4PhysicalVolumeModel::UNLIMITED,
|
||||
properties.fTouchableGlobalTransform,
|
||||
nullptr, // Modelling parameters (not used)
|
||||
true, // use full extent (prevents calculating own extent, which crashes)
|
||||
properties.fTouchableBaseFullPVPath);
|
||||
const std::map<G4String,G4AttDef>* attDefs = pvModel.GetAttDefs();
|
||||
std::vector<G4AttValue>* attValues = pvModel.CreateCurrentAttValues();
|
||||
G4cout << G4AttCheck(attValues,attDefs);
|
||||
delete attValues;
|
||||
G4Polyhedron* polyhedron =
|
||||
properties.fpTouchablePV->GetLogicalVolume()->GetSolid()->GetPolyhedron();
|
||||
G4cout << "\nLocal polyhedron coordinates:\n" << *polyhedron;
|
||||
G4Transform3D* transform = pvModel.GetCurrentTransform();
|
||||
polyhedron->Transform(*transform);
|
||||
G4cout << "\nGlobal polyhedron coordinates:\n" << *polyhedron;
|
||||
} else {
|
||||
G4cout << "Touchable not found." << G4endl;
|
||||
}
|
||||
return;
|
||||
|
||||
} else if (command == fpCommandFindPath) {
|
||||
|
||||
std::vector<G4PhysicalVolumesSearchScene::Findings> findingsVector;
|
||||
std::vector<G4VPhysicalVolume*>::iterator iterWorld =
|
||||
transportationManager->GetWorldsIterator();
|
||||
for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
|
||||
G4PhysicalVolumeModel searchModel (*iterWorld); // Unlimited depth.
|
||||
G4ModelingParameters mp; // Default - no culling.
|
||||
searchModel.SetModelingParameters (&mp);
|
||||
G4PhysicalVolumesSearchScene searchScene (&searchModel, newValue);
|
||||
searchModel.DescribeYourselfTo (searchScene); // Initiate search.
|
||||
for (const auto& findings: searchScene.GetFindings()) {
|
||||
findingsVector.push_back(findings);
|
||||
}
|
||||
}
|
||||
for (const auto& findings: findingsVector) {
|
||||
G4cout
|
||||
<< findings.fFoundBasePVPath
|
||||
<< ' ' << findings.fpFoundPV->GetName()
|
||||
<< ' ' << findings.fFoundPVCopyNo
|
||||
<< " (mother logical volume: "
|
||||
<< findings.fpFoundPV->GetMotherLogical()->GetName()
|
||||
<< ')'
|
||||
<< G4endl;
|
||||
}
|
||||
if (findingsVector.size()) {
|
||||
G4cout
|
||||
<< "Use this to set a particular touchable with \"/vis/set/touchable <path>\""
|
||||
<< "\nor to see overlaps: \"/vis/drawLogicalVolume <mother-logical-volume-name>\""
|
||||
<< G4endl;
|
||||
} else {
|
||||
G4cout << newValue << " not found" << G4endl;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (verbosity >= G4VisManager::errors) {
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsTouchableSet.cc 104163 2017-05-15 06:52:42Z gcosmo $
|
||||
|
||||
// /vis/touchable/set commands - John Allison 8th October 2012
|
||||
|
||||
@@ -187,7 +186,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASColour,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else if (command == fpCommandSetDaughtersInvisible) {
|
||||
@@ -196,7 +195,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASDaughtersInvisible,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else if (command == fpCommandSetForceAuxEdgeVisible) {
|
||||
@@ -205,7 +204,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASForceAuxEdgeVisible,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else if (command == fpCommandSetLineSegmentsPerCircle) {
|
||||
@@ -215,7 +214,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASForceLineSegmentsPerCircle,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else if (command == fpCommandSetForceSolid) {
|
||||
@@ -224,7 +223,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASForceSolid,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else if (command == fpCommandSetForceWireframe) {
|
||||
@@ -233,7 +232,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASForceWireframe,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else if (command == fpCommandSetLineStyle) {
|
||||
@@ -249,7 +248,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASLineStyle,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else if (command == fpCommandSetLineWidth) {
|
||||
@@ -258,7 +257,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASLineWidth,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else if (command == fpCommandSetVisibility) {
|
||||
@@ -267,7 +266,7 @@ void G4VisCommandsTouchableSet::SetNewValue
|
||||
(G4ModelingParameters::VisAttributesModifier
|
||||
(workingVisAtts,
|
||||
G4ModelingParameters::VASVisibility,
|
||||
fCurrentTouchablePath));
|
||||
fCurrentTouchableProperties.fTouchablePath));
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsViewer.cc 109510 2018-04-26 07:15:57Z gcosmo $
|
||||
|
||||
// /vis/viewer commands - John Allison 25th October 1998
|
||||
|
||||
@@ -52,6 +51,7 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <cstdio>
|
||||
#ifdef WIN32
|
||||
#include <regex>
|
||||
#include <filesystem>
|
||||
@@ -572,30 +572,30 @@ G4VisCommandViewerColourByDensity::G4VisCommandViewerColourByDensity () {
|
||||
"\nThen parameters for the algorithm assumed to be densities in that unit.");
|
||||
fpCommand -> SetGuidance
|
||||
("Algorithm 1: Simple algorithm takes 3 parameters: d0, d1 and d2."
|
||||
"\nVolumes with density < d0 are invisible."
|
||||
"\nVolumes with d0 <= density < d1 have colour on range red->green."
|
||||
"\nVolumes with d1 <= density < d2 have colour on range green->blue."
|
||||
"\nVolumes with density > d2 are blue.");
|
||||
"\n Volumes with density < d0 are invisible."
|
||||
"\n Volumes with d0 <= density < d1 have colour on range red->green."
|
||||
"\n Volumes with d1 <= density < d2 have colour on range green->blue."
|
||||
"\n Volumes with density > d2 are blue.");
|
||||
G4UIparameter* parameter;
|
||||
parameter = new G4UIparameter("n",'i',omitable = true);
|
||||
parameter -> SetDefaultValue (0);
|
||||
parameter -> SetGuidance ("Algorithm number (or \"0\" to switch off).");
|
||||
parameter -> SetDefaultValue (1);
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("unit",'s',omitable = true);
|
||||
parameter -> SetDefaultValue ("g/cm3");
|
||||
parameter -> SetGuidance ("Unit of following densities, e.g., \"g/cm3\".");
|
||||
parameter -> SetDefaultValue ("g/cm3");
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("d0",'d',omitable = true);
|
||||
parameter -> SetDefaultValue (0.);
|
||||
parameter -> SetGuidance ("Density parameter 0.");
|
||||
parameter -> SetGuidance ("Density parameter 0");
|
||||
parameter -> SetDefaultValue (0.5);
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("d1",'d',omitable = true);
|
||||
parameter -> SetDefaultValue (0.);
|
||||
parameter -> SetGuidance ("Density parameter 1.");
|
||||
parameter -> SetGuidance ("Density parameter 1");
|
||||
parameter -> SetDefaultValue (3.0);
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("d2",'d',omitable = true);
|
||||
parameter -> SetDefaultValue (0.);
|
||||
parameter -> SetGuidance ("Density parameter 2.");
|
||||
parameter -> SetDefaultValue (10.0);
|
||||
fpCommand->SetParameter(parameter);
|
||||
}
|
||||
|
||||
@@ -1189,7 +1189,7 @@ void G4VisCommandViewerInterpolate::SetNewValue (G4UIcommand*, G4String newValue
|
||||
|
||||
#ifndef WIN32
|
||||
|
||||
// Execute pattern and get resulting list of filles
|
||||
// Execute pattern and get resulting list of files
|
||||
G4String shellCommand = "echo " + pattern;
|
||||
FILE *filelist = popen(shellCommand.c_str(), "r");
|
||||
if (!filelist) {
|
||||
@@ -1205,12 +1205,14 @@ void G4VisCommandViewerInterpolate::SetNewValue (G4UIcommand*, G4String newValue
|
||||
// Build view vector of way points
|
||||
const size_t BUFLENGTH = 999999;
|
||||
char buf[BUFLENGTH];
|
||||
fgets(buf, BUFLENGTH, filelist);
|
||||
std::istringstream fileliststream(buf);
|
||||
while (fileliststream >> pathname
|
||||
&& safetyCount++ < safety) { // Loop checking, 16.02.2016, J.Allison
|
||||
uiManager->ApplyCommand("/control/execute " + pathname);
|
||||
viewVector.push_back(currentViewer->GetViewParameters());
|
||||
char* result = std::fgets(buf, BUFLENGTH, filelist);
|
||||
if (result) {
|
||||
std::istringstream fileliststream(result);
|
||||
while (fileliststream >> pathname
|
||||
&& safetyCount++ < safety) { // Loop checking, 16.02.2016, J.Allison
|
||||
uiManager->ApplyCommand("/control/execute " + pathname);
|
||||
viewVector.push_back(currentViewer->GetViewParameters());
|
||||
}
|
||||
}
|
||||
pclose(filelist);
|
||||
|
||||
@@ -1654,10 +1656,10 @@ void G4VisCommandViewerRefresh::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Scene has changed. UpdateVisManagerScene issues
|
||||
// Scene has changed. CheckSceneAndNotifyHandlers issues
|
||||
// /vis/scene/notifyHandlers, which does a refresh anyway, so the
|
||||
// ordinary refresh becomes part of the else phrase...
|
||||
UpdateVisManagerScene(scene->GetName());
|
||||
CheckSceneAndNotifyHandlers(scene);
|
||||
} else {
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
G4cout << "Refreshing viewer \"" << viewer -> GetName () << "\"..."
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsDefault.cc,v 1.4 2007-01-05 16:29:38 allison Exp $
|
||||
|
||||
// /vis/default commands - John Allison 30th October 2011
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsViewerSet.cc 109510 2018-04-26 07:15:57Z gcosmo $
|
||||
|
||||
// /vis/viewer/set commands - John Allison 16th May 2000
|
||||
|
||||
@@ -512,8 +511,8 @@ G4VisCommandsViewerSet::G4VisCommandsViewerSet ():
|
||||
"\nTo prevent them beating the light front at all:"
|
||||
"\n /vis/viewer/set/timeWindow/displayLightFront true -90 0 0 mm -0.01 ns");
|
||||
fpCommandTimeWindowDisplayLightFront->SetGuidance(timeWindowGuidance);
|
||||
parameter = new G4UIparameter ("displayLightFront", 'b', omitable = false);
|
||||
parameter->SetDefaultValue(false);
|
||||
parameter = new G4UIparameter ("displayLightFront", 'b', omitable = true);
|
||||
parameter->SetDefaultValue(true);
|
||||
fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
|
||||
parameter = new G4UIparameter ("originX", 'd', omitable = true);
|
||||
parameter->SetDefaultValue(0.);
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisManager.cc 110513 2018-05-28 07:37:38Z gcosmo $
|
||||
//
|
||||
//
|
||||
// GEANT4 Visualization Manager - John Allison 02/Jan/1996.
|
||||
@@ -82,8 +81,8 @@
|
||||
#include "G4MTRunManager.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
#include "G4GeometryWorkspacePool.hh"
|
||||
#include "G4SolidsWorkspacePool.hh"
|
||||
#include "G4GeometryWorkspace.hh"
|
||||
#include "G4SolidsWorkspace.hh"
|
||||
#include <deque>
|
||||
#include <typeinfo>
|
||||
#ifdef G4VIS_USE_STD11
|
||||
@@ -464,26 +463,6 @@ void G4VisManager::RegisterMessengers () {
|
||||
|
||||
G4UIcommand* directory;
|
||||
|
||||
// *Basic* top level commands were instantiated in the constructor
|
||||
// so that they can be used immediately after instantiation of the
|
||||
// vis manager. Other top level and lower level commands are
|
||||
// instantiated here.
|
||||
|
||||
// Other top level commands...
|
||||
RegisterMessenger(new G4VisCommandAbortReviewKeptEvents);
|
||||
RegisterMessenger(new G4VisCommandDrawOnlyToBeKeptEvents);
|
||||
RegisterMessenger(new G4VisCommandEnable);
|
||||
RegisterMessenger(new G4VisCommandList);
|
||||
RegisterMessenger(new G4VisCommandReviewKeptEvents);
|
||||
|
||||
// Compound commands...
|
||||
RegisterMessenger(new G4VisCommandDrawTree);
|
||||
RegisterMessenger(new G4VisCommandDrawView);
|
||||
RegisterMessenger(new G4VisCommandDrawLogicalVolume);
|
||||
RegisterMessenger(new G4VisCommandDrawVolume);
|
||||
RegisterMessenger(new G4VisCommandOpen);
|
||||
RegisterMessenger(new G4VisCommandSpecify);
|
||||
|
||||
directory = new G4UIdirectory ("/vis/geometry/");
|
||||
directory -> SetGuidance("Operations on vis attributes of Geant4 geometry.");
|
||||
fDirectoryList.push_back (directory);
|
||||
@@ -617,6 +596,23 @@ void G4VisManager::RegisterMessengers () {
|
||||
fDirectoryList.push_back (directory);
|
||||
RegisterMessenger(new G4VisCommandsViewerSet);
|
||||
|
||||
// *Basic* top level commands were instantiated in the constructor
|
||||
// so that they can be used immediately after instantiation of the
|
||||
// vis manager. Other top level commands, including "compound commands"
|
||||
// (i.e., commands that invoke other commands) are instantiated here.
|
||||
|
||||
RegisterMessenger(new G4VisCommandAbortReviewKeptEvents);
|
||||
RegisterMessenger(new G4VisCommandDrawOnlyToBeKeptEvents);
|
||||
RegisterMessenger(new G4VisCommandDrawTree);
|
||||
RegisterMessenger(new G4VisCommandDrawView);
|
||||
RegisterMessenger(new G4VisCommandDrawLogicalVolume);
|
||||
RegisterMessenger(new G4VisCommandDrawVolume);
|
||||
RegisterMessenger(new G4VisCommandEnable);
|
||||
RegisterMessenger(new G4VisCommandList);
|
||||
RegisterMessenger(new G4VisCommandOpen);
|
||||
RegisterMessenger(new G4VisCommandReviewKeptEvents);
|
||||
RegisterMessenger(new G4VisCommandSpecify);
|
||||
|
||||
// List manager commands
|
||||
RegisterMessenger(new G4VisCommandListManagerList< G4VisModelManager<G4VTrajectoryModel> >
|
||||
(fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
|
||||
@@ -1761,8 +1757,8 @@ G4ThreadFunReturnType G4VisManager::G4VisSubThread(G4ThreadFunArgType p)
|
||||
// << G4Threading::G4GetThreadId() << std::endl;
|
||||
|
||||
// Set up geometry and navigation for a thread
|
||||
G4GeometryWorkspacePool::GetInstance()->CreateAndUseWorkspace();
|
||||
G4SolidsWorkspacePool::GetInstance()->CreateAndUseWorkspace();
|
||||
G4GeometryWorkspace::GetPool()->CreateAndUseWorkspace();
|
||||
G4SolidsWorkspace::GetPool()->CreateAndUseWorkspace();
|
||||
G4Navigator* navigator =
|
||||
G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
|
||||
navigator->SetWorldVolume
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisStateDependent.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
#include "G4VisStateDependent.hh"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user