QIGUIPlotWindow.hh
00001 #ifndef _QIGUI_PLOTWINDOW__H_
00002 #define _QIGUI_PLOTWINDOW__H_
00003
00004 #include <QMainWindow>
00005 #include <TCanvas.h>
00006
00007 #include "ui_PlotWindow.h"
00008 #include "QIGUIPlot.hh"
00009
00010 class QIGUIMainWindow;
00011 class QIGUISession;
00012 class QSpinBox;
00013 class QIGUIPlotData;
00014 class QIGUIPlotSet;
00015 class QIGUIScatterPlot;
00016 class QIGUIHistogram;
00017 class QIGUIPlotCanvasEditWindow;
00018 class TVirtualPadEditor;
00019
00020 class QIGUIPlotWindow: public QMainWindow, public Ui::PlotWindow
00021
00022 {
00023 Q_OBJECT
00024
00025 public:
00026 QIGUIPlotWindow (QWidget * parent=0);
00027 QIGUIPlotWindow (QString& name, QWidget * parent=0);
00028 virtual ~QIGUIPlotWindow();
00029
00030 void DivideCanvas (int x, int y);
00031
00033 void Draw(QIGUIPlotData * );
00034
00035
00036 void SetActiveSession(QIGUISession * );
00037 bool GetSuperimpose() {return fSuperimpose;}
00038 void SetSuperimpose (bool val) {fSuperimpose = val;}
00039 void ToggleSuperimposeFlag ();
00040
00041 void Init();
00042 void CreateActions();
00043 void CreateSignals();
00044 void DestroySignals();
00045 void FillVariablesCombo(int pad = -1);
00046 void AddTabEditCanvas();
00047 void RemoveLastTabEditCanvas();
00048 QIGUIScatterPlot * NewScatterPlot(int index, QIGUIPlotData * plotData, int plotset=0);
00049 QIGUIHistogram * NewHistogram(int index, QIGUIPlotData * plotData, int plotset=0);
00050
00051
00052
00053
00054 void ChangeLogScale(int pad, QString var, bool log);
00055 void NotifyChangeXVar(QString, int pad);
00056 void NotifyChangeYVar(QString, int pad);
00057 void AddPlotSet(QIGUIPlotSet * plotset);
00058
00059 void UpdateNEvents(int index);
00060 void UpdateCutName(int index);
00061
00062
00063 std::vector <QIGUIPlotSet*> GetPlotSets() {return fPlotSets;}
00064 QIGUIPlotSet* GetCurrentPlotSet() {return fCurrentPlotSet;}
00065 int GetCurrentPlotSetIndex() {return fCurrentPlotSetIndex;}
00066 void SetCurrentPlotSet(int ind) {fCurrentPlotSet = fPlotSets[ind]; fCurrentPlotSetIndex = ind;}
00067 void CreateGraphicalCut();
00068
00069
00070
00071 public slots:
00072
00073
00074 void AskNumberOfPads ();
00075 void NotifyToggleSuperimposeFlag ();
00076 void NotifyChangePlotHisto(QTreeWidgetItem * item, int column);
00077 void NotifyChangeCurrentItemChanged(QTreeWidgetItem * current, QTreeWidgetItem * previos);
00078 void NotifyChangePlotDataChannel(int dummy);
00079 void LaunchDianaPulseViewerWithZoomCut();
00080 void NotifyTogglePadEditor();
00081 void ToggleGrid();
00082
00083 void RefreshCanvas();
00084 void ClearCanvas();
00085 void ResizeTreePlotsHisto(QTreeWidgetItem* item, int column);
00086 void ChangeActivePad(int i);
00087 void UnZoomActivePad();
00088 void ClearPlotSetup(int index, int plostset = -1);
00089 void DeletePlot(int ind = -1);
00090
00091 void CanvasEvent(TObject *obj, unsigned int event, TCanvas *c);
00092 void InitGraphicalCut();
00093 void IntegratePlot();
00094 void FitPeaks();
00095 void IncreaseGeneralChannel();
00096 void DecreaseGeneralChannel();
00097 void ReloadCutsSelectedPlot();
00098
00099
00100 void ToggleCoAnalysis(bool);
00101
00102
00103 void SaveAs();
00104 void SaveChannelPlots();
00105
00106
00107 private:
00108
00109 std::string fDescription;
00110 bool fSuperimpose;
00111 QIGUIMainWindow * fMainWindow;
00112 TVirtualPadEditor * fPadEditor;
00113 bool fShowPadEditor;
00114
00115
00116 QIGUISession * fActiveSession;
00117
00119 TCanvas * fCanvas;
00120
00121
00122 int fNPads;
00123
00124
00125 std::vector<QIGUIPlotCanvasEditWindow*> fTabEditCanvas;
00126
00128 std::vector<QIGUIPlotSet*> fPlotSets;
00129
00131 QIGUIPlotSet* fCurrentPlotSet;
00132 int fCurrentPlotSetIndex;
00133
00134 QSpinBox * fRawsSpinBox;
00135 QSpinBox * fColumnsSpinBox;
00136
00137
00138 std::list<Color_t> fColors;
00139
00140 bool fGeneratingGraphicalCut;
00141 bool fIntegrating;
00142 bool fFittingPeaks;
00143 std::vector<double> fFitPositions;
00144
00145
00146 bool fCoAnalysis;
00147
00148 protected:
00149 void closeEvent ( QCloseEvent * event ) ;
00150
00151
00152 public:
00153
00154 QColor &MapColor(Color_t icol);
00155 Color_t &MapColor(QColor qcol);
00156
00157 };
00158
00159 #endif