27 std::vector<std::vector<ROOT::Experimental::TPad *>>
30 std::vector<std::vector<TPad *>> ret;
32 R__ERROR_HERE(
"Gpad") <<
"Cannot divide into 0 horizontal sub-pads!";
34 R__ERROR_HERE(
"Gpad") <<
"Cannot divide into 0 vertical sub-pads!";
35 if (!nHoriz || !nVert)
41 offset = (offset + padding);
42 offset *= {1. / nHoriz, 1. / nVert};
46 for (
int iHoriz = 0; iHoriz < nHoriz; ++iHoriz) {
47 ret[iHoriz].resize(nVert);
48 for (
int iVert = 0; iVert < nVert; ++iVert) {
50 subPos *= {1. * nHoriz, 1. * nVert};
51 auto uniqPad = std::make_unique<TPad>(*
this, size);
52 ret[iHoriz][iVert] = uniqPad.get();
53 Draw(std::move(uniqPad)).At(subPos);
62 : fPad(
std::move(pPad)), fOpts(parent)
64 assert(&
fPad->GetParent() == &parent &&
"Parent mismatch!");
std::vector< std::vector< TPad * > > Divide(int nHoriz, int nVert, const TPadExtent &padding={})
Divide this pad into a grid of subpad with padding in between.
virtual ~TPad()
Destructor to have a vtable.
A position (horizontal and vertical) in a TPad.
Base class for graphic containers for TDrawable-s.
auto & Draw(const std::shared_ptr< T > &what)
Add something to be painted.
An extent / size (horizontal and vertical) in a TPad.
TPadDrawable(std::unique_ptr< TPad > &&pPad, TPadBase &parent)
Move a sub-pad into this (i.e. parent's) list of drawables.
const std::unique_ptr< TPad > fPad
The pad to be painted.
#define R__ERROR_HERE(GROUP)