55 bool SendInfoUser(
const char * =
nullptr)
override {
return false; }
60 bool =
false)
override
102using namespace std::string_literals;
111 fWebWindow->SetDefaultPage(
"file:rootui5sys/tree/index.html");
122 fTimer = std::make_unique<RTreeDrawInvokeTimer>(10,
true, *
this);
161 const TTree *tree = branch ? branch->
GetTree() :
nullptr;
163 if (!tree || (
fTree != tree))
166 if ((
const_cast<TBranch *
>(branch)->GetListOfBranches()->GetLast() < 0) && (branch->
GetNleaves() == 1)) {
167 std::string brname = branch->
GetName();
183 const TTree *tree = branch ? branch->
GetTree() :
nullptr;
185 if (!tree || (
fTree != tree))
199 if (!
fTree || expr.empty())
216 std::string user_args =
"";
223 if ((
fWebWindow->NumConnections(
true) == 0) || always_start_new_browser)
278 if (arg ==
"GETCFG"s) {
282 }
else if (arg ==
"QUIT_ROOT"s) {
286 }
if (arg.compare(0, 5,
"DRAW:"s) == 0) {
290 auto newcfg = TBufferJSON::FromJSON<RConfig>(arg.substr(5));
304 std::string res =
name;
306 std::string from =
"/";
307 std::string to =
"\\/";
309 size_t start_pos = 0;
310 while((start_pos = res.find(from, start_pos)) != std::string::npos) {
311 res.replace(start_pos, from.length(), to);
312 start_pos += to.length();
323 if (!branches || (branches->
GetLast() < 0))
326 TIter iter(branches);
328 while (
auto br =
dynamic_cast<TBranch *
>(iter())) {
330 auto leaves = br->GetListOfLeaves();
332 auto subbr = br->GetListOfBranches();
334 std::string brname = br->GetName();
336 TLeaf *leaf0 = (leaves->GetLast() == 0) ?
dynamic_cast<TLeaf *
>(leaves->At(0)) :
nullptr;
342 if ((subbr->GetLast() < 0) && leaf0 && (brname == leaf0->
GetName())) {
345 if (brelem && (brelem->GetStreamerType() < 1 || brelem->GetStreamerType() > 59))
353 while (
auto leaf =
dynamic_cast<TLeaf *
>(liter())) {
355 std::string leaffullname = leaf->GetFullName().Data();
358 if (brelem && brelem->GetStreamerType() ==
TStreamerInfo::kSTL && (leaves->GetLast() == 0) && (leaffullname == brfullname +
"_"))
426 std::string canv_name;
429 if ((expr.find(
'\\') != std::string::npos) || (expr.find(
'#') != std::string::npos)) {
430 auto FixTitle = [](
TNamed *obj) {
432 TString title = obj->GetTitle();
435 obj->SetTitle(title.
Data());
438 while (
auto obj = iter()) {
439 if (expr == obj->GetTitle()) {
440 FixTitle(
dynamic_cast<TNamed *
> (obj));
441 TH1 *hist =
dynamic_cast<TH1 *
> (obj);
452 canv_name =
gPad->GetName();
465 std::string progress =
"100";
476 Double_t p = nevent / ( last - first + 0. ) * 100.;
477 if (
p > 100)
p = 100;
478 progress = std::to_string(
p);
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char mode
R__EXTERN TSystem * gSystem
R__EXTERN TVirtualMonitoringWriter * gMonitoringWriter
void Timeout() override
timeout handler used to process postponed requests in main ROOT thread
RTreeDrawInvokeTimer(Long_t milliSec, bool mode, RTreeViewer &viewer)
constructor
RTreeDrawMonitoring(Int_t period, RTreeViewer &viewer)
long long fLastProgressSendTm
RTreeDrawMonitoring & operator=(const RTreeDrawMonitoring &)=delete
bool SendFileReadProgress(TFile *) override
RTreeDrawMonitoring(const RTreeDrawMonitoring &)=delete
bool SendInfoUser(const char *=nullptr) override
void SetLogLevel(const char *="WARNING") override
bool SendParameters(TList *, const char *=nullptr) override
bool SendFileOpenProgress(TFile *, TList *, const char *, bool=false) override
bool SendProcessingStatus(const char *, bool=false) override
bool SendProcessingProgress(Double_t nevent, Double_t, bool=false) override
bool SendFileWriteProgress(TFile *) override
void Verbose(bool) override
bool SendInfoDescription(const char *) override
bool SendFileCloseEvent(TFile *) override
bool SendInfoStatus(const char *) override
bool SendInfoTime() override
std::unique_ptr< RTreeDrawInvokeTimer > fTimer
! timer to invoke tree draw
void Show(const RWebDisplayArgs &args="", bool always_start_new_browser=false)
Show or update viewer in web window If web browser already started - just refresh drawing like "reloa...
void SendProgress(Double_t nevent=0.)
Send progress to the client.
void UpdateConfig()
Update RConfig data.
std::string FormatItemName(const std::string &name)
Format item name used in draw expression.
void InvokeTreeDraw()
Invoke tree drawing.
bool SuggestLeaf(const TLeaf *leaf)
Suggest to use leaf in the gui Normally just assign as last edited expression.
void SetTree(TTree *tree)
assign new TTree to the viewer
std::string GetWindowAddr() const
Return address of web window used for tree viewer.
std::string GetWindowUrl(bool remote)
Return URL of web window used for tree viewer See ROOT::RWebWindow::GetUrl docu for more details.
std::string fLastSendProgress
! last send progress to client
PerformDrawCallback_t fCallback
! callback invoked when tree draw performed
void Update()
Update tree viewer in all web displays.
std::shared_ptr< ROOT::RWebWindow > fWebWindow
! web window
static RTreeViewer * NewViewer(TTree *)
Create new viewer Method used for plugin.
void SendCfg(unsigned connid)
Send data for initialize viewer.
bool SuggestExpression(const std::string &expr)
Suggest to use expression in the gui Normally just assign as last edited expression.
virtual ~RTreeViewer()
destructor
void WebWindowConnect(unsigned connid)
react on new connection
bool GetShowHierarchy() const
Returns default hierarchy browser visibility.
TTree * fTree
! TTree to show
void AddBranches(TObjArray *branches)
Add branches to config.
void WebWindowCallback(unsigned connid, const std::string &arg)
receive data from client
RConfig fCfg
! configuration, exchanged between client and server
RTreeViewer(TTree *tree=nullptr)
constructor
bool SuggestBranch(const TBranch *branch)
Suggest to use branch in the gui Normally just assign as last edited expression.
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
const std::string & GetWidgetKind() const
returns widget kind
static std::shared_ptr< RWebWindow > Create()
Create new RWebWindow Using default RWebWindowsManager.
A Branch for the case of an object.
TString GetFullName() const override
Return the 'full' name of the branch.
A TTree is a list of TBranches.
virtual TString GetFullName() const
Return the 'full' name of the branch.
static TString ToJSON(const T *obj, Int_t compact=0, const char *member_name=nullptr)
@ kSkipTypeInfo
do not store typenames in JSON
@ kNoSpaces
no new lines plus remove all spaces around "," and ":" symbols
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
TH1 is the base class of all histogram classes in ROOT.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual const char * GetTypeName() const
TBranch * GetBranch() const
virtual TString GetFullName() const
Return the full name (including the parent's branch names) of the leaf.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Int_t GetLast() const override
Return index of last object in array.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Handles synchronous and a-synchronous timer events.
A TTree represents a columnar dataset.
void Draw(Option_t *opt) override
Default Draw method for all objects.
virtual Long64_t GetEntries() const
virtual TObjArray * GetListOfBranches()
static constexpr Long64_t kMaxEntries
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
std::vector< RBranchInfo > fBranches