File indexing completed on 2025-01-18 10:10:38
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ROOT7_RDisplayItem
0010 #define ROOT7_RDisplayItem
0011
0012 #include <string>
0013
0014 namespace ROOT {
0015 namespace Experimental {
0016
0017 class RDrawable;
0018 class RStyle;
0019 class RAttrMap;
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 class RDisplayItem {
0030 protected:
0031 std::string fObjectID;
0032 RStyle *fStyle{nullptr};
0033 unsigned fIndex{0};
0034 bool fDummy{false};
0035
0036 public:
0037 RDisplayItem() = default;
0038 RDisplayItem(bool dummy) : RDisplayItem() { fDummy = dummy; }
0039 virtual ~RDisplayItem() {}
0040
0041 void SetObjectID(const std::string &id) { fObjectID = id; }
0042 std::string GetObjectID() const { return fObjectID; }
0043
0044 void SetObjectIDAsPtr(const void *ptr);
0045
0046 void SetStyle(RStyle *style) { fStyle = style; }
0047
0048 void SetIndex(unsigned indx) { fIndex = indx; }
0049 unsigned GetIndex() const { return fIndex; }
0050
0051 virtual void BuildFullId(const std::string &prefix);
0052
0053 static std::string ObjectIDFromPtr(const void *ptr);
0054 };
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 class RDrawableDisplayItem : public RDisplayItem {
0066 protected:
0067
0068 const RDrawable *fDrawable{nullptr};
0069
0070 public:
0071
0072 template <class DRAWABLE>
0073 RDrawableDisplayItem(const DRAWABLE &dr)
0074 {
0075 fDrawable = &dr;
0076 }
0077
0078 const RDrawable *GetDrawable() const { return fDrawable; }
0079
0080 ~RDrawableDisplayItem() override;
0081
0082 };
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093 class RIndirectDisplayItem : public RDisplayItem {
0094 protected:
0095
0096 const RAttrMap *fAttr{nullptr};
0097 const std::string *fCssClass{nullptr};
0098 const std::string *fId{nullptr};
0099
0100 public:
0101
0102 RIndirectDisplayItem() = default;
0103
0104 RIndirectDisplayItem(const RDrawable &dr);
0105 };
0106
0107 }
0108 }
0109
0110 #endif