19#include <nlohmann/json.hpp>
21using namespace::ROOT::Experimental;
150 for (
Int_t i = 0; i <
N; ++i)
178 fFrame->SetFrameColor(color);
188void REveDigitSet::UnSelected()
190 fSelectedSet.clear();
191 REveElement::UnSelected();
198void REveDigitSet::UnHighlighted()
200 fHighlightedSet.clear();
201 REveElement::UnHighlighted();
259 if (
v < min) min =
v;
260 if (
v > max) max =
v;
310 x[0] =
r;
x[1] =
g;
x[2] =
b;
x[3] =
a;
319 x[0] = rgba[0];
x[1] = rgba[1];
x[2] = rgba[2];
x[3] = rgba[3];
356void REveDigitSet::Paint(Option_t*)
365void REveDigitSet::DigitSelected(Int_t idx)
367 DigitBase_t *qb = GetDigit(idx);
368 TObject *obj = GetId(idx);
371 (fCallbackFoo)(this, idx, obj);
374 SecSelected(this, idx);
376 printf("REveDigitSet::DigitSelected idx=%d, value=%d, obj=0x%lx\n",
377 idx, qb->fValue, (ULong_t)obj);
387void REveDigitSet::SecSelected(REveDigitSet* qs, Int_t idx)
390 args[0] = (Longptr_t) qs;
391 args[1] = (Longptr_t) idx;
393 // Emit("SecSelected(REveDigitSet*, Int_t)", args);
406 fFrame->IncRefCount(
this);
460 return d->fValue ? true :
false;
468 else if (
d->fValue >=
fPalette->GetMaxVal())
477 printf(
"Error REveDigitSet::IsDigitVisible() unhadled case\n");
494 if (shapeIdx == iShapeIdx)
503 printf(
"REveDigitSet::GetAtomIdxFromShapeIdx Error locating atom idx from shape idx %d\n", iShapeIdx);
518 if (atomIdx == iAtomIdx) {
528 printf(
"REveDigitSet::GetShapeIdxFromAtomIdx:: Atom with idx %d does not have a visible shape \n", iAtomIdx);
540 if (
gDebug) printf(
"REveDigitSet::NewShapePicked elementId %d shape ID = %d, atom ID = %d, value = %d\n",
GetElementId(), shapeIdx, digitId, digit->fValue);
543 std::set<int> sset = {digitId};
553 j[
"shape_idcs"] = nlohmann::json::array();
554 for (
auto &i : secondary_idcs) {
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
char Char_t
Character 1 byte (char).
short Color_t
Color number (short).
void SetMainColor(Color_t color) override
Override from REveElement, forward to Frame.
void DigitId(TObject *id)
Set external object reference for the last digit added.
void NewShapePicked(int shapeId, Int_t selectionId, bool multi)
~REveDigitSet() override
Destructor.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
REveDigitSet(const REveDigitSet &)
void SetPalette(REveRGBAPalette *p)
Set REveRGBAPalette pointer.
void FillExtraSelectionData(nlohmann::json &j, const std::set< int > &secondary_idcs) const override
REveRGBAPalette * AssertPalette()
Make sure the REveRGBAPalette pointer is not null.
DigitBase_t * NewDigit()
Protected method called whenever a new digit is added.
void DigitColor(Color_t ci)
Set color for the last digit added.
void SetCurrentDigit(Int_t idx)
Set current digit – the one that will receive calls to DigitValue/Color/Id/UserData() functions.
int GetAtomIdxFromShapeIdx(int) const
Utility function for maping digit idx with visible shape idx.
bool IsDigitVisible(const DigitBase_t *) const
Utility function for maping digit idx with visible shape idx.
std::string GetHighlightTooltip(const std::set< int > &secondary_idcs) const override
Return tooltip for highlighted element if always-sec-select is set.
void ScanMinMaxValues(Int_t &min, Int_t &max)
Iterate over the digits and determine min and max signal values.
void UseSingleColor()
Instruct digit-set to use single color for its digits.
Bool_t fDetIdsAsSecondaryIndices
void RefitPlex()
Instruct underlying memory allocator to regroup itself into a contiguous memory chunk.
Bool_t GetAntiFlick() const
DigitBase_t * GetDigit(Int_t n) const
REveRGBAPalette * fPalette
Int_t fLastIdx
! The last / current idx added to collection.
void ReleaseIds()
Protected method.
DigitBase_t * fLastDigit
! The last / current digit added to collection.
ERenderMode_e fRenderMode
int GetShapeIdxFromAtomIdx(int) const
Utility function for maping shape idx to digit idx.
void DigitValue(Int_t value)
Set signal value for the last digit added.
void SetFrame(REveFrameBox *b)
Set REveFrameBox pointer.
TooltipCB_foo fTooltipCBFoo
! Function providing highlight tooltips when always-sec-select is active.
TObject * GetId(Int_t n) const
Set external object reference for digit n.
Callback_foo fCallbackFoo
! Additional function to call on secondary-select.
void SetMainColorPtr(Color_t *colptr)
Bool_t fCanEditMainTransparency
virtual std::string GetHighlightTooltip(const std::set< int > &) const
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset)
Write core json.
const char * GetCName() const
virtual void InitMainTrans(Bool_t can_edit=kTRUE)
Initialize the main transformation to identity matrix.
ElementId_t GetElementId() const
virtual void SetMainColor(Color_t color)
Set main color of the element.
REveElement(const std::string &name="", const std::string &title="")
Default constructor.
SelectionSet_t & RefSelectedSet()
Bool_t GetAlwaysSecSelect() const
REveSelection Container for selected and highlighted elements.
void NewElementPicked(ElementId_t id, bool multi, bool secondary, const std::set< int > &secondary_idcs={})
Called from GUI when user picks or un-picks an element.
static void ColorFromIdx(Color_t ci, UChar_t col[4], Bool_t alpha=kTRUE)
Fill col with RGBA values corresponding to index ci.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
An array of references to TObjects.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.