]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/Reve/Reve.h
Add Getters and Setters in TrackRnrStyle and TrackList to define rendering of path...
[u/mrichter/AliRoot.git] / EVE / Reve / Reve.h
CommitLineData
5a5a1232 1// $Header$
2
3#ifndef REVE_Reve_H
4#define REVE_Reve_H
5
a8600b56 6// #include <string>
7#include <exception>
465af230 8#include <list>
9#include <set>
10
51a6ecc6 11#include <TObject.h>
5a5a1232 12#include <TString.h>
3cc71cfc 13#include <TError.h>
915dabe1 14#include <Gtypes.h>
843e6acd 15#include <GuiTypes.h>
5a5a1232 16
5a5a1232 17class TVirtualPad;
18class TGeoManager;
19
20namespace Reve {
21
843e6acd 22class RenderElement;
51a6ecc6 23
24/**************************************************************************/
25// Exceptions, string functions
26/**************************************************************************/
27
a8600b56 28bool operator==(const TString& t, const std::string& s);
29bool operator==(const std::string& s, const TString& t);
30
31class Exc_t : public std::exception, public TString
5a5a1232 32{
33 public:
34 Exc_t() {}
a8600b56 35 Exc_t(const TString& s) : TString(s) {}
36 Exc_t(const char* s) : TString(s) {}
37 Exc_t(const std::string& s);
5a5a1232 38
a8600b56 39 virtual ~Exc_t() throw () {}
5a5a1232 40
a8600b56 41 virtual const char* what() const throw () { return Data(); }
5a5a1232 42
a8600b56 43 ClassDef(Exc_t, 1);
5a5a1232 44};
45
46Exc_t operator+(const Exc_t &s1, const std::string &s2);
47Exc_t operator+(const Exc_t &s1, const TString &s2);
48Exc_t operator+(const Exc_t &s1, const char *s2);
49
51a6ecc6 50void WarnCaller(const TString& warning);
5a5a1232 51
915dabe1 52
5a5a1232 53/**************************************************************************/
51a6ecc6 54// Environment, Macro functions
5a5a1232 55/**************************************************************************/
56
51a6ecc6 57void SetupEnvironment();
5a5a1232 58
f8fae956 59Bool_t CheckMacro(const Text_t* mac);
60void AssertMacro(const Text_t* mac);
61void Macro(const Text_t* mac);
62void LoadMacro(const Text_t* mac);
5a5a1232 63
51a6ecc6 64
5a5a1232 65/**************************************************************************/
51a6ecc6 66// Local cache for global Pad, GeoManager
5a5a1232 67/**************************************************************************/
68
69TVirtualPad* PushPad(TVirtualPad* new_gpad=0, Int_t subpad=0);
70TVirtualPad* PopPad(Bool_t modify_update_p=false);
71
72class PadHolder
73{
74private:
75 Bool_t fModifyUpdateP;
76public:
77 PadHolder(Bool_t modify_update_p, TVirtualPad* new_gpad=0, Int_t subpad=0) :
78 fModifyUpdateP(modify_update_p)
79 { PushPad(new_gpad, subpad); }
80
81 virtual ~PadHolder() { PopPad(fModifyUpdateP); }
82
83 ClassDef(PadHolder, 0);
84};
85
86class GeoManagerHolder
87{
88private:
89 TGeoManager* fManager;
265ecb21 90
91 GeoManagerHolder(const GeoManagerHolder&); // Not implemented
92 GeoManagerHolder& operator=(const GeoManagerHolder&); // Not implemented
93
5a5a1232 94public:
95 GeoManagerHolder(TGeoManager* new_gmgr=0);
96 virtual ~GeoManagerHolder();
97
98 ClassDef(GeoManagerHolder, 0);
99};
100
51a6ecc6 101
102/**************************************************************************/
103// ReferenceCount base-class (interface)
915dabe1 104/**************************************************************************/
105
106class ReferenceCount
107{
108protected:
109 Int_t fRefCount;
110
111public:
112 ReferenceCount() : fRefCount(0) {}
113 virtual ~ReferenceCount() {}
114
843e6acd 115 ReferenceCount(const ReferenceCount&) : fRefCount(0) {}
116 ReferenceCount& operator=(const ReferenceCount&) { return *this; }
117
915dabe1 118 void IncRefCount() { ++fRefCount; }
119 void DecRefCount() { if(--fRefCount <= 0) OnZeroRefCount(); }
120
121 virtual void OnZeroRefCount() { delete this; }
122
123 ClassDef(ReferenceCount, 0);
124};
125
465af230 126/**************************************************************************/
127// ReferenceBackPtr reference-count with back pointers
128/**************************************************************************/
129
130class ReferenceBackPtr : public ReferenceCount
131{
132protected:
133 std::list<RenderElement*> fBackRefs;
134
135public:
136 ReferenceBackPtr();
137 virtual ~ReferenceBackPtr();
138
139 ReferenceBackPtr(const ReferenceBackPtr&);
140 ReferenceBackPtr& operator=(const ReferenceBackPtr&);
141
142 using ReferenceCount::IncRefCount;
143 using ReferenceCount::DecRefCount;
144 virtual void IncRefCount(RenderElement* re);
145 virtual void DecRefCount(RenderElement* re);
146
147 virtual void UpdateBackPtrItems();
148
149 ClassDef(ReferenceBackPtr, 0);
150};
151
51a6ecc6 152
153/**************************************************************************/
843e6acd 154// Color management
51a6ecc6 155/**************************************************************************/
156
157void ColorFromIdx(Color_t ci, UChar_t* col, Bool_t alpha=kTRUE);
158void ColorFromIdx(Float_t f1, Color_t c1, Float_t f2, Color_t c2,
159 UChar_t* col, Bool_t alpha=kTRUE);
160Color_t* FindColorVar(TObject* obj, const Text_t* varname);
161
5a5a1232 162}
163
164#endif