00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROOTSHOWER_H
00017 #define ROOTSHOWER_H
00018
00019 #ifndef ROOT_TGFrame
00020 #include "TGFrame.h"
00021 #endif
00022 #ifndef ROOT_TDatime
00023 #include "TDatime.h"
00024 #endif
00025 #ifndef ROOT_TCanvas
00026 #include "TCanvas.h"
00027 #endif
00028
00029 class TGMenuBar;
00030 class TGPopupMenu;
00031 class GTitleFrame;
00032 class GButtonFrame;
00033 class TGButton;
00034 class TGListTree;
00035 class TGListTreeItem;
00036 class TRootEmbeddedCanvas;
00037 class TGCanvas;
00038 class TGStatusBar;
00039 class TGTextEdit;
00040 class TGTab;
00041 class TCanvas;
00042 class TPad;
00043 class MyEvent;
00044 class TEnv;
00045 class TTimer;
00046 class TH1F;
00047 class TGToolBar;
00048 class TContextMenu;
00049
00050
00051 extern TGListTree *gEventListTree;
00052 extern TGListTreeItem *gBaseLTI;
00053 extern TGListTreeItem *gTmpLTI;
00054 extern TGListTreeItem *gLTI[];
00055
00056 extern Int_t gColIndex;
00057
00058
00059 class RootShower: public TGMainFrame {
00060
00061 friend class SettingsDialog;
00062
00063 private:
00064
00065 static Int_t fgDefaultXPosition;
00066 static Int_t fgDefaultYPosition;
00067
00068 Bool_t fOk;
00069 Bool_t fModified;
00070 Bool_t fSettingsModified;
00071 Bool_t fIsRunning;
00072 Bool_t fInterrupted;
00073 Bool_t fShowProcess;
00074 Bool_t fCreateGIFs;
00075
00076 ULong_t fEventNr;
00077 UInt_t fNRun;
00078 TDatime fEventTime;
00079
00080 Int_t fPicIndex;
00081 Int_t fPicNumber;
00082 Int_t fPicDelay;
00083 Int_t fPicReset;
00084
00085 TEnv *fRootShowerEnv;
00086
00087 TGMenuBar *fMenuBar;
00088 TGPopupMenu *fMenuFile;
00089 TGPopupMenu *fMenuEvent;
00090 TGPopupMenu *fMenuTools;
00091 TGPopupMenu *fMenuView;
00092 TGPopupMenu *fMenuHelp;
00093 TGLayoutHints *fMenuBarLayout;
00094 TGLayoutHints *fMenuBarItemLayout;
00095 TGLayoutHints *fMenuBarHelpLayout;
00096 void MakeMenuBarFrame();
00097 void CloseMenuBarFrame();
00098
00099
00100 TGToolBar *fToolBar;
00101 void ShowToolBar(Bool_t show = kTRUE);
00102
00103
00104 TGLayoutHints *fL1;
00105 TGLayoutHints *fL2;
00106 TGLayoutHints *fL3;
00107 TGLayoutHints *fL4;
00108 TGLayoutHints *fL5;
00109 TGLayoutHints *fL6;
00110 TGLayoutHints *fL7;
00111 TGLayoutHints *fL8;
00112
00113
00114 GTitleFrame *fTitleFrame;
00115
00116
00117 TGCompositeFrame *fMainFrame;
00118
00119
00120 TGCompositeFrame *fSelectionFrame;
00121 GButtonFrame *fButtonFrame;
00122 TGListTreeItem *AddToTree(const char *name = 0);
00123 void BuildEventTree();
00124 TGCanvas *fTreeView;
00125 TGListTree *fEventListTree;
00126 TGListTreeItem *fCurListItem;
00127 TContextMenu *fContextMenu;
00128
00129
00130 TGTab *fDisplayFrame;
00131 TRootEmbeddedCanvas *fEmbeddedCanvas;
00132 TRootEmbeddedCanvas *fEmbeddedCanvas2;
00133 TRootEmbeddedCanvas *fEmbeddedCanvas3;
00134 TGTextEdit *fTextView;
00135
00136
00137 TGHorizontalFrame *fHFrame,*fHFrame2;
00138 TGLayoutHints *fZoomButtonsLayout;
00139 TGButton *fZoomPlusButton,*fZoomMoinsButton;
00140 TGButton *fZoomPlusButton2,*fZoomMoinsButton2;
00141
00142
00143 TGStatusBar *fStatusBar;
00144
00145 TTimer *fTimer;
00146 TCanvas *fCA;
00147 TCanvas *fCB;
00148 TCanvas *fCC;
00149
00150 MyEvent *fEvent;
00151 TPad *fPadC;
00152
00153 TH1F *fHisto_dEdX;
00154
00155 protected:
00156 Int_t fFirstParticle;
00157 Double_t fE0;
00158 Double_t fB;
00159
00160 public:
00161
00162 static void setDefaultPosition(Int_t x, Int_t y);
00163
00164
00165 RootShower(const TGWindow *p, UInt_t w, UInt_t h);
00166 virtual ~RootShower();
00167
00168 void SetOk(Bool_t ok=true) { fOk = ok; }
00169 void Modified(Bool_t modified=true) { fModified = modified; }
00170 void SettingsModified(Bool_t modified=true) { fSettingsModified = modified; }
00171 void Interrupt(Bool_t inter=true) { fInterrupted = inter; }
00172 Bool_t IsInterrupted() { return fInterrupted; }
00173 virtual void Initialize(Int_t first);
00174 virtual void OnOpenFile(const Char_t *filename);
00175 virtual void OnSaveFile(const Char_t *filename);
00176 virtual void OnShowerProduce();
00177 virtual void Produce();
00178 virtual void ShowInfos();
00179 virtual void HighLight(TGListTreeItem *item);
00180 virtual void OnShowSelected(TGListTreeItem *item);
00181 virtual void Layout();
00182 virtual void CloseWindow();
00183 virtual Bool_t HandleConfigureNotify(Event_t *event);
00184 virtual Bool_t HandleKey(Event_t *event);
00185 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00186 virtual Bool_t HandleTimer(TTimer *);
00187 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00188 void Clicked(TGListTreeItem *item, Int_t x, Int_t y);
00189 void UpdateDisplay() { fCA->Modified(); fCA->Update(); }
00190 };
00191
00192 extern RootShower *gRootShower;
00193
00194 #endif // EMSHOWER_H