28 static std::vector<std::shared_ptr<ROOT::Experimental::TCanvas>> &GetHeldCanvases()
30 static std::vector<std::shared_ptr<ROOT::Experimental::TCanvas>> sCanvases;
37 return GetHeldCanvases();
65 auto pCanvas = std::make_shared<TCanvas>();
66 pCanvas->SetTitle(title);
67 GetHeldCanvases().emplace_back(pCanvas);
93 bool batch_mode =
gROOT->IsBatch();
117 if (filename.find(
".svg") != std::string::npos)
118 fPainter->DoWhenReady(
"SVG", filename, async, callback);
119 else if (filename.find(
".png") != std::string::npos)
120 fPainter->DoWhenReady(
"PNG", filename, async, callback);
121 else if ((filename.find(
".jpg") != std::string::npos) || (filename.find(
".jpeg") != std::string::npos))
122 fPainter->DoWhenReady(
"JPEG", filename, async, callback);
uint64_t fModified
Modify counter, incremented every time canvas is changed.
std::unique_ptr< Internal::TVirtualCanvasPainter > fPainter
The painter of this canvas, bootstrapping the graphics connection.
void Update(bool async=false, CanvasCallback_t callback=nullptr)
update drawing
static std::unique_ptr< TVirtualCanvasPainter > Create(const TCanvas &canv, bool batch_mode=false)
Loads the plugin that implements this class.
void Hide()
Close all canvas displays.
void SaveAs(const std::string &filename, bool async=false, CanvasCallback_t callback=nullptr)
Save canvas in image file.
std::function< void(bool)> CanvasCallback_t
void Show(const std::string &where="")
Display the canvas.
static std::shared_ptr< TCanvas > Create(const std::string &title)
static const std::vector< std::shared_ptr< TCanvas > > & GetCanvases()