24using namespace std::string_literals;
29 std::unique_ptr<Browsable::RHolder>
fObject;
45 std::string
GetKind()
const override {
return "tree"s; }
49 bool DrawElement(std::shared_ptr<Browsable::RElement> &elem,
const std::string & =
"")
override
54 auto obj = elem->GetObject();
58 auto tree = obj->Get<
TTree>();
68 TTree *new_tree =
nullptr;
69 std::string expr = elem->GetContent(
"tree");
71 auto branch = obj->Get<
TBranch>();
72 auto leaf = obj->Get<
TLeaf>();
78 expr = branch->GetFullName().Data();
80 new_tree = leaf->GetBranch()->
GetTree();
83 }
else if (browsable) {
89 if (!new_tree || expr.empty())
92 if (new_tree != tree) {
93 fObject = std::make_unique<Browsable::TObjectHolder>(new_tree);
109 std::shared_ptr<RBrowserWidget>
Create(
const std::string &
name)
final
111 return std::make_shared<RBrowserTreeWidget>(
name);
std::shared_ptr< RBrowserWidget > Create(const std::string &name) final
~RBrowserTreeProvider() override=default
@ kActTree
can be shown in tree viewer
bool ActivateWidget(const std::string &title, const std::string &kind="")
Activate widget in RBrowser One should specify title and (optionally) kind of widget like "tcanvas" o...
Web-based ROOT TTree viewer.
std::shared_ptr< ROOT::RWebWindow > GetWindow()
void SetTree(TTree *tree)
assign new TTree to the viewer
bool SuggestExpression(const std::string &expr)
Suggest to use expression in the gui Normally just assign as last edited expression.
void SetCallback(PerformDrawCallback_t func)
void SetTitle(const std::string &title)
void SetShowHierarchy(bool on=true)
Configures default hierarchy browser visibility, only has effect before showing web window.
A TTree is a list of TBranches.
virtual TString GetFullName() const
Return the 'full' name of the branch.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
TBranch * GetBranch() const
const char * GetName() const override
Returns name of object.
const char * Data() const
A TTree represents a columnar dataset.
virtual TTree * GetTree() const
TVirtualBranchBrowsable is a base class (not really abstract, but useless by itself) for helper objec...