/// \file TCanvas.h /// \ingroup Gpad ROOT7 /// \author Axel Naumann /// \date 2015-07-08 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! /************************************************************************* * Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT7_TCanvas #define ROOT7_TCanvas #include #include #include "ROOT/TCoopPtr.h" #include "ROOT/TDrawable.h" namespace ROOT { /** \class TCanvas Graphic container for `TDrawable`-s. */ class TCanvas { std::vector> fPrimitives; /// We need to keep track of canvases; please use Create() TCanvas() = default; public: static TCoopPtr Create(); static TCoopPtr Create(std::experimental::string_view name); /// Add a something to be painted. The pad claims shared ownership. template void Draw(TCoopPtr what) { // Requires GetDrawable(what, options) to be known! fPrimitives.emplace_back(GetDrawable(what)); } /// Add a something to be painted, with options. The pad claims shared ownership. template void Draw(TCoopPtr what, const OPTIONS& options) { // Requires GetDrawable(what, options) to be known! fPrimitives.emplace_back(GetDrawable(what, options)); } void Paint(); static const std::vector>& GetCanvases(); }; } #endif