00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TGO4PREVIEWPANELSLOTS_H
00017 #define TGO4PREVIEWPANELSLOTS_H
00018
00019 #include "Go4GUIBase/TGo4SlotsBaseClass.h"
00020 #include "Go4MouseModes.h"
00021
00022 class TGo4PreviewPanelStatus;
00023 class TGo4Status;
00024 class TGo4PreviewPanel;
00025 class TGo4GUIRegistry;
00026 class TPad;
00027 class TH1;
00028 class THStack;
00029 class TCanvas ;
00030 class TLatex;
00031 class TArrow;
00032 class TVirtualPadEditor;
00033 class TGo4GedFrame;
00034 class TGo4MarkerSetup;
00035 class TGo4Marker;
00036 class TGo4WinCond;
00037 class TGo4PolyCond;
00038 class QWidget;
00039 class TQRootWindow;
00040
00041 #include "TGFrame.h"
00042
00047 class TGo4PreviewPanelSlots : public TGo4SlotsBaseClass {
00048
00049 public:
00050 TGo4PreviewPanelSlots(const char * name, const char * title, TGo4PreviewPanel *p);
00051 virtual ~TGo4PreviewPanelSlots();
00052 void SetGUI(TGo4PreviewPanel *GUI );
00053 TGo4Status * GetStatus();
00054 void DivideCanvas(int X, int Y);
00055 TCanvas *GetCanvas();
00056
00061 void UpdatePad(TPad *Pad, TH1 *h1, Bool_t updatemarkers=kTRUE, Bool_t updateoptions=kTRUE);
00062 void UpdatePad(TPad *Pad, THStack *h1, Bool_t updatemarkers=kTRUE);
00063
00066 void InformUpdatePad(TPad *Pad);
00067
00068 virtual void AddObject(TNamed *, TQRootCanvas *c, TPad *p);
00069
00070 void SetMouseMode(Go4MouseMode_t mode){fiMouseMode=mode;}
00071 Go4MouseMode_t GetMouseMode(){return fiMouseMode;}
00072
00073 void SetPickAgain(Bool_t on){fbPickAgain=on;}
00074 Bool_t IsPickAgain(){return fbPickAgain;}
00075 void SetCreateNewMarker(Bool_t on){fbCreateNewMarker=on;}
00076 Bool_t IsCreateNewMarker(){return fbCreateNewMarker;}
00077 void ResetPickCounter(){fuPickCounter=0;}
00078
00080 void MouseClick(TPad* pad);
00081
00083 void SetRegionsHistogram();
00084
00086 void SetPolygonsHistogram();
00087
00089 void SetMarkersHistogram();
00090
00095 Bool_t AddLatex(TLatex* lax, TVirtualPad* pad, Bool_t clone=kFALSE);
00096
00100 Bool_t AddArrow(TArrow* arr, TVirtualPad* pad, Bool_t clone=kFALSE);
00101
00102
00106 Bool_t AddMarker(TGo4Marker* mk, TVirtualPad* pad, Bool_t clone=kFALSE);
00107
00108
00112 Bool_t AddRegion(TGo4WinCond* con, TVirtualPad* pad, Bool_t clone=kFALSE);
00113
00114
00118 Bool_t AddPolygon(TGo4PolyCond* con, TVirtualPad* pad, Bool_t clone=kFALSE);
00119
00123 void ScanCutG(TVirtualPad* pad, TGo4PolyCond* toupdate=0);
00124
00129 void ScanMarkers(TVirtualPad* pad);
00130
00131
00134 void ActivateSelectedObject(TVirtualPad* pad);
00135
00136
00138 TGo4Marker* GetActiveMarker(TVirtualPad* pad);
00139
00141 const Text_t* GetActiveMarkerName(TVirtualPad* pad);
00142
00144 TGo4WinCond* GetActiveRegion(TVirtualPad* pad);
00145
00147 const Text_t* GetActiveRegionName(TVirtualPad* pad);
00148
00150 TGo4PolyCond* GetActivePolygon(TVirtualPad* pad);
00151
00153 const Text_t* GetActivePolygonName(TVirtualPad* pad);
00154
00156 TLatex* GetActiveLatex(TVirtualPad* pad);
00157
00159 const Text_t* GetActiveLatexName(TVirtualPad* pad);
00160
00162 const Text_t* GetSelectedName(){return fxSelectedName.Data();}
00163
00166 void RedrawAllLabels(TVirtualPad* pad);
00167
00171 void ClearAllLabels(TVirtualPad* pad);
00172
00175 void DrawLegend(TVirtualPad* pad, TObject* ob);
00176
00179 void ClearLegend(TVirtualPad* pad, Bool_t del=kFALSE);
00180
00182 void LogMarkers(Option_t* opt="");
00183
00184
00186 void BuildPadEditor(TQRootWindow* parent=0);
00187
00190 void CleanupPadEditor();
00191
00194 void SaveMarkerSetup(const Text_t* filename, const Text_t* statusname=0, TVirtualPad* pad=0);
00195
00200 void LoadMarkerSetup(const Text_t* filename, const Text_t* statusname=0, TVirtualPad* pad=0);
00201
00206 void ResetFillColors(TVirtualPad* pad, Color_t col=0);
00207
00208
00209
00210
00211 private:
00212
00214 TGo4MarkerSetup* CreateMarkerSetup(TVirtualPad* pad);
00215
00220 void SetMarkerSetup(TGo4MarkerSetup* state, TVirtualPad* pad);
00221
00222
00223
00225 TGo4GUIRegistry * fxTGo4GUIRegistry;
00226 TGo4PreviewPanel * fxTGo4PreviewPanel;
00227 TGo4PreviewPanelStatus *fxTGo4PreviewPanelStatus;
00228
00231 Go4MouseMode_t fiMouseMode;
00232
00234 UInt_t fuPickCounter;
00235
00237 TList* fxMarkerList;
00238
00240 TList* fxRegionList;
00241
00243 TList* fxPolygonList;
00244
00246 TList* fxLateXCleanups;
00247
00249 TList* fxLateXList;
00250
00252 TList* fxArrowCleanups;
00253
00255 TList* fxArrowList;
00256
00258 TList* fxLegendCleanups;
00259
00261 Bool_t fbTwoDimRegion;
00262
00264 Bool_t fbPickAgain;
00265
00268 Bool_t fbCreateNewMarker;
00269
00271 TString fxSelectedName;
00272
00274 TVirtualPadEditor* fxPeditor;
00275 };
00276
00277 #endif //TGO4PREVIEWPANELSLOTS_H
00278
00279
00280
00281
00282