/************************************************************************* * Copyright (C) 1995-2020, 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 "TObject.h" #include #include using namespace ROOT::Experimental::Browsable; /** Provider for drawing of ROOT7 classes */ class TObjectDraw7Provider : public RProvider { public: TObjectDraw7Provider() { RegisterDraw7(nullptr, [] (std::shared_ptr &subpad, std::unique_ptr &obj, const std::string &opt) -> bool { // here clear ownership is required // If it possible, TObject will be cloned by TObjectHolder auto tobj = obj->get_shared(); if (!tobj) return false; if (subpad->NumPrimitives() > 0) { subpad->Wipe(); subpad->GetCanvas()->Modified(); subpad->GetCanvas()->Update(true); } subpad->Draw(tobj, opt); return true; }); } } newTObjectDraw7Provider;