Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleDraw7Provider.cxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2021, 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 "TClass.h"
10
11#include <ROOT/RCanvas.hxx>
13
14#include "RFieldProvider.hxx"
15
16using namespace ROOT::Browsable;
17
18// ==============================================================================================
19
20/** \class RNTupleDraw7Provider
21\ingroup rbrowser
22\brief Provider for RNTuple drawing on RCanvas
23\author Sergey Linev <S.Linev@gsi.de>
24\date 2021-03-09
25\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
26*/
27
29
30public:
31
33 {
34 RegisterDraw7(TClass::GetClass<ROOT::RNTuple>(),
35 [this](std::shared_ptr<ROOT::Experimental::RPadBase> &subpad, std::unique_ptr<RHolder> &obj,
36 const std::string &opt) -> bool {
37 auto h1 = DrawField(dynamic_cast<RFieldHolder *>(obj.get()));
38 if (!h1)
39 return false;
40
41 std::shared_ptr<TH1> shared;
42 shared.reset(h1);
43
44 subpad->Draw<ROOT::Experimental::TObjectDrawable>(shared, opt);
45 subpad->GetCanvas()->Update(true);
46 return true;
47 });
48 }
49
51
RNTupleDraw7Provider newRNTupleDraw7Provider
Base class for provider of RNTuple drawing.
TH1 * DrawField(RFieldHolder *holder)
Provider for RNTuple drawing on RCanvas.
void RegisterDraw7(const TClass *cl, Draw7Func_t func)
Provides v7 drawing facilities for TObject types (TGraph, TH1, TH2, etc).
TH1F * h1
Definition legend1.C:5