ROOT  6.06/09
Reference Guide
TCanvas.cxx
Go to the documentation of this file.
1 /// \file TCanvas.cxx
2 /// \ingroup Gpad ROOT7
3 /// \author Axel Naumann <axel@cern.ch>
4 /// \date 2015-07-10
5 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
6 
7 
8 /*************************************************************************
9  * Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
10  * All rights reserved. *
11  * *
12  * For the licensing terms see $ROOTSYS/LICENSE. *
13  * For the list of contributors see $ROOTSYS/README/CREDITS. *
14  *************************************************************************/
15 
16 #include "ROOT/TCanvas.h"
17 
18 #include "ROOT/TDrawable.h"
19 
21  for (auto&& drw: fPrimitives) {
22  drw->Paint();
23  }
24 }
25 
26 namespace {
27 static
28 std::vector<ROOT::TCoopPtr<ROOT::TCanvas>>& GetHeldCanvases() {
29  static std::vector<ROOT::TCoopPtr<ROOT::TCanvas>> sCanvases;
30  return sCanvases;
31 }
32 };
33 
34 const std::vector<ROOT::TCoopPtr<ROOT::TCanvas>> &
36  return GetHeldCanvases();
37 }
38 
41  // TODO: name registration (TDirectory?)
42  auto pCanvas = TCoopPtr<TCanvas>(new TCanvas());
43  GetHeldCanvases().emplace_back(pCanvas);
44  return pCanvas;
45 }
void Paint()
Definition: TCanvas.cxx:20
static TCoopPtr< TCanvas > Create()
static const std::vector< TCoopPtr< TCanvas > > & GetCanvases()
Definition: TCanvas.cxx:35
std::vector< std::unique_ptr< Internal::TDrawable > > fPrimitives
Definition: TCanvas.h:31
basic_string_view< char > string_view
#define name(a, b)
Definition: linkTestLib0.cpp:5
Graphic container for TDrawable-s.
Definition: TCanvas.h:30
Several pointers point to the same object, any of them can delete the object, setting all of them to ...
Definition: TCoopPtr.h:46