Logo ROOT   6.18/05
Reference Guide
RPadDisplayItem.hxx
Go to the documentation of this file.
1/// \file ROOT/RPadDisplayItem.hxx
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_RPadDisplayItem
17#define ROOT7_RPadDisplayItem
18
19#include <ROOT/RDisplayItem.hxx>
20#include <ROOT/RFrame.hxx>
21#include <ROOT/RPad.hxx>
22
23namespace ROOT {
24namespace Experimental {
25
26/// Display item for the pad
27/// Includes different graphical properties of the pad itself plus
28/// list of created items for all primitives
29
31public:
32 // list of snapshot for primitives in pad
33 using PadPrimitives_t = std::vector<std::unique_ptr<RDisplayItem>>;
34
35protected:
36 const RFrame *fFrame{nullptr}; ///< temporary pointer on frame object
37 const RPad::DrawingOpts *fDrawOpts{nullptr}; ///< temporary pointer on pad drawing options
38 const RPadPos *fPos{nullptr}; ///< temporary pointer on pad position attribute
39 const RPadExtent *fSize{nullptr}; ///< temporary pointer on pad size attributes
40 std::string fTitle; ///< title of the pad (used for canvas)
41 std::array<RPadLength::Pixel, 2> fWinSize; ///< window size (used for canvas)
42 PadPrimitives_t fPrimitives; ///< display items for all primitives in the pad
43public:
44 RPadDisplayItem() = default;
45 virtual ~RPadDisplayItem() {}
46 void SetFrame(const RFrame *f) { fFrame = f; }
47 void SetDrawOpts(const RPad::DrawingOpts *opts) { fDrawOpts = opts; }
48 void SetPos(const RPadPos *pos) { fPos = pos; }
49 void SetSize(const RPadExtent *sz) { fSize = sz; }
50 void SetTitle(const std::string &title) { fTitle = title; }
51 void SetWindowSize(const std::array<RPadLength::Pixel, 2> &win) { fWinSize = win; }
53 void Add(std::unique_ptr<RDisplayItem> &&item) { fPrimitives.push_back(std::move(item)); }
54 void Clear()
55 {
56 fPrimitives.clear();
57 fFrame = nullptr;
58 fDrawOpts = nullptr;
59 fPos = nullptr;
60 fSize = nullptr;
61 fWinSize[0] = fWinSize[1] = 0;
62 fTitle.clear();
63 }
64};
65
66} // Experimental
67} // ROOT
68
69#endif
#define f(i)
Definition: RSha256.hxx:104
Base class for painting data for JS.
Holds a user coordinate system with a palette.
Definition: RFrame.hxx:33
Display item for the pad Includes different graphical properties of the pad itself plus list of creat...
const RPadExtent * fSize
temporary pointer on pad size attributes
void SetTitle(const std::string &title)
std::array< RPadLength::Pixel, 2 > fWinSize
window size (used for canvas)
void SetWindowSize(const std::array< RPadLength::Pixel, 2 > &win)
void SetSize(const RPadExtent *sz)
const RPad::DrawingOpts * fDrawOpts
temporary pointer on pad drawing options
void Add(std::unique_ptr< RDisplayItem > &&item)
PadPrimitives_t fPrimitives
display items for all primitives in the pad
std::vector< std::unique_ptr< RDisplayItem > > PadPrimitives_t
void SetDrawOpts(const RPad::DrawingOpts *opts)
const RPadPos * fPos
temporary pointer on pad position attribute
const RFrame * fFrame
temporary pointer on frame object
std::string fTitle
title of the pad (used for canvas)
Drawing options for a RPad.
Definition: RPad.hxx:188
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
An extent / size (horizontal and vertical) in a RPad.
Definition: RPadExtent.hxx:47
A position (horizontal and vertical) in a RPad.
Definition: RPadPos.hxx:27