Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.12 2000/02/14 08:41:21 asaim Exp $
|
||||
$Id: History,v 1.15 2000/07/26 09:26:24 asaim Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,18 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Jul 26, 00, M.Asai (tag intercoms-V02-00-01)
|
||||
- Retagging with removing G4StateManager, G4VStateDependent and G4ApplicationState
|
||||
classes.
|
||||
|
||||
Jul 22, 00, M.Asai (tag intercoms-V02-00-00)
|
||||
- Making G4UImanager as a state dependent class.
|
||||
- Remove G4StateManager and G4VStateDependent classes. They are now in
|
||||
source/global/management.
|
||||
|
||||
May 18, 00, J.Allison
|
||||
- Small spelling correction in class description of G4VGraphicsScene.hh.
|
||||
|
||||
Feb 14, 00, M.Asai (tag intercoms-V01-00-00)
|
||||
- Put "const" to "char *" arguments in G4UImanager
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
// 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: G4ApplicationState.hh,v 1.3 1999/12/15 14:50:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
|
||||
#ifndef G4APPLICATIONSTATE_H
|
||||
#define G4APPLICATIONSTATE_H 1
|
||||
|
||||
// Class Description:
|
||||
//
|
||||
// Specifies the state of the G4 application
|
||||
//
|
||||
// States:
|
||||
// PreInit
|
||||
// At the very begining of the Application. G4StateManager starts
|
||||
// with this state. G4Initializer changes this state to Init when
|
||||
// G4Initializer::Initialize() method starts. At the moment of
|
||||
// the state change of PreInit->Init, no material, geometrical,
|
||||
// particle or physics process has been initialized.
|
||||
// Init
|
||||
// During the G4Initializer::Initialize() method. G4Initializer
|
||||
// changes this state to Idle when all initialization procedures
|
||||
// are successfully Done.
|
||||
// Idle
|
||||
// Ready to start "BeamOn". G4RunManager changes this state to
|
||||
// GeomClosed when G4RunManager::BeamOn() method starts and
|
||||
// G4GeometryManager::CloseGeometry() is Done. At the end of
|
||||
// BeamOn() method, G4RunManager will reset the application state
|
||||
// to Idle after G4GeometryManager::OpenGeometry() is Done.
|
||||
// GeomClosed
|
||||
// G4 is in this state between G4GeometryManager::CloseGeometry()
|
||||
// and G4GeometryManager::OpenGeometry(), but no event is in
|
||||
// progress. At the begining of each event (construction of a
|
||||
// G4Event object and primary particle generation), G4RunManager
|
||||
// changes this state to EventProc and resets to GeomClosed state
|
||||
// when G4EventManager::ProcessOneEvent() is over.
|
||||
// EventProc
|
||||
// Processing an event.
|
||||
// Quit
|
||||
// G4 is in this state when the destructor of G4RunManager is invoked.
|
||||
//
|
||||
//
|
||||
// PreInit
|
||||
// |
|
||||
// v
|
||||
// Init
|
||||
// |
|
||||
// v
|
||||
// Idle ------> Quit
|
||||
// |^
|
||||
// v|
|
||||
// GeomClosed (at each run)
|
||||
// |^
|
||||
// v|
|
||||
// EventProc (at each event)
|
||||
//
|
||||
|
||||
enum G4ApplicationState
|
||||
{PreInit, Init, Idle, GeomClosed, EventProc, Quit};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
// 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: G4StateManager.hh,v 1.5 2000/02/14 12:24:41 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ---------------- G4StateManager ----------------
|
||||
// by Gabriele Cosmo, November 1996
|
||||
|
||||
#ifndef G4StateManager_h
|
||||
#define G4StateManager_h 1
|
||||
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "globals.hh"
|
||||
#include "G4ApplicationState.hh"
|
||||
#include "G4VStateDependent.hh"
|
||||
|
||||
// Class Description:
|
||||
//
|
||||
// Class responsible for handling and updating the running state
|
||||
// of the Geant4 application during its different phases.
|
||||
// The class is a singleton, it can be accessed via the public
|
||||
// method G4StateManager::GetStateManager().
|
||||
//
|
||||
// States defined in Geant4 are descrived in G4ApplicationState.hh
|
||||
//
|
||||
|
||||
class G4StateManager {
|
||||
|
||||
public: // with description
|
||||
static G4StateManager* GetStateManager();
|
||||
// This G4StateManager class is a singleton class and the pointer
|
||||
// to the only one existing object can be obtained by this static
|
||||
// method.
|
||||
|
||||
protected:
|
||||
G4StateManager();
|
||||
|
||||
public:
|
||||
~G4StateManager();
|
||||
|
||||
public: // with description
|
||||
G4ApplicationState GetCurrentState();
|
||||
// Returns the current state
|
||||
G4ApplicationState GetPreviousState();
|
||||
// Returns the previous state
|
||||
G4bool SetNewState(G4ApplicationState requestedState);
|
||||
// Set Geant4 to a new state.
|
||||
// In case the request is irregal, false will be returned
|
||||
// and the state of Geant4 will not be changed.
|
||||
G4bool RegisterDependent(G4VStateDependent* aDependent);
|
||||
// Register a concrete class of G4VStateDependent.
|
||||
// Registered concrete classes will be notified via
|
||||
// G4VStateDependent::Notify() method when the state of
|
||||
// Geant4 changes.
|
||||
// False will be returned if registration if failed.
|
||||
G4bool DeregisterDependent(G4VStateDependent* aDependent);
|
||||
// Remove the registration.
|
||||
// False will be returned if aDependent has not been registered.
|
||||
G4VStateDependent* RemoveDependent(const G4VStateDependent* aDependent);
|
||||
// Remove the registration.
|
||||
// Removed pointer is returned.
|
||||
G4String GetStateString(G4ApplicationState aState);
|
||||
// A utility method which returns a string of the state name.
|
||||
void Pause();
|
||||
void Pause(const char* msg);
|
||||
void Pause(G4String msg);
|
||||
// G4UIsession::pauseSession() will be invoked. The argument string "msg"
|
||||
// will be used as a prompt characters if the session is non-graphical.
|
||||
// This method can be invoked by any user action class during the event
|
||||
// loop. After the user's interactions, control goes back to the caller.
|
||||
|
||||
private:
|
||||
G4StateManager(const G4StateManager &right);
|
||||
G4StateManager& operator=(const G4StateManager &right);
|
||||
G4int operator==(const G4StateManager &right) const;
|
||||
G4int operator!=(const G4StateManager &right) const;
|
||||
|
||||
private:
|
||||
static G4StateManager* theStateManager;
|
||||
G4ApplicationState theCurrentState;
|
||||
G4ApplicationState thePreviousState;
|
||||
G4RWTPtrOrderedVector<G4VStateDependent> theDependentsList;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIbatch.hh,v 1.3 1999/12/15 14:50:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $id$
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWith3Vector.hh,v 1.3 1999/12/15 14:50:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWith3VectorAndUnit.hh,v 1.3 1999/12/15 14:50:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithABool.hh,v 1.3 1999/12/15 14:50:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithADouble.hh,v 1.3 1999/12/15 14:50:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithADoubleAndUnit.hh,v 1.3 1999/12/15 14:50:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithAString.hh,v 1.3 1999/12/15 14:50:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithAnInteger.hh,v 1.3 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithoutParameter.hh,v 1.3 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcommand.hh,v 1.5 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcommandStatus.hh,v 1.2 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIcommandStatus_h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcommandTree.hh,v 1.5 2000/02/14 12:24:41 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIcommandTree_h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcontrolMessenger.hh,v 1.3 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIcontrolMessenger_h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIdirectory.hh,v 1.3 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UImanager.hh,v 1.5 2000/02/14 08:41:24 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UImanager.hh,v 1.6 2000/07/22 10:49:37 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UImanager_h
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "g4rw/ctoken.h"
|
||||
#include "g4rw/tvordvec.h"
|
||||
#include "g4std/fstream"
|
||||
#include "G4VStateDependent.hh"
|
||||
class G4UIcommandTree;
|
||||
class G4UIcommand;
|
||||
class G4UIsession;
|
||||
@@ -29,7 +30,7 @@ class G4UnitsMessenger;
|
||||
// invoked by the user.
|
||||
//
|
||||
|
||||
class G4UImanager
|
||||
class G4UImanager : public G4VStateDependent
|
||||
{
|
||||
public: // with description
|
||||
static G4UImanager * GetUIpointer();
|
||||
@@ -74,14 +75,15 @@ class G4UImanager
|
||||
G4String fileName="G4history.macro");
|
||||
// The executed commands will be stored in the defined file. If
|
||||
// "historySwitch" is false, saving will be suspended.
|
||||
void PauseSession(G4String msg);
|
||||
// This method is exclusively invoked by G4StateManager and the user
|
||||
// must not use this method.
|
||||
void ListCommands(G4String direc);
|
||||
// All commands registored under the given directory will be listed to
|
||||
// G4cout.
|
||||
virtual G4bool Notify(G4ApplicationState requestedState);
|
||||
// This method is exclusively invoked by G4StateManager and the user
|
||||
// must not use this method.
|
||||
|
||||
private:
|
||||
void PauseSession(G4String msg);
|
||||
void CreateMessenger();
|
||||
G4UIcommandTree* FindDirectory(const char* dirName);
|
||||
|
||||
@@ -104,6 +106,10 @@ class G4UImanager
|
||||
G4std::ofstream historyFile;
|
||||
G4bool saveHistory;
|
||||
G4RWTValOrderedVector<G4String> histVec;
|
||||
|
||||
G4bool pauseAtBeginOfEvent;
|
||||
G4bool pauseAtEndOfEvent;
|
||||
|
||||
|
||||
public: // with description
|
||||
G4String GetCurrentStringValue(const char * aCommand,
|
||||
@@ -127,6 +133,19 @@ class G4UImanager
|
||||
// the value stored in G4Umanager will be used. The later case is valid
|
||||
// for the sequential invokation for the same command.
|
||||
|
||||
inline void SetPauseAtBeginOfEvent(G4bool vl)
|
||||
{ pauseAtBeginOfEvent = vl; }
|
||||
inline G4bool GetPauseAtBeginOfEvent() const
|
||||
{ return pauseAtBeginOfEvent; }
|
||||
inline void SetPauseAtEndOfEvent(G4bool vl)
|
||||
{ pauseAtEndOfEvent = vl; }
|
||||
inline G4bool GetPauseAtEndOfEvent() const
|
||||
{ return pauseAtEndOfEvent; }
|
||||
// If the boolean flags are true, Pause() method of G4StateManager is invoked
|
||||
// at the very begining (before generating a G4Event object) or at the end of
|
||||
// each event. So that, in case a (G)UI session is defined, the user can interact.
|
||||
|
||||
|
||||
public:
|
||||
inline G4UIcommandTree * GetTree() const
|
||||
{ return treeTop; };
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UImessenger.hh,v 1.4 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UImessenger_h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIparameter.hh,v 1.3 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIsession.hh,v 1.3 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $id$
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UItokenNum.hh,v 1.2 1999/12/15 14:50:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G4UItokenNum.hh
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UnitsMessenger.hh,v 1.3 1999/12/15 14:50:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// class description
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VFlavoredParallelWorld.hh,v 1.2 1999/12/15 14:50:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// Abstract interface for GEANT4 Flavored Parallel World.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VGlobalFastSimulationManager.hh,v 1.2 1999/12/15 14:50:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// Abstract interface for GEANT4 Global Fast Simulation Manager.
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VGraphicsScene.hh,v 1.4 1999/12/15 14:50:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4VGraphicsScene.hh,v 1.5 2000/05/19 06:29:48 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// John Allison 19th July 1996
|
||||
//
|
||||
// Class Description:
|
||||
// Abstract interface class for a graphics scene handler.
|
||||
// It is a minimal scene handler for the GEANT4 kernel.
|
||||
// See G4VSceneHadler for a fuller description. G4VScenehandler is
|
||||
// See G4VSceneHandler for a fuller description. G4VSceneHandler is
|
||||
// the full abstract interface to graphics systems.
|
||||
|
||||
#ifndef G4VGRAPHICSSCENE_HH
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
// 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: G4VStateDependent.hh,v 1.3 1999/12/15 14:50:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ---------------- G4VStateDependent ----------------
|
||||
// by Gabriele Cosmo, November 1996
|
||||
// Abstract class responsible to Notify the change of state
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4VStateDependent_h
|
||||
#define G4VStateDependent_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ApplicationState.hh"
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is an abstract base class of all classes which need to be
|
||||
// notified when the state of Geant4 is changed. The concrete class
|
||||
// object derived from this base class will be automatically registered
|
||||
// to G4StateManager and the virtual method Notify() will be invoked
|
||||
// when the state changes.
|
||||
//
|
||||
|
||||
class G4VStateDependent {
|
||||
|
||||
public:
|
||||
G4VStateDependent();
|
||||
virtual ~G4VStateDependent();
|
||||
G4int operator==(const G4VStateDependent &right) const;
|
||||
G4int operator!=(const G4VStateDependent &right) const;
|
||||
|
||||
public: // with description
|
||||
virtual G4bool Notify(G4ApplicationState requestedState) = 0;
|
||||
// Pure virtual method which will be invoked by G4StateManager.
|
||||
// In case state change must not be allowed by some reason of the
|
||||
// concrete class, false should be returned. But this scheme is
|
||||
// NOT recommended to use. All command which are state sensitive
|
||||
// MUST assign available state(s).
|
||||
|
||||
private:
|
||||
G4VStateDependent(const G4VStateDependent &right);
|
||||
G4VStateDependent& operator=(const G4VStateDependent &right);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VVisManager.hh,v 1.4 1999/12/15 14:50:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// John Allison 19/Oct/1996.
|
||||
//
|
||||
// Class Description:
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
// 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: G4StateManager.cc,v 1.3 2000/02/14 12:24:42 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ---------------- G4StateManager ----------------
|
||||
// by Gabriele Cosmo, November 1996
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
// Initialization of the static pointer of the single class instance
|
||||
G4StateManager* G4StateManager::theStateManager = 0;
|
||||
|
||||
G4StateManager::G4StateManager()
|
||||
:theCurrentState(PreInit),thePreviousState(PreInit) {;}
|
||||
|
||||
G4StateManager::~G4StateManager()
|
||||
{
|
||||
theDependentsList.clearAndDestroy();
|
||||
}
|
||||
|
||||
G4StateManager::G4StateManager(const G4StateManager &right)
|
||||
{
|
||||
*this = right;
|
||||
}
|
||||
|
||||
G4StateManager& G4StateManager::operator=(const G4StateManager &right)
|
||||
{
|
||||
*this = right;
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int G4StateManager::operator==(const G4StateManager &right) const
|
||||
{
|
||||
return (this == (G4StateManager *) &right);
|
||||
}
|
||||
|
||||
G4int G4StateManager::operator!=(const G4StateManager &right) const
|
||||
{
|
||||
return (this != (G4StateManager *) &right);
|
||||
}
|
||||
|
||||
|
||||
G4StateManager* G4StateManager::GetStateManager()
|
||||
{
|
||||
if (!theStateManager)
|
||||
{
|
||||
theStateManager = new G4StateManager;
|
||||
}
|
||||
return theStateManager;
|
||||
}
|
||||
|
||||
G4bool G4StateManager::RegisterDependent(G4VStateDependent* aDependent)
|
||||
{
|
||||
G4bool ack=true;
|
||||
theDependentsList.insert(aDependent);
|
||||
return ack;
|
||||
}
|
||||
|
||||
G4bool G4StateManager::DeregisterDependent(G4VStateDependent* aDependent)
|
||||
{
|
||||
G4VStateDependent* aD = theDependentsList.remove(aDependent);
|
||||
return (aD != NULL);
|
||||
}
|
||||
|
||||
G4ApplicationState G4StateManager::GetCurrentState()
|
||||
{
|
||||
return theCurrentState;
|
||||
}
|
||||
|
||||
G4ApplicationState G4StateManager::GetPreviousState()
|
||||
{
|
||||
return thePreviousState;
|
||||
}
|
||||
|
||||
G4bool G4StateManager::SetNewState(G4ApplicationState requestedState)
|
||||
{
|
||||
G4int i=0;
|
||||
G4bool ack = true;
|
||||
G4ApplicationState savedState = thePreviousState;
|
||||
thePreviousState = theCurrentState;
|
||||
theCurrentState = requestedState;
|
||||
while ((ack) && (i<theDependentsList.entries())) {
|
||||
ack = theDependentsList(i)->Notify(requestedState);
|
||||
i++;
|
||||
}
|
||||
|
||||
if(!ack)
|
||||
{
|
||||
theCurrentState = thePreviousState;
|
||||
thePreviousState = savedState;
|
||||
}
|
||||
return ack;
|
||||
}
|
||||
|
||||
G4VStateDependent* G4StateManager::RemoveDependent(const G4VStateDependent* aDependent)
|
||||
{
|
||||
return theDependentsList.remove(aDependent);
|
||||
}
|
||||
|
||||
G4String G4StateManager::GetStateString(G4ApplicationState aState)
|
||||
{
|
||||
G4String stateName;
|
||||
switch(aState)
|
||||
{
|
||||
case PreInit:
|
||||
stateName = "PreInit"; break;
|
||||
case Init:
|
||||
stateName = "Init"; break;
|
||||
case Idle:
|
||||
stateName = "Idle"; break;
|
||||
case GeomClosed:
|
||||
stateName = "GeomClosed"; break;
|
||||
case EventProc:
|
||||
stateName = "EventProc"; break;
|
||||
case Quit:
|
||||
stateName = "Quit"; break;
|
||||
default:
|
||||
stateName = "Unknown";
|
||||
}
|
||||
return stateName;
|
||||
}
|
||||
|
||||
void G4StateManager::Pause()
|
||||
{
|
||||
Pause("G4_pause> ");
|
||||
}
|
||||
|
||||
void G4StateManager::Pause(const char* msg)
|
||||
{
|
||||
G4String msgS = msg;
|
||||
Pause(msgS);
|
||||
}
|
||||
|
||||
void G4StateManager::Pause(G4String msg)
|
||||
{
|
||||
G4UImanager::GetUIpointer()->PauseSession(msg);
|
||||
// if(theCurrentState==EventProc)
|
||||
// {
|
||||
// G4ApplicationState savedState = thePreviousState;
|
||||
// SetNewState(Pause);
|
||||
// theCurrentState = thePreviousState;
|
||||
// thePreviousState = savedState;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIbatch.cc,v 1.2 1999/12/15 14:50:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "G4UIbatch.hh"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWith3Vector.cc,v 1.2 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWith3VectorAndUnit.cc,v 1.2 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithABool.cc,v 1.2 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithADouble.cc,v 1.2 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithADoubleAndUnit.cc,v 1.2 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithAString.cc,v 1.2 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithAnInteger.cc,v 1.2 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcmdWithoutParameter.cc,v 1.2 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcommand.cc,v 1.5 1999/12/15 14:50:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcommandTree.cc,v 1.4 2000/02/14 12:24:42 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "G4UIcommandTree.hh"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcontrolMessenger.cc,v 1.2 1999/12/15 14:50:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "G4UIcontrolMessenger.hh"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIdirectory.cc,v 1.2 1999/12/15 14:50:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UImanager.cc,v 1.5 2000/02/14 08:41:25 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UImanager.cc,v 1.6 2000/07/22 10:49:38 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "G4UnitsMessenger.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4strstreambuf.hh"
|
||||
#include "G4StateManager.hh"
|
||||
|
||||
#include "g4std/strstream"
|
||||
|
||||
@@ -40,8 +41,10 @@ G4UImanager * G4UImanager::GetUIpointer()
|
||||
return fUImanager;
|
||||
}
|
||||
|
||||
G4UImanager::G4UImanager():savedCommand(NULL)
|
||||
G4UImanager::G4UImanager()
|
||||
:G4VStateDependent(true)
|
||||
{
|
||||
savedCommand = 0;
|
||||
treeTop = new G4UIcommandTree("/");
|
||||
G4String nullString;
|
||||
savedParameters = nullString;
|
||||
@@ -49,6 +52,8 @@ G4UImanager::G4UImanager():savedCommand(NULL)
|
||||
saveHistory = false;
|
||||
session = NULL;
|
||||
SetCoutDestination(session);
|
||||
pauseAtBeginOfEvent = false;
|
||||
pauseAtEndOfEvent = false;
|
||||
}
|
||||
|
||||
void G4UImanager::CreateMessenger()
|
||||
@@ -288,6 +293,24 @@ G4UIcommandTree* G4UImanager::FindDirectory(const char* dirName)
|
||||
return comTree;
|
||||
}
|
||||
|
||||
G4bool G4UImanager::Notify(G4ApplicationState requestedState)
|
||||
{
|
||||
//G4cout << G4StateManager::GetStateManager()->GetStateString(requestedState) << " <--- " << G4StateManager::GetStateManager()->GetStateString(G4StateManager::GetStateManager()->GetPreviousState()) << G4endl;
|
||||
if(pauseAtBeginOfEvent)
|
||||
{
|
||||
if(requestedState==EventProc &&
|
||||
G4StateManager::GetStateManager()->GetPreviousState()==GeomClosed)
|
||||
{ PauseSession("BeginOfEvent"); }
|
||||
}
|
||||
if(pauseAtEndOfEvent)
|
||||
{
|
||||
if(requestedState==GeomClosed &&
|
||||
G4StateManager::GetStateManager()->GetPreviousState()==EventProc)
|
||||
{ PauseSession("EndOfEvent"); }
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void G4UImanager::Interact()
|
||||
{
|
||||
Interact(G4String("G4> "));
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UImessenger.cc,v 1.2 1999/12/15 14:50:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIparameter.cc,v 1.4 1999/12/15 14:50:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "G4UIparameter.hh"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIsession.cc,v 1.3 1999/12/15 17:52:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UnitsMessenger.cc,v 1.2 1999/12/15 14:50:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VGlobalFastSimulationManager.cc,v 1.2 1999/12/15 14:50:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// Abstract interface for GEANT4 Global Fast Simulation Manager.
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
// 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: G4VStateDependent.cc,v 1.2 1999/12/15 14:50:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ---------------- G4VStateDependent ----------------
|
||||
// by Gabriele Cosmo, November 1996
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "G4VStateDependent.hh"
|
||||
#include "G4StateManager.hh"
|
||||
|
||||
G4VStateDependent::G4VStateDependent()
|
||||
{
|
||||
G4StateManager * stateManager = G4StateManager::GetStateManager();
|
||||
stateManager->RegisterDependent(this);
|
||||
}
|
||||
|
||||
G4VStateDependent::~G4VStateDependent()
|
||||
{
|
||||
G4StateManager * stateManager = G4StateManager::GetStateManager();
|
||||
stateManager->DeregisterDependent(this);
|
||||
}
|
||||
|
||||
G4VStateDependent::G4VStateDependent(const G4VStateDependent &right)
|
||||
{
|
||||
*this = right;
|
||||
}
|
||||
|
||||
G4VStateDependent& G4VStateDependent::operator=(const G4VStateDependent &right)
|
||||
{
|
||||
*this = right;
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4int G4VStateDependent::operator==(const G4VStateDependent &right) const
|
||||
{
|
||||
return (this == (G4VStateDependent *) &right);
|
||||
}
|
||||
|
||||
G4int G4VStateDependent::operator!=(const G4VStateDependent &right) const
|
||||
{
|
||||
return (this != (G4VStateDependent *) &right);
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VVisManager.cc,v 1.3 1999/12/15 14:50:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// Abstract interface for GEANT4 Visualization Manager.
|
||||
|
||||
Reference in New Issue
Block a user