21using namespace::ROOT::Experimental;
86REveDigitSet::REveDigitSet(
const char*
n,
const char* t) :
102 fRenderMode (kRM_AsIs),
105 fDisableLighting(
kTRUE),
106 fHistoButtons (
kTRUE),
113 fCanEditMainColor =
kTRUE;
114 fCanEditMainTransparency =
kTRUE;
123REveDigitSet::~REveDigitSet()
137 fLastIdx = fPlex.Size();
138 fLastDigit =
new (fPlex.NewAtom())
DigitBase_t(fDefaultValue);
146void REveDigitSet::ReleaseIds()
150 const Int_t N = fDigitIds->GetSize();
152 for (
Int_t i = 0; i <
N; ++i)
153 delete fDigitIds->At(i);
155 fDigitIds->Expand(0);
163void REveDigitSet::UseSingleColor()
165 fSingleColor =
kTRUE;
175 REveElement::SetMainColor(color);
179 fFrame->SetFrameColor(color);
180 fFrame->StampBackPtrElements(kCBColorSelection);
189void REveDigitSet::UnSelected()
191 fSelectedSet.clear();
192 REveElement::UnSelected();
199void REveDigitSet::UnHighlighted()
201 fHighlightedSet.clear();
202 REveElement::UnHighlighted();
209TString REveDigitSet::GetHighlightTooltip()
211 if (fHighlightedSet.empty()) return "";
213 if (GetAlwaysSecSelect())
217 return (fTooltipCBFoo)(this, *fHighlightedSet.begin());
221 TObject *o = GetId(*fHighlightedSet.begin());
223 return TString(o->GetName());
225 return TString::Format("%s; idx=%d", GetElementName(), *fHighlightedSet.begin());
229 return REveElement::GetHighlightTooltip();
237void REveDigitSet::RefitPlex()
247 if (fValueIsColor || fPlex.Size() == 0)
255 for (
Int_t c=0;
c<fPlex.VecSize(); ++
c)
262 if (
v < min) min =
v;
263 if (
v > max) max =
v;
277void REveDigitSet::SetCurrentDigit(
Int_t idx)
280 fLastDigit = GetDigit(idx);
286void REveDigitSet::DigitValue(
Int_t value)
288 fLastDigit->fValue = value;
296 REveUtil::ColorFromIdx(ci, (
UChar_t*) & fLastDigit->fValue,
kTRUE);
304 REveUtil::ColorFromIdx(ci, (
UChar_t*) & fLastDigit->fValue, transparency);
313 x[0] =
r;
x[1] =
g;
x[2] =
b;
x[3] =
a;
322 x[0] = rgba[0];
x[1] = rgba[1];
x[2] = rgba[2];
x[3] = rgba[3];
330 DigitId(fLastIdx,
id);
336void REveDigitSet::DigitUserData(
void* ud)
338 fLastDigit->fUserData = ud;
349 if (fOwnIds && n < fDigitIds->GetSize() && fDigitIds->At(
n))
350 delete fDigitIds->
At(
n);
352 fDigitIds->AddAtAndExpand(
id,
n);
358void REveDigitSet::DigitUserData(
Int_t n,
void* ud)
360 GetDigit(
n)->fUserData = ud;
368 return fDigitIds ? fDigitIds->At(
n) : 0;
374void* REveDigitSet::GetUserData(
Int_t n)
const
376 return GetDigit(
n)->fUserData;
383void REveDigitSet::Paint(Option_t*)
392void REveDigitSet::DigitSelected(Int_t idx)
394 DigitBase_t *qb = GetDigit(idx);
395 TObject *obj = GetId(idx);
398 (fCallbackFoo)(this, idx, obj);
401 SecSelected(this, idx);
403 printf("REveDigitSet::DigitSelected idx=%d, value=%d, obj=0x%lx\n",
404 idx, qb->fValue, (ULong_t)obj);
414void REveDigitSet::SecSelected(REveDigitSet* qs, Int_t idx)
417 args[0] = (Long_t) qs;
418 args[1] = (Long_t) idx;
420 // Emit("SecSelected(REveDigitSet*, Int_t)", args);
429 if (fFrame ==
b)
return;
430 if (fFrame) fFrame->DecRefCount(
this);
433 fFrame->IncRefCount(
this);
435 SetMainColorPtr(fFrame->PtrFrameColor());
438 SetMainColorPtr(&fColor);
447 if (fPalette == p)
return;
448 if (fPalette) fPalette->DecRefCount();
462 if (!fValueIsColor) {
464 ScanMinMaxValues(min, max);
465 fPalette->SetLimits(min, max);
466 fPalette->SetMinMax(min, max);
477 Int_t ret = REveElement::WriteCoreJson(j, rnr_offset);
479 j[
"fSingleColor"] = fSingleColor;
480 j[
"fAntiFlick"] = GetAntiFlick();
481 j[
"fSecondarySelect"] = fAlwaysSecSelect;
Mother of all ROOT objects.
An array of references to TObjects.
TObject * At(Int_t idx) const
basic_json<> json
default JSON class