ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4UIGAG.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4UIGAG.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 // G4UIGAG.hh
29 // GAG(Geant4 adaptive GUI) interface class
30 // 18.Feb.98 Y.Nagamatu and T.Kodama created G4UIGAG from G4UIterminal
31 
32 // If you want to use GAG (Tcl and JAVA version),
33 // read a document file README_Momo.html.
34 
35 #ifndef G4UIGAG_h
36 #define G4UIGAG_h 1
37 
38 #include "G4UIsession.hh"
39 #include "G4UImanager.hh"
40 #include <fstream>
41 #include <vector>
42 
45 
46 // class description:
47 //
48 // This class inherits the class G4UIsession.
49 // This is the class which is the front-end to GAG (Geant4 Adaptive GUI).
50 // Its usage is quite similar to G4UIterminal.
51 
52 class G4UIGAG : public G4UIsession
53 {
54  public: // with description
55  G4UIGAG();
56  ~G4UIGAG();
57 
59 
60  // A GAG session "gagSession" is instantiated.
61  // G4cout stream is redirected by default to the constructed instance.
62  // Usage: G4UIsession * gagSession = new G4UIGAG;
63  // "gagSession" is started.
64  // Usage: gagSession->SessionStart();
65  // "gagSession" is deleted.
66  // Usage: delete gagSession;
67  //
68  void PauseSessionStart(const G4String&);
70  G4int ReceiveG4cerr(const G4String&);
71  // These methods are implementation of the virtual methods of
72  // G4UIsession class.
73  //
74  void SessionTerminate();
75  void Prompt(const G4String&);
77  // These methods are not for users.
78  private:
85 
86  private:
89  void ExecuteCommand(const G4String&);
90  void ChangeDirectory(const G4String&);
91  void ListDirectory(const G4String&);
92  void TerminalHelp(const G4String&);
95  void ShowCurrent(const G4String&);
97 
102  void CodeGenJavaTree(G4UIcommandTree *,int recursiveLevel);
103  void CodeGenJavaParams(G4UIcommandTree *,int recursiveLevel);
104  void CodeGenTclTree(G4UIcommandTree *, int recursiveLevel);
105  void CodeGenTclParams(G4UIcommandTree *, int recursiveLevel);
106  void SendDisableList(G4UIcommandTree *, int recursiveLevel);
107 
108  void NotifyStateChange(void);
109  void NotifyCommandUpdate(void);
111 
112  int CommandUpdated(void);
113  void UpdateState(void);
114  void UpdateParamVal(void); // if param is updated,
115  // call NotifyParameterUpdate()
116 
117  // --- the following are used by Notify*Update() and *Updated()
118  void GetNewTreeStructure( G4UIcommandTree*,int recursiveLevel);
119  void GetNewTreeValues( G4UIcommandTree*,int recursiveLevel);
120 
121  std::vector<G4String> previousTreeCommands;
122  std::vector<G4String> newTreeCommands;
123  std::vector<G4String> previousTreeParams;
124  std::vector<G4String> newTreeParams;
125  std::vector<G4UIcommand*> previousTreePCP;
126  std::vector<G4UIcommand*> newTreePCP;
127 
128 };
129 
130 #endif