Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RPaletteDrawable.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2021, 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_RPaletteDrawable
10#define ROOT7_RPaletteDrawable
11
12#include <ROOT/RDrawable.hxx>
13#include <ROOT/RAttrValue.hxx>
14#include <ROOT/RPadPos.hxx>
15#include <ROOT/RPalette.hxx>
16
17#include <memory>
18#include <string>
19
20namespace ROOT {
21namespace Experimental {
22
23/** \class ROOT::Experimental::RPaletteDrawable
24\ingroup GrafROOT7
25\brief A color palette draw near the frame.
26\author Sergey Linev <s.linev@gsi.de>
27\date 2020-03-05
28\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
29*/
30
31
32class RPaletteDrawable final : public RDrawable {
33
34 RPalette fPalette; ///< color palette to draw
35
36protected:
37
38 bool IsFrameRequired() const final { return true; }
39
40 RPaletteDrawable() : RDrawable("palette") {}
41
42public:
43
44 RAttrValue<bool> visible{this, "visible", true}; ///<! visibility flag
45 RAttrValue<RPadLength> margin{this, "margin", 0.02_normal}; ///<! horizontal margin to frame
46 RAttrValue<RPadLength> width{this, "width", 0.05_normal}; ///<! width of palette
47
48 RPaletteDrawable(const RPalette &palette) : RPaletteDrawable() { fPalette = palette; }
49 RPaletteDrawable(const RPalette &palette, bool _visible) : RPaletteDrawable() { fPalette = palette; visible = _visible; }
50 const RPalette &GetPalette() const { return fPalette; }
51};
52
53//inline auto GetDrawable(const RPalette &palette)
54//{
55// return std::make_shared<RPaletteDrawable>(palette);
56//}
57
58
59} // namespace Experimental
60} // namespace ROOT
61
62#endif
Template class to access single value from drawable or other attributes.
Base class for drawable entities: objects that can be painted on a RPad.
A color palette draw near the frame.
RAttrValue< RPadLength > margin
! horizontal margin to frame
RAttrValue< RPadLength > width
! width of palette
RAttrValue< bool > visible
! visibility flag
RPaletteDrawable(const RPalette &palette, bool _visible)
RPalette fPalette
color palette to draw
RPaletteDrawable(const RPalette &palette)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...