12 #ifndef ROOT7_REveUtil
13 #define ROOT7_REveUtil
27 namespace Experimental {
39 static TObjArray *fgDefaultColors;
42 virtual ~REveUtil() {}
46 static Bool_t CheckMacro(
const char *mac);
47 static void AssertMacro(
const char *mac);
48 static void Macro(
const char *mac);
49 static void LoadMacro(
const char *mac);
53 static void ColorFromIdx(Color_t ci, UChar_t col[4], Bool_t alpha = kTRUE);
54 static void ColorFromIdx(Color_t ci, UChar_t col[4], Char_t transparency);
55 static void ColorFromIdx(Float_t f1, Color_t c1, Float_t f2, Color_t c2, UChar_t col[4], Bool_t alpha = kTRUE);
56 static Color_t *FindColorVar(TObject *obj,
const char *varname);
58 static void SetColorBrightness(Float_t value, Bool_t full_redraw = kFALSE);
62 static Bool_t IsU1IntervalContainedByMinMax(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ);
63 static Bool_t IsU1IntervalOverlappingByMinMax(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ);
65 static Bool_t IsU1IntervalContainedByMeanDelta(Float_t meanM, Float_t deltaM, Float_t meanQ, Float_t deltaQ);
66 static Bool_t IsU1IntervalOverlappingByMeanDelta(Float_t meanM, Float_t deltaM, Float_t meanQ, Float_t deltaQ);
68 static Float_t GetFraction(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ);
71 inline Bool_t REveUtil::IsU1IntervalContainedByMeanDelta(Float_t meanM, Float_t deltaM, Float_t meanQ, Float_t deltaQ)
73 return IsU1IntervalContainedByMinMax(meanM - deltaM, meanM + deltaM, meanQ - deltaQ, meanQ + deltaQ);
76 inline Bool_t REveUtil::IsU1IntervalOverlappingByMeanDelta(Float_t meanM, Float_t deltaM, Float_t meanQ, Float_t deltaQ)
78 return IsU1IntervalContainedByMinMax(meanM - deltaM, meanM + deltaM, meanQ - deltaQ, meanQ + deltaQ);
87 class REveGeoManagerHolder
90 TGeoManager *fManager{
nullptr};
94 REveGeoManagerHolder(TGeoManager *new_gmgr =
nullptr, Int_t n_seg = 0);
95 ~REveGeoManagerHolder();
109 REveRefCnt() =
default;
110 virtual ~REveRefCnt() {}
112 REveRefCnt(
const REveRefCnt &) : fRefCount(0) {}
113 REveRefCnt &operator=(
const REveRefCnt &) {
return *
this; }
115 void IncRefCount() { ++fRefCount; }
118 if (--fRefCount <= 0)
122 virtual void OnZeroRefCount() {
delete this; }
130 class REveRefBackPtr :
public REveRefCnt
133 typedef std::map<REveElement *, Int_t> RefMap_t;
139 virtual ~REveRefBackPtr();
141 REveRefBackPtr(
const REveRefBackPtr &);
142 REveRefBackPtr &operator=(
const REveRefBackPtr &);
144 using REveRefCnt::DecRefCount;
145 using REveRefCnt::IncRefCount;
146 virtual void IncRefCount(REveElement *re);
147 virtual void DecRefCount(REveElement *re);
149 virtual void StampBackPtrElements(UChar_t stamps);