QIGUIPlotData.hh

00001 #ifndef _QIGUI_PLOT_DATA__H_
00002 #define _QIGUI_PLOT_DATA__H_
00003 
00004 #include "QIGUIFileHandler.hh"
00005 #include "QIGUICut.hh"
00006 #include "QIGUISession.hh"
00007 #include <TCut.h>
00008 
00009 class QIGUIChannelCut;
00010 class TEventList;
00011 
00012 class QIGUIPlotData: public QObject
00013 {
00014   Q_OBJECT
00015 
00016   private:
00018     int fChannel;
00019 
00021     QIGUIChannelCut * fChannelCut;
00022 
00024     std::map<QString, QIGUICut*> fCuts;
00025 
00027     QIGUIFileHandler * fFileHandler;
00028 
00030     QIGUISession * fSession;
00031 
00033     TEventList * fEventList;
00034     bool fEventListNeedsRegeneration;
00035 
00036   public:
00037     // Ctr, Dtr, initialization
00038     QIGUIPlotData (QObject * parent = 0);
00039     QIGUIPlotData (QIGUIFileHandler * f, QIGUICut * c, QObject * parent = 0);
00040     QIGUIPlotData (const QIGUIPlotData &plotdata);
00041     const QIGUIPlotData& operator=(const QIGUIPlotData& plotdata);
00042     virtual ~QIGUIPlotData();
00043 
00044     void Init();
00045 
00046     // setters and getters
00047     QIGUICut * GetCut(QString name);
00048     QIGUICut * GetChannelCut(){return (QIGUICut*)fChannelCut;}
00049     std::map<QString, QIGUICut*> GetCuts () { return fCuts; }
00050   
00051     QIGUIFileHandler * GetFileHandler () {return fFileHandler;}
00052     void SetFileHandler (QIGUIFileHandler * f);
00053   
00054     QIGUISession * GetSession(){return fSession;}
00055     void SetSession(QIGUISession * session) {fSession = session;}
00056 
00057   
00058     int GetChannel() {return fChannel;}
00059 
00060     // Add and Remove cut
00061     void AddCut(QIGUICut * c) ;
00062     void RemoveCut(QString name) ;
00063     void ToggleEventListNeedsRegeneration (bool flag = true) {fEventListNeedsRegeneration=flag;}
00064 
00065     // TODO Aritmetica de cuts
00066     TCut AndAllTheCuts(); // Return the && of all the fCuts
00067     QString NameAndAllTheCuts(); // Return the name of the and of all the cuts
00068                                  // example:   cut && !cut_1
00069 
00070     int GetNEvents(); // Return total number of events
00071 
00072     void RegenerateEventList();
00073     TEventList * GetEventList();
00074     int GetNSelectedEvents(); // Return the number of selected events
00075     int GetEventNumber(int index); // get event number corresponding to index in the eventList
00076     bool Contains(int ev); // Return true if ev is in the event list
00077 
00078     // Lock/UnLock Mutex that protects chain
00079     void LockChainMutex();
00080     void UnLockChainMutex();
00081     void EmitNofityChannelChangedToSpinSignal(int);
00082 
00083   public slots:
00084     void SetChannel(int ch) ;
00085 
00086   signals: 
00087     void RegenerateEventListSignal();
00088     void NofityChannelChangedToSpinSignal(int);
00089 
00090 
00091     
00092 };
00093 
00094 #endif

Generated on Fri Mar 6 13:40:40 2009 for CUORE Software by  doxygen 1.5.1