Geant4  10.02.p01
G4UIGAG.hh
Go to the documentation of this file.
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 // $Id: G4UIGAG.hh 66892 2013-01-17 10:57:59Z gunter $
28 //
29 // G4UIGAG.hh
30 // GAG(Geant4 adaptive GUI) interface class
31 // 18.Feb.98 Y.Nagamatu and T.Kodama created G4UIGAG from G4UIterminal
32 
33 // If you want to use GAG (Tcl and JAVA version),
34 // read a document file README_Momo.html.
35 
36 #ifndef G4UIGAG_h
37 #define G4UIGAG_h 1
38 
39 #include "G4UIsession.hh"
40 #include "G4UImanager.hh"
41 #include <fstream>
42 #include <vector>
43 
46 
47 // class description:
48 //
49 // This class inherits the class G4UIsession.
50 // This is the class which is the front-end to GAG (Geant4 Adaptive GUI).
51 // Its usage is quite similar to G4UIterminal.
52 
53 class G4UIGAG : public G4UIsession
54 {
55  public: // with description
56  G4UIGAG();
57  ~G4UIGAG();
58 
60 
61  // A GAG session "gagSession" is instantiated.
62  // G4cout stream is redirected by default to the constructed instance.
63  // Usage: G4UIsession * gagSession = new G4UIGAG;
64  // "gagSession" is started.
65  // Usage: gagSession->SessionStart();
66  // "gagSession" is deleted.
67  // Usage: delete gagSession;
68  //
69  void PauseSessionStart(const G4String&);
71  G4int ReceiveG4cerr(const G4String&);
72  // These methods are implementation of the virtual methods of
73  // G4UIsession class.
74  //
75  void SessionTerminate();
76  void Prompt(const G4String&);
78  // These methods are not for users.
79  private:
86 
87  private:
90  void ExecuteCommand(const G4String&);
91  void ChangeDirectory(const G4String&);
92  void ListDirectory(const G4String&);
93  void TerminalHelp(const G4String&);
96  void ShowCurrent(const G4String&);
98 
103  void CodeGenJavaTree(G4UIcommandTree *,int recursiveLevel);
104  void CodeGenJavaParams(G4UIcommandTree *,int recursiveLevel);
105  void CodeGenTclTree(G4UIcommandTree *, int recursiveLevel);
106  void CodeGenTclParams(G4UIcommandTree *, int recursiveLevel);
107  void SendDisableList(G4UIcommandTree *, int recursiveLevel);
108 
109  void NotifyStateChange(void);
110  void NotifyCommandUpdate(void);
112 
113  int CommandUpdated(void);
114  void UpdateState(void);
115  void UpdateParamVal(void); // if param is updated,
116  // call NotifyParameterUpdate()
117 
118  // --- the following are used by Notify*Update() and *Updated()
119  void GetNewTreeStructure( G4UIcommandTree*,int recursiveLevel);
120  void GetNewTreeValues( G4UIcommandTree*,int recursiveLevel);
121 
122  std::vector<G4String> previousTreeCommands;
123  std::vector<G4String> newTreeCommands;
124  std::vector<G4String> previousTreeParams;
125  std::vector<G4String> newTreeParams;
126  std::vector<G4UIcommand*> previousTreePCP;
127  std::vector<G4UIcommand*> newTreePCP;
128 
129 };
130 
131 #endif
void CodeGenTclParams(G4UIcommandTree *, int recursiveLevel)
Definition: G4UIGAG.cc:730
void GetNewTreeStructure(G4UIcommandTree *, int recursiveLevel)
Definition: G4UIGAG.cc:856
void SendAParamProperty(G4UIcommand *)
Definition: G4UIGAG.cc:604
G4String GetFullPath(const G4String &)
Definition: G4UIGAG.cc:303
G4UIGAG()
Definition: G4UIGAG.cc:39
void SendATclParamProperty(G4UIcommand *)
Definition: G4UIGAG.cc:749
void CodeGenTclTree(G4UIcommandTree *, int recursiveLevel)
Definition: G4UIGAG.cc:668
G4String ModifyPrefix(G4String)
Definition: G4UIGAG.cc:490
Definition: G4UIGAG.hh:45
G4UIcommandTree * FindDirPath(const G4String &)
Definition: G4UIGAG.cc:515
std::vector< G4String > newTreeCommands
Definition: G4UIGAG.hh:123
void PauseSessionStart(const G4String &)
Definition: G4UIGAG.cc:87
UImode
Definition: G4UIGAG.hh:44
void CodeGenJavaTree(G4UIcommandTree *, int recursiveLevel)
Definition: G4UIGAG.cc:563
void CodeGenJavaParams(G4UIcommandTree *, int recursiveLevel)
Definition: G4UIGAG.cc:581
std::vector< G4String > newTreeParams
Definition: G4UIGAG.hh:125
int G4int
Definition: G4Types.hh:78
void ShowCurrent(const G4String &)
Definition: G4UIGAG.cc:342
void ExecuteCommand(const G4String &)
Definition: G4UIGAG.cc:100
int CommandUpdated(void)
Definition: G4UIGAG.cc:826
UImode uiMode
Definition: G4UIGAG.hh:85
void SendParameterProperties(G4UIcommandTree *)
Definition: G4UIGAG.cc:550
std::vector< G4String > previousTreeParams
Definition: G4UIGAG.hh:124
G4String JVersion
Definition: G4UIGAG.hh:88
void TerminalHelp(const G4String &)
Definition: G4UIGAG.cc:414
G4String promptCharacter
Definition: G4UIGAG.hh:82
bool G4bool
Definition: G4Types.hh:79
void ChangeDirectory(const G4String &)
Definition: G4UIGAG.cc:359
void UpdateParamVal(void)
Definition: G4UIGAG.cc:883
G4String prefix
Definition: G4UIGAG.hh:80
~G4UIGAG()
Definition: G4UIGAG.cc:62
G4UImanager * UI
Definition: G4UIGAG.hh:81
void ListDirectory(const G4String &)
Definition: G4UIGAG.cc:386
G4String TVersion
Definition: G4UIGAG.hh:89
G4bool iCont
Definition: G4UIGAG.hh:84
G4String GetCommand()
Definition: G4UIGAG.cc:189
void SendCommandProperties(G4UIcommandTree *)
Definition: G4UIGAG.cc:532
void NotifyStateChange(void)
Definition: G4UIGAG.cc:784
std::vector< G4UIcommand * > newTreePCP
Definition: G4UIGAG.hh:127
G4int ReceiveG4cerr(const G4String &)
Definition: G4UIGAG.cc:178
G4bool iExit
Definition: G4UIGAG.hh:83
std::vector< G4String > previousTreeCommands
Definition: G4UIGAG.hh:122
void SessionTerminate()
Definition: G4UIGAG.cc:337
void SendDisableList(G4UIcommandTree *, int recursiveLevel)
Definition: G4UIGAG.cc:645
void UpdateState(void)
Definition: G4UIGAG.cc:813
void Prompt(const G4String &)
Definition: G4UIGAG.cc:184
void NotifyParameterUpdate(G4UIcommand *)
Definition: G4UIGAG.cc:804
G4int ReceiveG4cout(const G4String &)
Definition: G4UIGAG.cc:172
void GetNewTreeValues(G4UIcommandTree *, int recursiveLevel)
Definition: G4UIGAG.cc:935
std::vector< G4UIcommand * > previousTreePCP
Definition: G4UIGAG.hh:126
void NotifyCommandUpdate(void)
Definition: G4UIGAG.cc:798
ChangeOfTree
Definition: G4UIGAG.hh:45
G4UIsession * SessionStart()
Definition: G4UIGAG.cc:72