Logo ROOT  
Reference Guide
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 {
17namespace Experimental {
18
20
21class RCanvas;
22class RWebWindow;
23
24namespace Internal {
25
26/** \class ROOT::Experimental::Internal::RVirtualCanvasPainter
27\ingroup GpadROOT7
28\brief Abstract interface for painting a canvas.
29\author Axel Naumann <axel@cern.ch>
30\date 2017-05-31
31\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
32*/
33
35protected:
36 class Generator {
37 public:
38 /// Abstract interface to create a RVirtualCanvasPainter implementation.
39 virtual std::unique_ptr<RVirtualCanvasPainter> Create(RCanvas &canv) const = 0;
40 /// Default destructor.
41 virtual ~Generator();
42 };
43
44 /// generator getter
45 static std::unique_ptr<Generator> &GetGenerator();
46
47public:
48 /// Default destructor.
50
51 /// indicate that canvas changed, provides current version of the canvas
52 virtual void CanvasUpdated(uint64_t, bool, CanvasCallback_t) = 0;
53
54 /// return true if canvas modified since last painting
55 virtual bool IsCanvasModified(uint64_t) const = 0;
56
57 /// perform special action when drawing is ready
58 virtual void DoWhenReady(const std::string &, const std::string &, bool, CanvasCallback_t) = 0;
59
60 /// produce file output in batch mode like png, jpeg, svg or pdf
61 virtual bool ProduceBatchOutput(const std::string &, int, int) = 0;
62
63 virtual void NewDisplay(const std::string &where) = 0;
64
65 virtual int NumDisplays() const = 0;
66
67 virtual std::string GetWindowAddr() const = 0;
68
69 /// run canvas functionality in caller thread, not needed when main thread is used
70 virtual void Run(double tm = 0.) = 0;
71
72 virtual bool AddPanel(std::shared_ptr<RWebWindow>) { return false; }
73
74 /// Loads the plugin that implements this class.
75 static std::unique_ptr<RVirtualCanvasPainter> Create(RCanvas &canv);
76};
77} // namespace Internal
78} // namespace Experimental
79} // namespace ROOT
80
81#endif // ROOT7_RVirtualCanvasPainter
typedef void((*Func_t)())
virtual std::unique_ptr< RVirtualCanvasPainter > Create(RCanvas &canv) const =0
Abstract interface to create a RVirtualCanvasPainter implementation.
Abstract interface for painting a canvas.
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< 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 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 bool IsCanvasModified(uint64_t) const =0
return true if canvas modified since last painting
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:46
Represents web window, which can be shown in web browser or any other supported environment.
Definition: RWebWindow.hxx:56
std::function< void(bool)> CanvasCallback_t
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:151
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21