Import Geant4 3.1.0 source tree
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// 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: G4VisCommands.cc,v 1.1 2001/02/23 15:04:04 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
|
||||
// /vis/ top level commands - John Allison 5th February 2001
|
||||
|
||||
#include "G4VisCommands.hh"
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
////////////// /vis/enable ///////////////////////////////////////
|
||||
|
||||
G4VisCommandEnable::G4VisCommandEnable () {
|
||||
G4bool omitable;
|
||||
|
||||
fpCommand = new G4UIcmdWithABool("/vis/enable", this);
|
||||
fpCommand -> SetGuidance("/vis/enable [true|false]");
|
||||
fpCommand -> SetGuidance("Enables/disables visualization system.");
|
||||
fpCommand -> SetParameterName("enabled", omitable=true);
|
||||
fpCommand -> SetDefaultValue(true);
|
||||
|
||||
fpCommand1 = new G4UIcmdWithoutParameter("/vis/disable", this);
|
||||
fpCommand1 -> SetGuidance("Disables visualization system.");
|
||||
}
|
||||
|
||||
G4VisCommandEnable::~G4VisCommandEnable () {
|
||||
delete fpCommand;
|
||||
delete fpCommand1;
|
||||
}
|
||||
|
||||
G4String G4VisCommandEnable::GetCurrentValue (G4UIcommand* command) {
|
||||
return G4String();
|
||||
}
|
||||
|
||||
void G4VisCommandEnable::SetNewValue (G4UIcommand* command,
|
||||
G4String newValue) {
|
||||
if (command == fpCommand) {
|
||||
G4bool enable (GetNewBoolValue(newValue));
|
||||
if (enable) fpVisManager->Enable(); // Printing is in vis manager.
|
||||
else fpVisManager->Disable(); // Printing is in vis manager.
|
||||
} else fpVisManager->Disable(); // Printing is in vis manager.
|
||||
}
|
||||
|
||||
////////////// /vis/verbose ///////////////////////////////////////
|
||||
|
||||
G4VisCommandVerbose::G4VisCommandVerbose () {
|
||||
G4bool omitable;
|
||||
|
||||
fpCommand = new G4UIcmdWithAnInteger("/vis/verbose", this);
|
||||
fpCommand -> SetGuidance("/vis/verbose [<verbosity>]");
|
||||
fpCommand -> SetGuidance("0 = minimum, 10 = maximum verbosity.");
|
||||
fpCommand -> SetParameterName("verbosity", omitable=true);
|
||||
fpCommand -> SetDefaultValue(0);
|
||||
}
|
||||
|
||||
G4VisCommandVerbose::~G4VisCommandVerbose () {
|
||||
delete fpCommand;
|
||||
}
|
||||
|
||||
G4String G4VisCommandVerbose::GetCurrentValue (G4UIcommand* command) {
|
||||
return G4String();
|
||||
}
|
||||
|
||||
void G4VisCommandVerbose::SetNewValue (G4UIcommand* command,
|
||||
G4String newValue) {
|
||||
G4int verbosity (GetNewIntValue(newValue));
|
||||
fpVisManager->SetVerboseLevel(verbosity);
|
||||
G4cout << "Visualization verbosity changed to " << verbosity << G4endl;
|
||||
}
|
||||
Reference in New Issue
Block a user