54 fItems[idx]->SetRnrSelf(visible);
112 j[
"items"] = nlohmann::json::array();
113 for (
auto & chld :
fItems)
116 i[
"fFiltered"] = chld->GetFiltered();
117 i[
"fRnrSelf"] = chld->GetRnrSelf();
118 i[
"fColor"] = chld->GetMainColor();
119 j[
"items"].push_back(i);
130 std::vector<int> ids;
132 for (
size_t i = 0; i <
fItems.size(); ++i ) {
155 if (secondary_idcs.empty()) {
160 int idx = *secondary_idcs.begin();
163 std::string
name = col->GetName();
164 auto li =
name.size();
165 if (li &&
name[li-1] ==
's')
171 for (
auto &z : secondary_idcs)
174 data = col->GetDataPtr(idx);
175 res +=
Form(
"%s %d",
name.c_str(), idx);
177 std::string eval = t.fTooltipFunction.EvalExpr(data);
178 res +=
Form(
"\n %s = %s", t.fTooltipTitle.c_str(), eval.c_str());
190 tt.fTooltipFunction.SetPrecision(2);
213 printf(
"REveDataItemList::DummyItemsCahngeDelegate not implemented\n");
222 printf(
"REveDataItemList::DummyFillImpliedSelectedDelegate not implemented\n");
233 std::string lname =
n +
"Items";
250 static const REveException eh(
"REveDataCollection::SetFilterExpr ");
252 if (!
fItemClass)
throw eh +
"item class has to be set before the filter expression.";
263 gROOT->ProcessLine(s.str().c_str());
267 catch (
const std::exception &exc)
269 std::cerr <<
"EveDataCollection::SetFilterExpr" << exc.what();
283 ii->SetFiltered( ! res );
285 ids.push_back(idx++);
298 void FillJSON(
TClass*
c, nlohmann::json & arr)
300 TString ctor =
c->GetName(), dtor =
"~";
302 int i = ctor.
Last(
':');
311 TIter next(
c->GetListOfMethods());
312 while ((meth = (
TMethod*) next()))
317 if (
m == ctor ||
m == dtor ||
318 m ==
"Class" ||
m ==
"Class_Name" ||
m ==
"Class_Version" ||
m ==
"Dictionary" ||
m ==
"IsA" ||
319 m ==
"DeclFileName" ||
m ==
"ImplFileName" ||
m ==
"DeclFileLine" ||
m ==
"ImplFileLine" ||
320 m ==
"Streamer" ||
m ==
"StreamerNVirtual" ||
m ==
"ShowMembers" ||
321 m ==
"CheckTObjectHashConsistency")
332 if ( ! ms.
IsNull()) ms +=
", ";
342 jm[
"c"] =
c->GetName();
347 TIter blnext(
c->GetListOfBases());
355 j[
"fPublicFunctions"] = nlohmann::json::array();
357 pm.FillJSON(
fItemClass, j[
"fPublicFunctions"]);
368 chld->SetMainColor(newv);
376 chld->SetMainColor(newv);
char * Form(const char *fmt,...)
void SetFilterExpr(const TString &filter)
TClass * GetItemClass() const
static Color_t fgDefaultColor
std::function< bool(void *)> fFilterFoo
void * GetDataPtr(Int_t i) const
void StreamPublicMethods(nlohmann::json &cj) const
REveDataItemList * fItemList
void AddItem(void *data_ptr, const std::string &n, const std::string &t)
Bool_t SetRnrState(Bool_t) override
Set render state of this element and of its children to the same value.
void SetMainColor(Color_t) override
Set main color of the element.
Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override
Write core json.
REveDataCollection(const std::string &n="REveDataCollection", const std::string &t="")
REveDataItemList(const std::string &n="Items", const std::string &t="")
void AddTooltipExpression(const std::string &title, const std::string &expr)
virtual void ItemChanged(REveDataItem *item)
Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override
Write core json.
FillImpliedSelectedFunc_t fHandlerFillImplied
void ProcessSelection(ElementId_t id, bool multi, bool secondary, const std::set< int > &in_secondary_idcs)
void FillImpliedSelectedSet(Set_t &impSelSet) override
Populate set impSelSet with derived / dependant elements.
void SetItemColorRGB(Int_t idx, UChar_t r, UChar_t g, UChar_t b)
Bool_t SetRnrState(Bool_t) override
Set render state of this element and of its children to the same value.
std::string GetHighlightTooltip(const std::set< int > &secondary_idcs) const override
std::vector< TTip > fTooltipExpressions
void SetItemsChangeDelegate(ItemsChangeFunc_t)
static void DummyFillImpliedSelected(REveDataItemList *, Set_t &impSelSet)
void SetFillImpliedSelectedDelegate(FillImpliedSelectedFunc_t)
std::vector< REveDataItem * > fItems
ItemsChangeFunc_t fHandlerItemsChange
static void DummyItemsChange(REveDataItemList *, const std::vector< int > &)
std::function< void(REveDataItemList *, Set_t &)> FillImpliedSelectedFunc_t
void SetItemVisible(Int_t idx, Bool_t visible)
std::function< void(REveDataItemList *, const std::vector< int > &)> ItemsChangeFunc_t
const std::string & GetName() const
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset)
Write core json.
void SetupDefaultColorAndTransparency(Color_t col, Bool_t can_edit_color, Bool_t can_edit_transparency)
Set up element to use built-in main color and set flags allowing editing of main color and transparen...
virtual void AddElement(REveElement *el)
Add el to the list of children.
virtual Bool_t SetRnrState(Bool_t rnr)
Set render state of this element and of its children to the same value.
std::set< REveElement * > Set_t
ElementId_t GetElementId() const
virtual void SetMainColor(Color_t color)
Set main color of the element.
virtual Color_t GetMainColor() const
REveException Exception-type thrown by Eve classes.
SelectionSet_t & RefSelectedSet()
REveSelection Container for selected and highlighted elements.
void NewElementPicked(ElementId_t id, bool multi, bool secondary, const std::set< int > &secondary_idcs={})
Each class (see TClass) has a linked list of its base class(es).
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
TClass instances represent classes, structs and namespaces in the ROOT type system.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
Each ROOT method (see TMethod) has a linked list of its arguments.
const char * GetTypeName() const
Get type of method argument, e.g.: "class TDirectory*" -> "TDirectory" Result needs to be used or cop...
Each ROOT class (see TClass) has a linked list of methods.
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();.
virtual const char * GetName() const
Returns name of object.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
const char * Data() const
Ssiz_t Last(char c) const
Find last occurrence of a character c.
R__EXTERN REveManager * gEve
std::string fTooltipTitle