Logo ROOT   6.14/05
Reference Guide
TPadPainter.cxx
Go to the documentation of this file.
1 /// \file TPadPainter.cxx
2 /// \ingroup Gpad ROOT7
3 /// \author Sergey Linev
4 /// \date 2018-03-12
5 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6 /// is welcome!
7 
8 #include <ROOT/TPadPainter.hxx>
9 
10 #include <ROOT/TPadDisplayItem.hxx>
11 #include <ROOT/TPad.hxx>
12 
13 
14 /// destructor
16 {
17  // defined here, while TPadDisplayItem only included here
18 }
19 
20 
21 void ROOT::Experimental::Internal::TPadPainter::AddDisplayItem(std::unique_ptr<TDisplayItem> &&item)
22 {
23  item->SetObjectID(fCurrentDrawableId);
24  fPadDisplayItem->Add(std::move(item));
25 }
26 
28 {
29  fPadDisplayItem = std::make_unique<TPadDisplayItem>();
30 
31  fPadDisplayItem->SetFrame(pad.GetFrame());
32 
33  for (auto &&drawable : pad.GetPrimitives()) {
34 
35  fCurrentDrawableId = drawable->GetId();
36 
37  drawable->Paint(*this);
38  }
39 
40 }
std::string fCurrentDrawableId
! current drawable id
Definition: TPadPainter.hxx:44
void PaintDrawables(const TPadBase &pad)
Definition: TPadPainter.cxx:27
std::unique_ptr< TPadDisplayItem > fPadDisplayItem
! display items for all drawables in the pad
Definition: TPadPainter.hxx:43
Base class for graphic containers for TDrawable-s.
Definition: TPad.hxx:41
const Primitives_t & GetPrimitives() const
Get the elements contained in the canvas.
Definition: TPad.hxx:158
virtual void AddDisplayItem(std::unique_ptr< TDisplayItem > &&item)
add display item to the canvas
Definition: TPadPainter.cxx:21
const TFrame * GetFrame() const
Definition: TPad.hxx:138
virtual ~TPadPainter()
Default destructor.
Definition: TPadPainter.cxx:15