QEventDisplay.hh

Go to the documentation of this file.
00001 
00006 #ifndef _QEVENTDISPLAY_HH
00007 #define _QEVENTDISPLAY_HH
00008 
00009 #include <string>
00010 #include <map>
00011 #include <stack>
00012 #include <TObject.h>
00013 #include <TAttLine.h>
00014 #include <TAttMarker.h>
00015 #include <TAttFill.h>
00016 
00017 class QEventR;
00018 class QEventAuxDataR;
00019 class QRunDataR;
00020 class TPad;
00021 class QIGUIDianaSessionHandler;
00022 class THStack;
00023 
00024 class QEventDisplayObject : public TObject, public TAttLine, public TAttMarker, public TAttFill
00025 {
00026   public:
00027     bool fEnabled;
00028     std::string fOptions;
00029 };
00030  
00031 
00032 class QEventDisplay
00033 {
00034   public:
00035 
00036     QEventDisplay(std::string name ="");
00037     virtual ~QEventDisplay();
00038     virtual void Draw(TPad &pad, QEventR* ev, QEventAuxDataR* aux=0, QRunDataR * run=0)=0;
00039     virtual void InitDisplayObjects(QIGUIDianaSessionHandler * ds=0)=0;
00040 
00041     // Setters and getters
00042     std::string GetName() {return fName;}
00043     void ToggleGlobalEnabled(bool enabled) {fGlobalEnabled=enabled;}
00044     bool IsGlobalEnabled() {return fGlobalEnabled;}  
00045     
00046     // Get fDisplayObjects
00047     const std::map<std::string, QEventDisplayObject > & GetDisplayObjects() {return fDisplayObjects;}
00048     QEventDisplayObject &GetDisplayObject (std::string name);
00049 
00050     // Add Display Object
00051     void AddDisplayObject(std::string name, bool enabled);
00052 
00053     // Set user format to index object (Line, Marker & Fill)
00054     void SetFormatToObject(std::string name, TObject * obj);
00055 
00056     void SetOptions(std::string name, const std::string options);
00057     void ToggleEnabled(std::string name, bool enabled); 
00058 
00059 
00060 
00061     static void InitStack(); // Init stack
00062     static void EndStack(); // End stack
00063     void DrawObjects();
00064 
00065   protected:
00066     std::map<std::string, QEventDisplayObject> fDisplayObjects;
00067     std::stack<TObject*> fToDraw;   // PUSH HERE OBJECTS DIFFERENT FROM HISTOGRAMS!!
00068 
00069     std::string fName;
00070     bool fGlobalEnabled;
00071 
00072     static THStack * fStack; // To stack different shapes
00073 
00074 };
00075 
00076 
00077 #endif

Generated on Tue Nov 16 10:49:59 2010 for CUORE Software by  doxygen 1.5.6