Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TLeafDraw6Provider.cxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#include "TLeafProvider.hxx"
10
11#include "TVirtualPad.h"
12
13/** Provider for drawing of ROOT6 classes */
14
16public:
17
18 bool AddHist(TVirtualPad *pad, TH1 *hist, const std::string &opt)
19 {
20 if (!hist)
21 return false;
22
23 pad->Add(hist, opt.c_str());
24
25 return true;
26 }
27
29 {
30 RegisterDraw6(TLeaf::Class(), [this](TVirtualPad *pad, std::unique_ptr<RHolder> &obj, const std::string &opt) -> bool {
31 return AddHist(pad, DrawLeaf(obj), opt);
32 });
33
34 RegisterDraw6(TBranchElement::Class(), [this](TVirtualPad *pad, std::unique_ptr<RHolder> &obj, const std::string &opt) -> bool {
35 return AddHist(pad, DrawBranchElement(obj), opt);
36 });
37
38 RegisterDraw6(TBranch::Class(), [this](TVirtualPad *pad, std::unique_ptr<RHolder> &obj, const std::string &opt) -> bool {
39 return AddHist(pad, DrawBranch(obj), opt);
40 });
41
42 RegisterDraw6(TVirtualBranchBrowsable::Class(), [this](TVirtualPad *pad, std::unique_ptr<RHolder> &obj, const std::string &opt) -> bool {
43 return AddHist(pad, DrawBranchBrowsable(obj), opt);
44 });
45 }
46
48
TLeafDraw6Provider newTLeafDraw6Provider
void RegisterDraw6(const TClass *cl, Draw6Func_t func)
static TClass * Class()
static TClass * Class()
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
Provider for drawing of ROOT6 classes.
bool AddHist(TVirtualPad *pad, TH1 *hist, const std::string &opt)
Provider for drawing of branches / leafs in the TTree.
TH1 * DrawBranch(const TBranch *tbranch)
TH1 * DrawBranchBrowsable(std::unique_ptr< RHolder > &obj)
TH1 * DrawBranchElement(std::unique_ptr< RHolder > &obj)
TH1 * DrawLeaf(std::unique_ptr< RHolder > &obj)
static TClass * Class()
static TClass * Class()
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual void Add(TObject *obj, Option_t *opt="", Bool_t modified=kTRUE)=0