Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RVirtualCanvasPainter.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_RVirtualCanvasPainter
10#define ROOT7_RVirtualCanvasPainter
11
12#include <memory>
13#include <functional>
14#include <string>
15
16namespace ROOT {
17
18class RWebWindow;
19
20namespace Experimental {
21
22using CanvasCallback_t = std::function<void(bool)>;
23
24class RCanvas;
25
26namespace Internal {
27
28/** \class ROOT::Experimental::Internal::RVirtualCanvasPainter
29\ingroup GpadROOT7
30\brief Abstract interface for painting a canvas.
31\author Axel Naumann <axel@cern.ch>
32\date 2017-05-31
33\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
34*/
35
37protected:
38 class Generator {
39 public:
40 /// Abstract interface to create a RVirtualCanvasPainter implementation.
41 virtual std::unique_ptr<RVirtualCanvasPainter> Create(RCanvas &canv) const = 0;
42 /// Default destructor.
43 virtual ~Generator();
44 };
45
46 /// generator getter
47 static std::unique_ptr<Generator> &GetGenerator();
48
49public:
50 /// Default destructor.
52
53 /// indicate that canvas changed, provides current version of the canvas
54 virtual void CanvasUpdated(uint64_t, bool, CanvasCallback_t) = 0;
55
56 /// return true if canvas modified since last painting
57 virtual bool IsCanvasModified(uint64_t) const = 0;
58
59 /// perform special action when drawing is ready
60 virtual void DoWhenReady(const std::string &, const std::string &, bool, CanvasCallback_t) = 0;
61
62 /// produce file output in batch mode like png, jpeg, svg or pdf
63 virtual bool ProduceBatchOutput(const std::string &, int, int) = 0;
64
65 /// produce canvas JSON
66 virtual std::string ProduceJSON() = 0;
67
68 virtual void NewDisplay(const std::string &where) = 0;
69
70 virtual int NumDisplays() const = 0;
71
72 virtual std::string GetWindowAddr() const = 0;
73
74 virtual std::string GetWindowUrl(bool remote) = 0;
75
76 /// run canvas functionality in caller thread, not needed when main thread is used
77 virtual void Run(double tm = 0.) = 0;
78
79 virtual bool AddPanel(std::shared_ptr<ROOT::RWebWindow>) { return false; }
80
81 virtual void SetClearOnClose(const std::shared_ptr<void> &) {}
82
83 /// Loads the plugin that implements this class.
84 static std::unique_ptr<RVirtualCanvasPainter> Create(RCanvas &canv);
85};
86} // namespace Internal
87} // namespace Experimental
88} // namespace ROOT
89
90#endif // ROOT7_RVirtualCanvasPainter
virtual std::unique_ptr< RVirtualCanvasPainter > Create(RCanvas &canv) const =0
Abstract interface to create a RVirtualCanvasPainter implementation.
virtual void CanvasUpdated(uint64_t, bool, CanvasCallback_t)=0
indicate that canvas changed, provides current version of the canvas
virtual bool AddPanel(std::shared_ptr< ROOT::RWebWindow >)
virtual void Run(double tm=0.)=0
run canvas functionality in caller thread, not needed when main thread is used
virtual bool ProduceBatchOutput(const std::string &, int, int)=0
produce file output in batch mode like png, jpeg, svg or pdf
virtual std::string GetWindowUrl(bool remote)=0
virtual void DoWhenReady(const std::string &, const std::string &, bool, CanvasCallback_t)=0
perform special action when drawing is ready
static std::unique_ptr< Generator > & GetGenerator()
generator getter
virtual ~RVirtualCanvasPainter()
Default destructor.
virtual std::string ProduceJSON()=0
produce canvas JSON
virtual bool IsCanvasModified(uint64_t) const =0
return true if canvas modified since last painting
virtual void SetClearOnClose(const std::shared_ptr< void > &)
virtual void NewDisplay(const std::string &where)=0
static std::unique_ptr< RVirtualCanvasPainter > Create(RCanvas &canv)
Loads the plugin that implements this class.
virtual std::string GetWindowAddr() const =0
A window's topmost RPad.
Definition RCanvas.hxx:47
std::function< void(bool)> CanvasCallback_t
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...