19#include <nlohmann/json.hpp>
21using namespace::ROOT::Experimental;
86REveDigitSet::REveDigitSet(
const char*
n,
const char* t) :
93 fDetIdsAsSecondaryIndices (
kFALSE),
101 fRenderMode (kRM_AsIs),
104 fDisableLighting(
kTRUE),
105 fHistoButtons (
kTRUE),
150 for (
Int_t i = 0; i <
N; ++i)
187void REveDigitSet::UnSelected()
189 fSelectedSet.clear();
190 REveElement::UnSelected();
197void REveDigitSet::UnHighlighted()
199 fHighlightedSet.clear();
200 REveElement::UnHighlighted();
258 if (
v < min) min =
v;
259 if (
v > max) max =
v;
309 x[0] =
r;
x[1] =
g;
x[2] =
b;
x[3] =
a;
318 x[0] = rgba[0];
x[1] = rgba[1];
x[2] = rgba[2];
x[3] = rgba[3];
355void REveDigitSet::Paint(Option_t*)
364void REveDigitSet::DigitSelected(Int_t idx)
366 DigitBase_t *qb = GetDigit(idx);
367 TObject *obj = GetId(idx);
370 (fCallbackFoo)(this, idx, obj);
373 SecSelected(this, idx);
375 printf("REveDigitSet::DigitSelected idx=%d, value=%d, obj=0x%lx\n",
376 idx, qb->fValue, (ULong_t)obj);
386void REveDigitSet::SecSelected(REveDigitSet* qs, Int_t idx)
389 args[0] = (Longptr_t) qs;
390 args[1] = (Longptr_t) idx;
392 // Emit("SecSelected(REveDigitSet*, Int_t)", args);
451 return d->fValue ? true :
false;
456 printf(
"Error REveDigitSet::IsDigitVisible() unhadled case\n");
473 if (shapeIdx == iShapeIdx)
482 printf(
"REveDigitSet::GetAtomIdxFromShapeIdx Error locating atom idx from shape idx %d\n", iShapeIdx);
497 if (atomIdx == iAtomIdx) {
507 printf(
"REveDigitSet::GetShapeIdxFromAtomIdx:: Atom with idx %d does not have a visible shape \n", iAtomIdx);
519 if (
gDebug) printf(
"REveDigitSet::NewShapePicked elementId %d shape ID = %d, atom ID = %d, value = %d\n",
GetElementId(), shapeIdx, digitId, digit->fValue);
522 std::set<int> sset = {digitId};
532 j[
"shape_idcs"] = nlohmann::json::array();
533 for (
auto &i : secondary_idcs) {
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
void Refit()
Refit the container so that all current data fits into a single chunk.
Int_t NAtoms(Int_t chk) const
Char_t * Chunk(Int_t chk) const
virtual 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)
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
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.
Color_t fColor
The last / current idx added to collection.
DigitBase_t * NewDigit()
Function providing highlight tooltips when always-sec-select is active.
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
virtual ~REveDigitSet()
Destructor.
DigitBase_t * GetDigit(Int_t n) const
REveRGBAPalette * fPalette
Int_t fLastIdx
The last / current digit added to collection.
void ReleaseIds()
Protected method.
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
Additional function to call on secondary-select.
TObject * GetId(Int_t n) const
Set external object reference for digit n.
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.
void SetFrameColor(Color_t ci)
Set color of the frame.
Color_t * PtrFrameColor()
REveElement * FindElementById(ElementId_t id) const
Lookup ElementId in element map and return corresponding REveElement*.
void SetMinMax(Int_t min, Int_t max)
Set current min/max values.
void SetLimits(Int_t low, Int_t high)
Set low/high limits on signal value.
virtual void IncRefCount(REveElement *re)
Increase reference count and add re to the list of back-references.
virtual void DecRefCount(REveElement *re)
Decrease reference count and remove re from the list of back-references.
virtual void StampBackPtrElements(UChar_t stamps)
Add given stamps to elements in the list of reverse references.
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.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
An array of references to TObjects.
TObject * At(Int_t idx) const override
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
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.
R__EXTERN REveManager * gEve