Logo ROOT   6.14/05
Reference Guide
TPadDisplayItem.hxx
Go to the documentation of this file.
1 /// \file ROOT/TDisplayItem.h
2 /// \ingroup Base ROOT7
3 /// \author Sergey Linev
4 /// \date 2017-05-31
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 /*************************************************************************
9  * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
10  * All rights reserved. *
11  * *
12  * For the licensing terms see $ROOTSYS/LICENSE. *
13  * For the list of contributors see $ROOTSYS/README/CREDITS. *
14  *************************************************************************/
15 
16 #ifndef ROOT7_TPadDisplayItem
17 #define ROOT7_TPadDisplayItem
18 
19 #include <ROOT/TDisplayItem.hxx>
20 
21 #include <ROOT/TFrame.hxx>
22 
23 #include <ROOT/TPad.hxx>
24 
25 namespace ROOT {
26 namespace Experimental {
27 
28 /// Display item for the pad
29 /// Includes different graphical properties of the pad itself plus
30 /// list of created items for all primitives
31 
32 class TPadDisplayItem : public TDisplayItem {
33 public:
34  // list of snapshot for primitives in pad
35  using PadPrimitives_t = std::vector<std::unique_ptr<TDisplayItem>>;
36 
37 
38 protected:
39  const TFrame *fFrame{nullptr}; ///< temporary pointer on frame object
40  const TPadDrawingOpts *fDrawOpts{nullptr}; ///< temporary pointer on pad drawing options
41  const TPadExtent *fSize{nullptr}; ///< temporary pointer on pad size attributes
42  PadPrimitives_t fPrimitives; ///< display items for all primitives in the pad
43 public:
44  TPadDisplayItem() = default;
45  virtual ~TPadDisplayItem() {}
46  void SetFrame(const TFrame *f) { fFrame = f; }
47  void SetDrawOpts(const TPadDrawingOpts *opts) { fDrawOpts = opts; }
48  void SetSize(const TPadExtent *sz) { fSize = sz; }
50  void Add(std::unique_ptr<TDisplayItem> &&item) { fPrimitives.push_back(std::move(item)); }
51  void Clear()
52  {
53  fPrimitives.clear();
54  fFrame = nullptr;
55  fDrawOpts = nullptr;
56  fSize = nullptr;
57  }
58 };
59 
60 } // Experimental
61 } // ROOT
62 
63 #endif
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
const TPadDrawingOpts * fDrawOpts
temporary pointer on pad drawing options
Drawing options for a TPad.
Definition: TPad.hxx:245
void Add(std::unique_ptr< TDisplayItem > &&item)
const TFrame * fFrame
temporary pointer on frame object
#define f(i)
Definition: RSha256.hxx:104
void SetDrawOpts(const TPadDrawingOpts *opts)
void SetSize(const TPadExtent *sz)
std::vector< std::unique_ptr< TDisplayItem > > PadPrimitives_t
PadPrimitives_t fPrimitives
display items for all primitives in the pad
const TPadExtent * fSize
temporary pointer on pad size attributes
Holds a user coordinate system with a palette.
Definition: TFrame.hxx:35
Display item for the pad Includes different graphical properties of the pad itself plus list of creat...
An extent / size (horizontal and vertical) in a TPad.
Definition: TPadExtent.hxx:44