28 std::vector<std::shared_ptr<ROOT::Experimental::TCanvas>>& GetHeldCanvases() {
29 static std::vector<std::shared_ptr<ROOT::Experimental::TCanvas>> sCanvases;
36 namespace Experimental {
39 class TV5CanvasAdaptor:
public TObject {
58 if (
gROOT &&
gROOT->GetListOfCanvases() && !
gROOT->GetListOfCanvases()->IsEmpty())
70 const std::vector<std::shared_ptr<ROOT::Experimental::TCanvas>> &
72 return GetHeldCanvases();
77 fAdaptor = std::make_unique<Internal::TV5CanvasAdaptor>(*this);
83 for (
auto&& drw: fPrimitives) {
88 std::shared_ptr<ROOT::Experimental::TCanvas>
90 auto pCanvas = std::make_shared<TCanvas>();
91 pCanvas->SetTitle(title);
92 GetHeldCanvases().emplace_back(pCanvas);
Namespace for new ROOT classes and functions.
void SetTitle(const char *title="")
Set canvas title.
Graphic container for TDrawable-s.
const std::string & GetTitle() const
Get the canvas's title.
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from a pad and its sub-pads.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
TCanvas()
Create a temporary TCanvas; for long-lived ones please use Create().
~TCanvas()
Default destructor.
Mother of all ROOT objects.
static std::shared_ptr< TCanvas > Create(const std::string &title)
void Paint()
Remove an object from the list of primitives.
static const std::vector< std::shared_ptr< TCanvas > > & GetCanvases()