// class EusoMainFrame // GUI interface for Euso simulation program // M. Pallavicini created 28-12-2001 // #ifndef __EUSOMAINFRAME_HH_ #define __EUSOMAINFRAME_HH_ #include "TGFrame.h" #include "TGMenu.h" #include "TApplication.h" #include "TGCanvas.h" #include "TBrowser.h" class SimuApplication; class TFile; class TTree; // constants used to send message to the system from the GUI // menu, buttons etc. enum EusoGUICommands { E_NOT_IMPLEMENTED, // not yet implemented command E_FILE_OPEN_INPUT, // open input file E_FILE_CLOSE_INPUT, // close input file E_FILE_RENAME_OUTPUT, // rename output file (not root file) E_FILE_OPEN_ROOT_INP, // open root file for reading E_FILE_CLOSE_ROOT_INP, // close root file for reading E_FILE_CLOSE_ROOT_OUT, // close root file for writing E_FILE_EXIT_PROGRAM, // end program E_CONFIG_SELECT_FILES, // select config files E_CONFIG_SHOWER_SLAST, // edit parameters for Slast E_CONFIG_SHOWER_CORSIKA, // edit parameters for Corsika E_CONFIG_SHOWER_APGIL, // simple GIL by A.Petrolini E_CONFIG_TESTLIGHTTOEUSO,// edit TestLightToEuso config file E_CONFIG_EUSO, // view and edit config parameters for Euso detector E_RUN_SINGLE, // simulate a single event E_RUN_ALL, // simulate all events in the input source E_RUN_REDO, // re-run last event E_RUN_REDOALL, // re-run all events from beginning E_RUN_SET, // set the number of events to be used E_DISPLAY_SHOW_DATA, // dialog window with simulation results of last event E_DISPLAY_DUMP_DATA, // dump a table with simulation results of last event E_DISPLAY_PRINT_DATA, // print a table with simulation results data of last event E_DISPLAY_3D_EVENT, // enable graphical 3D event display E_ROOT_HIST, // show and display root histograms E_ROOT_TREE, // show and display root tree E_ROOT_BROWSER, // open a root browser E_HELP_CONTENTS, // help E_HELP_ABOUT // about dialog and program version }; // main window of the GUI class EusoMainFrame : public TGMainFrame { public: EusoMainFrame( SimuApplication*, const TGWindow* , UInt_t, UInt_t ); virtual ~EusoMainFrame(); virtual void CloseWindow(); virtual Bool_t ProcessMessage( Long_t, Long_t, Long_t ); private: // enable display menu commands void EnableDisplay( Bool_t enable = kTRUE ); // enable compare menu commands void EnableCompare( Bool_t enable = kTRUE ); // menu objects TGMenuBar *fMenu; // menu bar of the main window TGPopupMenu *fMenuFile, *fMenuConfig, *fMenuRun; // menu items TGPopupMenu *fMenuDisplay, *fMenuRoot, *fMenuHelp; // menu items TGPopupMenu *fCascadeShowerMenu, *fCascadeLightMenu; // menu items TGPopupMenu *fCascadeAtmosphereMenu, *fCascadeDetectorMenu; TGLayoutHints *fMenuLayout, *fItemLayout, *fHelpLayout; TGCanvas *fWindow; // main window with scroll bars TGFrame *fWindowContainer; // main window background // pointer to unique application object SimuApplication *theApp; // execute one event void DoEvent(); // command handlers void HandleMenuCommand(Int_t); void GuiFileOpenInput(); void GuiFileCloseInput(); void GuiFileRenameOutput(); void GuiFileOpenRootInput(); void GuiFileCloseRootInput(); void GuiFileCloseRootOutput(); void GuiConfigSelectFiles(); void GuiConfigShowerBySlast(); void GuiConfigTestLightToEuso(); void GuiConfigEuso(); void GuiRunSingle(); void GuiRunAll(); void GuiRunRedo(); void GuiRunRedoAll(); void GuiRunSet(); void GuiDisplayDumpData(); void GuiRootHistos(); void GuiRootTree(); void GuiRootBrowser(); void GuiDisplayShowData(); void GuiDisplayToggle3DViewer(); // root input file (read only, histogram maker ) inline TFile* RootInputFile() { return fRootInputFile;} void OpenRootInputFile( const char* ); void CloseRootInputFile(); TTree* GetTree(); TFile *fRootInputFile; ClassDef(EusoMainFrame,0) }; #endif