18 #include <experimental/string_view>
26 namespace Experimental {
29 class TCanvasSharedPtrMaker;
30 class TV5CanvasAdaptor;
40 using Primitives_t = std::vector<std::unique_ptr<Internal::TDrawable>>;
50 std::unique_ptr<Internal::TV5CanvasAdaptor>
fAdaptor;
59 static std::shared_ptr<TCanvas>
Create(
const std::string& title);
73 void Draw(
const std::shared_ptr<T>& what) {
80 template<
class T,
class OPTIONS>
81 void Draw(
const std::shared_ptr<T>& what,
const OPTIONS &options) {
88 void Draw(std::unique_ptr<T>&& what) {
94 template<
class T,
class OPTIONS>
95 void Draw(std::unique_ptr<T>&& what,
const OPTIONS &options) {
108 template<
class T,
class OPTIONS>
109 void Draw(
const T& what,
const OPTIONS &options) {
130 static const std::vector<std::shared_ptr<TCanvas>> &
GetCanvases();
void Draw(const std::shared_ptr< T > &what, const OPTIONS &options)
Add something to be painted, with options.
void Draw(const std::shared_ptr< T > &what)
Add something to be painted.
void Draw(std::unique_ptr< T > &&what, const OPTIONS &options)
Add something to be painted, with options. The pad claims ownership.
std::string fTitle
Title of the canvas.
Graphic container for TDrawable-s.
TCanvas & operator=(const TCanvas &)=delete
Disable assignment for now.
std::vector< std::unique_ptr< Internal::TDrawable >> Primitives_t
TCanvas()
Create a temporary TCanvas; for long-lived ones please use Create().
std::unique_ptr< Internal::TV5CanvasAdaptor > fAdaptor
Adaptor for painting an old canvas.
Primitives_t fPrimitives
Content of the pad.
void Draw(const T &what)
Add a copy of something to be painted.
~TCanvas()
Default destructor.
void Draw(std::unique_ptr< T > &&what)
Add something to be painted. The pad claims ownership.
void Draw(const T &what, const OPTIONS &options)
Add a copy of something to be painted, with options.
std::unique_ptr< Internal::TDrawable > GetDrawable(const std::shared_ptr< THist< DIMENSIONS, PRECISION, STAT...>> &hist, THistDrawOptions< DIMENSIONS > opts={})
Interface to graphics taking a unique_ptr<THist>.
const std::string & GetTitle() const
Get the canvas's title.
const Primitives_t & GetPrimitives()
Get the elements contained in the canvas.
static std::shared_ptr< TCanvas > Create(const std::string &title)
void SetTitle(const std::string &title)
Set the canvas's title.
void Paint()
Remove an object from the list of primitives.
static const std::vector< std::shared_ptr< TCanvas > > & GetCanvases()