Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsViewer.cc,v 1.6 1999/05/10 14:04:18 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VisCommandsViewer.cc,v 1.7.4.1 1999/12/07 20:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// /vis/viewer commands - John Allison 25th October 1998
@@ -61,6 +61,11 @@ void G4VVisCommandViewer::UpdateCandidateLists () {
fpCommandViewerSelect -> GetParameter (0) ->
SetParameterCandidates (fViewerNameList);
}
if (fpCommandViewerUpdate) {
fpCommandViewerUpdate -> GetParameter (0) ->
SetParameterCandidates (fViewerNameList);
}
}
G4String G4VVisCommandViewer::fViewerNameList;
@@ -468,3 +473,78 @@ void G4VisCommandViewerSelect::SetNewValue (G4UIcommand* command,
<< endl;
}
}
////////////// /vis/viewer/update ///////////////////////////////////////
G4VisCommandViewerUpdate::G4VisCommandViewerUpdate () {
G4bool omitable, currentAsDefault;
fpCommand = new G4UIcmdWithAString ("/vis/viewer/update", this);
fpCommand -> SetGuidance ("/vis/viewer/update [<viewer-name>]");
fpCommand -> SetGuidance
("Updates viewer (necessary for graphical database post-processing.");
fpCommand -> SetGuidance ("Viewer becomes current.");
fpCommand -> SetGuidance
("Specify viewer by name (\"/vis/viewer/list\""
"\n to see possibilities).");
fpCommand -> SetParameterName ("viewer-name",
omitable = true,
currentAsDefault = true);
fpCommandViewerUpdate = fpCommand;
}
G4VisCommandViewerUpdate::~G4VisCommandViewerUpdate () {
delete fpCommand;
}
G4String G4VisCommandViewerUpdate::GetCurrentValue
(G4UIcommand* command) {
G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
if (viewer) {
return viewer -> GetName ();
}
else {
return "none";
}
}
void G4VisCommandViewerUpdate::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4String& updateName = newValue;
G4String updateShortName = ShortName (updateName);
G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
G4bool found = true;
if (updateShortName != ShortName (viewer -> GetName ())) {
found = false;
const G4SceneHandlerList& sceneHandlerList =
fpVisManager -> GetAvailableSceneHandlers ();
G4int nHandlers = sceneHandlerList.entries ();
for (G4int iHandler = 0; iHandler < nHandlers; iHandler++) {
G4VSceneHandler* sceneHandler = sceneHandlerList [iHandler];
const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
for (G4int iViewer = 0; iViewer < viewerList.entries (); iViewer++) {
viewer = viewerList [iViewer];
if (updateShortName == ShortName (viewer -> GetName ())) {
found = true;
fpVisManager -> SetCurrentViewer (viewer);
fpVisManager -> SetCurrentSceneHandler (sceneHandler);
fpVisManager -> SetCurrentGraphicsSystem
(sceneHandler -> GetGraphicsSystem ());
break;
}
}
if (found) break;
}
}
G4cout << "Viewer \"" << updateName << "\"";
if (found) {
viewer -> ShowView ();
G4cout << " updated.";
}
else {
G4cout << " not found - \"/vis/viewer/list\""
"\n to see possibilities.";
}
G4cout << endl;
}