Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RPad.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2019, 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_RPad
10#define ROOT7_RPad
11
12#include "ROOT/RPadBase.hxx"
13
14namespace ROOT {
15namespace Experimental {
16
17/** \class RPad
18\ingroup GpadROOT7
19\brief Graphic container for `RDrawable`-s.
20\authors Axel Naumann <axel@cern.ch> Sergey Linev <s.linev@gsi.de>
21\date 2017-07-06
22\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
23*/
24
25class RPad: public RPadBase {
26
27 friend class RPadBase; ///< required to set parent
28
29 /// Pad containing this pad as a sub-pad.
30 RPadBase *fParent{nullptr}; ///< The parent pad, if this pad has one.
31
32 RPadPos fPos; ///< pad position
33 RPadExtent fSize; ///< pad size
34
35 /// Create default pad
36 RPad() : RPadBase("pad") {}
37
38 /// Create a pad.
39 RPad(const RPadPos &pos, const RPadExtent &size) : RPad()
40 {
41 fPos = pos;
42 fSize = size;
43 }
44
45 // Assign parent
46 void SetParent(RPadBase *parent) { fParent = parent; }
47
48protected:
49
50 std::unique_ptr<RDisplayItem> Display(const RDisplayContext &) final;
51
52
53public:
54
55 RAttrBorder border{this, "border"}; ///<! border attributes
56
57 /// Constructor must be used only for I/O
59
60 /// Destructor to have a vtable.
61 ~RPad() override;
62
63 /// Access to the parent pad (const version).
64 const RPadBase *GetParent() const { return fParent; }
65
66 /// Access to the parent pad (non-const version).
67 RPadBase *GetParent() { return fParent; }
68
69 /// Access to the top-most canvas (const version).
70 const RCanvas *GetCanvas() const override { return fParent ? fParent->GetCanvas() : nullptr; }
71
72 /// Access to the top-most canvas (non-const version).
73 RCanvas *GetCanvas() override { return fParent ? fParent->GetCanvas() : nullptr; }
74
75 /// Get the position of the pad in parent (!) coordinates.
76 const RPadPos &GetPos() const { return fPos; }
77
78 /// Get the size of the pad in parent (!) coordinates.
79 const RPadExtent &GetSize() const { return fSize; }
80
81 /// Set the size of the pad in parent (!) coordinates.
82 void SetSize(const RPadExtent &sz) { fSize = sz; }
83
84 /// Set position
85 void SetPos(const RPadPos &p) { fPos = p; }
86};
87
88} // namespace Experimental
89} // namespace ROOT
90
91#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
winID h TVirtualViewer3D TVirtualGLPainter p
Drawing line attributes for different objects.
A window's topmost RPad.
Definition RCanvas.hxx:47
Base class for graphic containers for RDrawable-s.
Definition RPadBase.hxx:37
virtual const RCanvas * GetCanvas() const =0
Access to the top-most canvas, if any (const version).
An extent / size (horizontal and vertical) in a RPad.
A position (horizontal and vertical) in a RPad.
Definition RPadPos.hxx:28
Graphic container for RDrawable-s.
Definition RPad.hxx:25
RPad()
Create default pad.
Definition RPad.hxx:36
RAttrBorder border
! border attributes
Definition RPad.hxx:55
std::unique_ptr< RDisplayItem > Display(const RDisplayContext &) final
Create pad display item.
Definition RPad.cxx:27
const RPadExtent & GetSize() const
Get the size of the pad in parent (!) coordinates.
Definition RPad.hxx:79
void SetSize(const RPadExtent &sz)
Set the size of the pad in parent (!) coordinates.
Definition RPad.hxx:82
const RCanvas * GetCanvas() const override
Access to the top-most canvas (const version).
Definition RPad.hxx:70
const RPadBase * GetParent() const
Access to the parent pad (const version).
Definition RPad.hxx:64
RCanvas * GetCanvas() override
Access to the top-most canvas (non-const version).
Definition RPad.hxx:73
RPad(TRootIOCtor *)
Constructor must be used only for I/O.
Definition RPad.hxx:58
RPadBase * GetParent()
Access to the parent pad (non-const version).
Definition RPad.hxx:67
RPadPos fPos
pad position
Definition RPad.hxx:32
RPad(const RPadPos &pos, const RPadExtent &size)
Create a pad.
Definition RPad.hxx:39
~RPad() override
Destructor to have a vtable.
RPadBase * fParent
Pad containing this pad as a sub-pad.
Definition RPad.hxx:30
void SetPos(const RPadPos &p)
Set position.
Definition RPad.hxx:85
const RPadPos & GetPos() const
Get the position of the pad in parent (!) coordinates.
Definition RPad.hxx:76
RPadExtent fSize
pad size
Definition RPad.hxx:33
void SetParent(RPadBase *parent)
Definition RPad.hxx:46
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...