Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleDraw6Provider.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 "TVirtualPad.h"
10#include "TClass.h"
11
12#include "RFieldProvider.hxx"
13
14
15// ==============================================================================================
16
17/** \class RNTupleDraw6Provider
18\ingroup rbrowser
19\brief Provider for RNTuple drawing on TCanvas
20\author Sergey Linev <S.Linev@gsi.de>
21\date 2021-03-09
22\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
23*/
24
26
27public:
28
30 {
31 RegisterDraw6(TClass::GetClass<ROOT::Experimental::RNTuple>(), [this](TVirtualPad *pad, std::unique_ptr<RHolder> &obj, const std::string &opt) -> bool {
32
33 auto h1 = DrawField(dynamic_cast<RFieldHolder*> (obj.get()));
34 if (!h1) return false;
35
36 pad->GetListOfPrimitives()->Clear();
37
38 pad->GetListOfPrimitives()->Add(h1, opt.c_str());
39
40 return true;
41 });
42
43
44 }
45
47
RNTupleDraw6Provider newRNTupleDraw6Provider
Base class for provider of RNTuple drawing.
TH1 * DrawField(RFieldHolder *holder)
Provider for RNTuple drawing on TCanvas.
void RegisterDraw6(const TClass *cl, Draw6Func_t func)
virtual void Add(TObject *obj)
Definition TList.h:81
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition TList.cxx:402
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual TList * GetListOfPrimitives() const =0
TH1F * h1
Definition legend1.C:5