Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RHistDraw7Provider.cxx
Go to the documentation of this file.
1/// \file RHistDraw7Provider.cxx
2/// \ingroup rbrowser
3/// \author Bertrand Bellenot <bertrand.bellenot@cern.ch>
4/// \author Sergey Linev <S.Linev@gsi.de>
5/// \date 2019-10-17
6/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
7/// is welcome!
8
9/*************************************************************************
10 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
11 * All rights reserved. *
12 * *
13 * For the licensing terms see $ROOTSYS/LICENSE. *
14 * For the list of contributors see $ROOTSYS/README/CREDITS. *
15 *************************************************************************/
16
19
20#include <ROOT/RCanvas.hxx>
21
22using namespace ROOT::Experimental::Browsable;
23
25 template<class HistClass>
27 {
28 RegisterDraw7(TClass::GetClass<HistClass>(), [] (std::shared_ptr<ROOT::Experimental::RPadBase> &subpad, std::unique_ptr<RHolder> &obj, const std::string &) -> bool {
29 auto hist = obj->get_shared<HistClass>();
30 if (!hist) return false;
31
32 if (subpad->NumPrimitives() > 0) {
33 subpad->Wipe();
34 subpad->GetCanvas()->Modified();
35 subpad->GetCanvas()->Update(true);
36 }
37
38 subpad->Draw(hist);
39
40 return true;
41 });
42 }
43
44public:
45
47 {
48 RegisterHistClass<ROOT::Experimental::RH1D>();
49 RegisterHistClass<ROOT::Experimental::RH2D>();
50 RegisterHistClass<ROOT::Experimental::RH3D>();
51 }
52
RV7HistDrawProvider newRV7HistDrawProvider
Provider of different browsing methods for supported classes.
Definition RProvider.hxx:36
void RegisterDraw7(const TClass *cl, Draw7Func_t func)