Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:22

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 // G.Barrand
0029 
0030 #ifndef G4VINTERACTORMANAGER_HH
0031 #define G4VINTERACTORMANAGER_HH
0032 
0033 #include "globals.hh"
0034 
0035 #include <vector>
0036 
0037 using G4Interactor = void*;
0038 using G4DispatchFunction = G4bool (*)(void*);
0039 using G4SecondaryLoopAction = void (*)();
0040 
0041 // Class description :
0042 //
0043 //  G4VInteractorManager : a base class to isolate common things
0044 // to various GUI "toolkits" like WIndows, Xt.
0045 //  The word "interactor" is for "piece of user interface" or
0046 // "widget" (which means nothing). Then a GUI "toolkit" could be
0047 // defined as a manager of interactors.
0048 //
0049 // Class description - end :
0050 
0051 class G4VInteractorManager
0052 {
0053  public:
0054   G4VInteractorManager();
0055   virtual ~G4VInteractorManager();
0056   void SetArguments(int, char**);
0057   char** GetArguments(int*);
0058   void SetMainInteractor(G4Interactor);
0059   G4Interactor GetMainInteractor();
0060   void AddDispatcher(G4DispatchFunction);
0061   void RemoveDispatcher(G4DispatchFunction);
0062   void AddSecondaryLoopPreAction(G4SecondaryLoopAction);
0063   void AddSecondaryLoopPostAction(G4SecondaryLoopAction);
0064   void AddShell(G4Interactor);
0065   void RemoveShell(G4Interactor);
0066   void EnableSecondaryLoop();
0067   void DisableSecondaryLoop();
0068   void SecondaryLoopPreActions();
0069   void SecondaryLoopPostActions();
0070   void RequireExitSecondaryLoop(int);
0071   void DispatchEvent(void*);
0072   virtual void SecondaryLoop();
0073   int GetExitSecondaryLoopCode();
0074   void PutStringInResourceDatabase(char*);
0075   virtual G4bool Inited() = 0;
0076   virtual void* GetEvent() = 0;
0077   virtual void FlushAndWaitExecution() = 0;
0078   void SetParentInteractor(G4Interactor);
0079   G4Interactor GetParentInteractor();
0080   void SetCreatedInteractor(G4Interactor);
0081   G4Interactor GetCreatedInteractor();
0082   void SetCreationString(char*);
0083   char* GetCreationString();
0084 
0085  private:
0086   int argc;
0087   char** argv;
0088   G4Interactor mainInteractor;
0089   std::vector<G4DispatchFunction> dispatchers;
0090   std::vector<G4SecondaryLoopAction> preActions;
0091   std::vector<G4SecondaryLoopAction> postActions;
0092   std::vector<G4Interactor> shells;
0093   G4bool secondaryLoopEnabled;
0094   G4bool alreadyInSecondaryLoop;
0095   int exitSecondaryLoop;
0096   G4Interactor parentInteractor;
0097   G4Interactor createdInteractor;
0098   char* creationString;
0099 };
0100 
0101 #define OGL_EXIT_CODE 1
0102 #define OIV_EXIT_CODE 2
0103 #define XO_EXIT_CODE 3
0104 
0105 #endif