Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TObjectDraw7Provider.cxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2020, 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
10
11#include "TObject.h"
12#include <ROOT/RCanvas.hxx>
14
15using namespace ROOT::Experimental::Browsable;
16
17/** Provider for drawing of ROOT7 classes */
18
20public:
22 {
23 RegisterDraw7(nullptr, [] (std::shared_ptr<ROOT::Experimental::RPadBase> &subpad, std::unique_ptr<RHolder> &obj, const std::string &opt) -> bool {
24 // here clear ownership is required
25 // If it possible, TObject will be cloned by TObjectHolder
26 auto tobj = obj->get_shared<TObject>();
27 if (!tobj) return false;
28
29 subpad->Draw<ROOT::Experimental::TObjectDrawable>(tobj, opt);
30 subpad->GetCanvas()->Update(true);
31 return true;
32 });
33
34 }
35
TObjectDraw7Provider newTObjectDraw7Provider
Provider of different browsing methods for supported classes.
Definition RProvider.hxx:36
void RegisterDraw7(const TClass *cl, Draw7Func_t func)
Provides v7 drawing facilities for TObject types (TGraph, TH1, TH2, etc).
Provider for drawing of ROOT7 classes.
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:274