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
00042 std::string GetName() {return fName;}
00043 void ToggleGlobalEnabled(bool enabled) {fGlobalEnabled=enabled;}
00044 bool IsGlobalEnabled() {return fGlobalEnabled;}
00045
00046
00047 const std::map<std::string, QEventDisplayObject > & GetDisplayObjects() {return fDisplayObjects;}
00048 QEventDisplayObject &GetDisplayObject (std::string name);
00049
00050
00051 void AddDisplayObject(std::string name, bool enabled);
00052
00053
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();
00062 static void EndStack();
00063 void DrawObjects();
00064
00065 protected:
00066 std::map<std::string, QEventDisplayObject> fDisplayObjects;
00067 std::stack<TObject*> fToDraw;
00068
00069 std::string fName;
00070 bool fGlobalEnabled;
00071
00072 static THStack * fStack;
00073
00074 };
00075
00076
00077 #endif