/// \file RDrawableRHist.cxx /// \ingroup rbrowser /// \author Bertrand Bellenot /// \author Sergey Linev /// \date 2019-10-17 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback /// is welcome! /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #include #include #include using namespace ROOT::Experimental::Browsable; class RV7HistDrawProvider : public RProvider { template void RegisterHistClass() { RegisterDraw7(TClass::GetClass(), [] (std::shared_ptr &subpad, std::unique_ptr &obj, const std::string &) -> bool { auto hist = obj->get_shared(); if (!hist) return false; if (subpad->NumPrimitives() > 0) { subpad->Wipe(); subpad->GetCanvas()->Modified(); subpad->GetCanvas()->Update(true); } subpad->Draw(hist); return true; }); } public: RV7HistDrawProvider() { RegisterHistClass(); RegisterHistClass(); RegisterHistClass(); } } newRV7HistDrawProvider;