Adding includes now needed by ROOT
[u/mrichter/AliRoot.git] / EVE / Reve / RGTopFrame.h
CommitLineData
5a5a1232 1// $Header$
2
3#ifndef REVE_RGTopFrame_H
4#define REVE_RGTopFrame_H
5
0b28fd57 6#include <TClass.h>
5a5a1232 7#include <TGFrame.h>
5a5a1232 8#include <TGStatusBar.h>
0b28fd57 9#include <TGeoManager.h>
10#include <TROOT.h>
11#include <TVirtualPad.h>
5a5a1232 12
13#include <map>
14
3adb4b94 15class TMacro;
16class TFolder;
5a5a1232 17class TCanvas;
a8600b56 18class TGTab;
5a5a1232 19class TGStatusBar;
20class TGListTree;
21class TGListTreeItem;
22
23namespace Reve {
24
25class VSDSelector;
26class RGBrowser;
27class RGEditor;
1a4ab447 28
5a5a1232 29class RenderElement;
1a4ab447 30class RenderElementList;
31
32class EventBase;
33
5a5a1232 34
35class RGTopFrame : public TGMainFrame
36{
265ecb21 37 RGTopFrame(const RGTopFrame&); // Not implemented
38 RGTopFrame& operator=(const RGTopFrame&); // Not implemented
39
5a5a1232 40public:
41 enum LookType_e { LT_Classic, LT_Editor, LT_GLViewer };
42
cd405991 43 class RedrawDisabler
44 {
45 private:
46 RGTopFrame* fFrame;
47 public:
48 RedrawDisabler(RGTopFrame* f) : fFrame(f)
49 { if (fFrame) fFrame->DisableRedraw(); }
50 ~RedrawDisabler()
51 { if (fFrame) fFrame->EnableRedraw(); }
52 };
53
5a5a1232 54private:
a8600b56 55 TGCompositeFrame *fMasterFrame;
56 TGTab *fMasterTab;
57
58 TCanvas *fGLCanvas;
5a5a1232 59 VSDSelector *fSelector;
60 RGBrowser *fBrowser;
61 TGStatusBar *fStatusBar;
62 const char *fVSDFile;
63
3adb4b94 64 TFolder *fMacroFolder;
65
5a5a1232 66 RGEditor *fEditor;
67
1a4ab447 68 EventBase *fCurrentEvent;
69 RenderElementList *fGlobalStore;
5a5a1232 70
1a4ab447 71 Int_t fRedrawDisabled;
426530cc 72 Bool_t fResetCameras;
5a5a1232 73 Bool_t fTimerActive;
74 TTimer fRedrawTimer;
75
76protected:
77 LookType_e fLook;
78
79 std::map<TString, TGeoManager*> fGeometries;
80
81public:
82 RGTopFrame(const TGWindow *p, UInt_t w, UInt_t h, LookType_e look=LT_Classic);
83
a8600b56 84 TGCompositeFrame* GetMasterFrame() { return fMasterFrame; }
85 TGTab* GetMasterTab() { return fMasterTab; }
86
87 TCanvas* GetGLCanvas() { return fGLCanvas; }
5a5a1232 88 VSDSelector* GetSelector() { return fSelector; }
89 RGBrowser* GetBrowser() { return fBrowser; }
90 TGStatusBar* GetStatusBar() { return fStatusBar; }
91
a8600b56 92 TCanvas* AddCanvasTab(const char* name);
93
1a4ab447 94 TGListTree* GetListTree() const;
95 EventBase* GetCurrentEvent() const { return fCurrentEvent; }
96 RenderElementList* GetGlobalStore() const { return fGlobalStore; }
5a5a1232 97
3adb4b94 98 TFolder* GetMacroFolder() const { return fMacroFolder; }
99 TMacro* GetMacro(const Text_t* name) const;
100
5a5a1232 101 RGEditor* GetEditor() const { return fEditor; }
102 void EditRenderElement(RenderElement* rnr_element);
103
1a4ab447 104 void DisableRedraw() { ++fRedrawDisabled; }
105 void EnableRedraw() { --fRedrawDisabled; if(fRedrawDisabled <= 0) Redraw3D(); }
5a5a1232 106
426530cc 107 void Redraw3D(Bool_t resetCameras=kFALSE) {
108 if(fRedrawDisabled <= 0 && !fTimerActive) RegisterRedraw3D();
109 if(resetCameras) fResetCameras = kTRUE;
110 }
5a5a1232 111 void RegisterRedraw3D();
112 void DoRedraw3D();
113
a8600b56 114 static int SpawnGuiAndRun(int argc, char **argv);
115 static void SpawnGui(LookType_e revemode = LT_Editor);
5a5a1232 116
117 // These are more like ReveManager stuff.
1a4ab447 118 TGListTreeItem* AddEvent(EventBase* event); // Could have Reve::Event ...
5a5a1232 119 TGListTreeItem* AddRenderElement(RenderElement* rnr_element);
1a4ab447 120 TGListTreeItem* AddRenderElement(RenderElement* parent, RenderElement* rnr_element);
5a5a1232 121 TGListTreeItem* AddGlobalRenderElement(RenderElement* rnr_element);
1a4ab447 122 TGListTreeItem* AddGlobalRenderElement(RenderElement* parent, RenderElement* rnr_element);
123
124 void RemoveRenderElement(RenderElement* parent, RenderElement* rnr_element);
a8600b56 125 void PreDeleteRenderElement(RenderElement* rnr_element);
5a5a1232 126
127 void DrawRenderElement(RenderElement* rnr_element, TVirtualPad* pad=0);
5a34ca2d 128 void UndrawRenderElement(RenderElement* rnr_element, TVirtualPad* pad=0);
5a5a1232 129
130 void RenderElementChecked(TObject* obj, Bool_t state);
131
1a4ab447 132 void NotifyBrowser(TGListTreeItem* parent_lti=0);
133 void NotifyBrowser(RenderElement* parent);
5a5a1232 134
135 // Hmmph ... geometry management?
136 TGeoManager* GetGeometry(const TString& filename);
137
a8600b56 138 void ThrowException(const char* text="foo");
139
5a5a1232 140 ClassDef(RGTopFrame, 0);
141};
142
143} // namespace Reve
144
145extern Reve::RGTopFrame* gReve;
146
147#endif