Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-13 09:25:38

0001 /*************************************************************************
0002  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers.               *
0003  * All rights reserved.                                                  *
0004  *                                                                       *
0005  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0006  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0007  *************************************************************************/
0008 
0009 #ifndef ROOT7_RPaletteDrawable
0010 #define ROOT7_RPaletteDrawable
0011 
0012 #include <ROOT/RDrawable.hxx>
0013 #include <ROOT/RAttrValue.hxx>
0014 #include <ROOT/RPadPos.hxx>
0015 #include <ROOT/RPalette.hxx>
0016 
0017 #include <memory>
0018 #include <string>
0019 
0020 namespace ROOT {
0021 namespace Experimental {
0022 
0023 /** \class ROOT::Experimental::RPaletteDrawable
0024 \ingroup GrafROOT7
0025 \brief A color palette draw near the frame.
0026 \author Sergey Linev <s.linev@gsi.de>
0027 \date 2020-03-05
0028 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
0029 */
0030 
0031 
0032 class RPaletteDrawable final : public RDrawable {
0033 
0034    RPalette                fPalette;                              ///<  color palette to draw
0035 
0036 protected:
0037 
0038    bool IsFrameRequired() const final { return true; }
0039 
0040    RPaletteDrawable() : RDrawable("palette") {}
0041 
0042 public:
0043 
0044    RAttrValue<bool>        visible{this, "visible", true};       ///<! visibility flag
0045    RAttrValue<RPadLength>  margin{this, "margin", 0.02_normal};  ///<! horizontal margin to frame
0046    RAttrValue<RPadLength>  width{this, "width", 0.05_normal};    ///<! width of palette
0047 
0048    RPaletteDrawable(const RPalette &palette) : RPaletteDrawable() { fPalette = palette; }
0049    RPaletteDrawable(const RPalette &palette, bool _visible) : RPaletteDrawable() { fPalette = palette; visible = _visible; }
0050    const RPalette &GetPalette() const { return fPalette; }
0051 };
0052 
0053 //inline auto GetDrawable(const RPalette &palette)
0054 //{
0055 //   return std::make_shared<RPaletteDrawable>(palette);
0056 //}
0057 
0058 
0059 } // namespace Experimental
0060 } // namespace ROOT
0061 
0062 #endif