G4UIGAG.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // G4UIGAG.hh
00030 // GAG(Geant4 adaptive GUI) interface class
00031 // 18.Feb.98 Y.Nagamatu and T.Kodama created G4UIGAG from G4UIterminal
00032 
00033 // If you want to use GAG (Tcl and JAVA version),
00034 // read a document file README_Momo.html.
00035 
00036 #ifndef G4UIGAG_h
00037 #define G4UIGAG_h 1
00038 
00039 #include "G4UIsession.hh"
00040 #include "G4UImanager.hh"
00041 #include <fstream>
00042 #include <vector>
00043 
00044 enum UImode { terminal_mode , java_mode, tcl_mode };
00045 enum ChangeOfTree  { notChanged=0, added, deleted, addedAndDeleted };
00046 
00047 // class description:
00048 //
00049 // This class inherits the class G4UIsession.
00050 // This is the class which is the front-end to GAG (Geant4 Adaptive GUI).
00051 // Its usage is quite similar to G4UIterminal.
00052 
00053 class G4UIGAG : public G4UIsession
00054 {
00055       public: // with description
00056       G4UIGAG();
00057       ~G4UIGAG();
00058 
00059       G4UIsession * SessionStart();
00060 
00061       // A GAG session  "gagSession" is instantiated.
00062       // G4cout stream is redirected by default to the constructed instance.
00063       // Usage:  G4UIsession * gagSession = new G4UIGAG;
00064       // "gagSession" is started.
00065       // Usage: gagSession->SessionStart();
00066       // "gagSession"  is deleted.
00067       // Usage: delete gagSession;
00068       //
00069       void PauseSessionStart(const G4String&);
00070       G4int ReceiveG4cout(const G4String&);
00071       G4int ReceiveG4cerr(const G4String&);         
00072       // These methods are implementation of the virtual methods of
00073       // G4UIsession class. 
00074       //
00075       void SessionTerminate();
00076       void Prompt(const G4String&);
00077       G4String GetCommand();
00078       // These methods are not for users.
00079   private:
00080       G4String prefix;
00081       G4UImanager * UI;
00082       G4String promptCharacter;
00083       G4bool iExit;
00084       G4bool iCont;
00085       UImode uiMode;
00086 
00087   private:
00088       G4String JVersion;
00089       G4String TVersion;
00090       void ExecuteCommand(const G4String&);
00091       void ChangeDirectory(const G4String&);
00092       void ListDirectory(const G4String&);
00093       void TerminalHelp(const G4String&);
00094      G4String ModifyPrefix(G4String);
00095       G4UIcommandTree* FindDirPath(const G4String&);
00096       void ShowCurrent(const G4String&);
00097       G4String GetFullPath(const G4String&);
00098 
00099     void SendCommandProperties(G4UIcommandTree *);
00100     void SendParameterProperties(G4UIcommandTree *);
00101     void SendAParamProperty(G4UIcommand *);
00102     void SendATclParamProperty(G4UIcommand *);
00103     void CodeGenJavaTree(G4UIcommandTree *,int recursiveLevel); 
00104     void CodeGenJavaParams(G4UIcommandTree *,int recursiveLevel); 
00105     void CodeGenTclTree(G4UIcommandTree *, int recursiveLevel); 
00106     void CodeGenTclParams(G4UIcommandTree *, int recursiveLevel); 
00107     void SendDisableList(G4UIcommandTree *, int recursiveLevel);
00108 
00109     void NotifyStateChange(void);
00110     void NotifyCommandUpdate(void);
00111     void NotifyParameterUpdate(G4UIcommand *);
00112 
00113     int CommandUpdated(void);
00114     void UpdateState(void);
00115     void UpdateParamVal(void);  // if param is updated,
00116                                // call NotifyParameterUpdate()
00117 
00118     // --- the following are used by Notify*Update() and *Updated()
00119     void GetNewTreeStructure( G4UIcommandTree*,int recursiveLevel);
00120     void GetNewTreeValues( G4UIcommandTree*,int recursiveLevel);
00121     
00122     std::vector<G4String> previousTreeCommands;
00123     std::vector<G4String> newTreeCommands;
00124     std::vector<G4String> previousTreeParams;
00125     std::vector<G4String> newTreeParams;
00126     std::vector<G4UIcommand*> previousTreePCP;
00127     std::vector<G4UIcommand*> newTreePCP;
00128 
00129 };
00130 
00131 #endif

Generated on Mon May 27 17:50:06 2013 for Geant4 by  doxygen 1.4.7