16 #ifndef ROOT7_RHistDrawable
17 #define ROOT7_RHistDrawable
28 namespace Experimental {
30 template <
int DIMENSIONS,
class PRECISION,
template <
int D_,
class P_>
class... STAT>
34 template <
int DIMENSIONS>
35 class RHistImplPrecisionAgnosticBase;
38 template <
int DIMENSIONS>
39 class RHistDrawable final:
public RDrawable {
41 using HistImpl_t = Detail::RHistImplPrecisionAgnosticBase<DIMENSIONS>;
44 Internal::RIOShared<HistImpl_t> fHistImpl;
46 RAttrLine fAttrLine{
this,
"line_"};
50 void CollectShared(Internal::RIOSharedVector_t &vect)
final { vect.emplace_back(&fHistImpl); }
54 virtual ~RHistDrawable() =
default;
57 RHistDrawable(
const std::shared_ptr<HIST> &hist) : RHistDrawable()
59 fHistImpl = std::shared_ptr<HistImpl_t>(hist, hist->GetImpl());
62 const RAttrLine &GetAttrLine()
const {
return fAttrLine; }
63 RHistDrawable &SetAttrLine(
const RAttrLine &attr) { fAttrLine = attr;
return *
this; }
64 RAttrLine &AttrLine() {
return fAttrLine; }
66 std::shared_ptr<HistImpl_t> GetHist()
const {
return fHistImpl.get_shared(); }
68 void PopulateMenu(RMenuItems &) final
73 void Execute(
const std::string &) final
85 template <
int DIMENSIONS>
inline RHistDrawable<DIMENSIONS>::RHistDrawable() : RDrawable(
"hist") {}
87 inline auto GetDrawable(
const std::shared_ptr<RH1D> &histimpl)
89 return std::make_shared<RHistDrawable<1>>(histimpl);
92 inline auto GetDrawable(
const std::shared_ptr<RH1I> &histimpl)
94 return std::make_shared<RHistDrawable<1>>(histimpl);
97 inline auto GetDrawable(
const std::shared_ptr<RH1C> &histimpl)
99 return std::make_shared<RHistDrawable<1>>(histimpl);
102 inline auto GetDrawable(
const std::shared_ptr<RH1F> &histimpl)
104 return std::make_shared<RHistDrawable<1>>(histimpl);
107 inline auto GetDrawable(
const std::shared_ptr<RH2D> &histimpl)
109 return std::make_shared<RHistDrawable<2>>(histimpl);
112 inline auto GetDrawable(
const std::shared_ptr<RH2I> &histimpl)
114 return std::make_shared<RHistDrawable<2>>(histimpl);
117 inline auto GetDrawable(
const std::shared_ptr<RH2C> &histimpl)
119 return std::make_shared<RHistDrawable<2>>(histimpl);
122 inline auto GetDrawable(
const std::shared_ptr<RH2F> &histimpl)
124 return std::make_shared<RHistDrawable<2>>(histimpl);
127 inline auto GetDrawable(
const std::shared_ptr<RH3D> &histimpl)
129 return std::make_shared<RHistDrawable<3>>(histimpl);
132 inline auto GetDrawable(
const std::shared_ptr<RH3I> &histimpl)
134 return std::make_shared<RHistDrawable<3>>(histimpl);
137 inline auto GetDrawable(
const std::shared_ptr<RH3C> &histimpl)
139 return std::make_shared<RHistDrawable<3>>(histimpl);
142 inline auto GetDrawable(
const std::shared_ptr<RH3F> &histimpl)
144 return std::make_shared<RHistDrawable<3>>(histimpl);