Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RDisplayItem.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2019, 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_RDisplayItem
10#define ROOT7_RDisplayItem
11
12#include <string>
13
14class TObject;
15
16namespace ROOT {
17namespace Experimental {
18
19class RDrawable;
20class RStyle;
21class RAttrMap;
22
23/** \class RDisplayItem
24\ingroup GpadROOT7
25\brief Base class for painting data for JS.
26\author Sergey Linev <s.linev@gsi.de>
27\date 2017-05-31
28\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
29*/
30
32protected:
33 std::string fObjectID; ///< unique object identifier
34 RStyle *fStyle{nullptr}; ///< style object
35 unsigned fIndex{0}; ///<! index inside current pad, used to produce fully-qualified id, not send to client
36 bool fDummy{false}; ///< if true, just placeholder for drawable which does not changed
37
38public:
39 RDisplayItem() = default;
40 RDisplayItem(bool dummy) : RDisplayItem() { fDummy = dummy; }
41 virtual ~RDisplayItem() {}
42
43 void SetObjectID(const std::string &id) { fObjectID = id; }
44 std::string GetObjectID() const { return fObjectID; }
45
46 void SetObjectIDAsPtr(const void *ptr);
47
49
50 void SetIndex(unsigned indx) { fIndex = indx; }
51 unsigned GetIndex() const { return fIndex; }
52
53 virtual void BuildFullId(const std::string &prefix);
54
55 static std::string ObjectIDFromPtr(const void *ptr);
56};
57
58
59/** \class RDrawableDisplayItem
60\ingroup GpadROOT7
61\brief Generic display item for RDrawable, just reference drawable itself
62\author Sergey Linev <s.linev@gsi.de>
63\date 2017-05-31
64\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
65*/
66
68protected:
69
70 const RDrawable *fDrawable{nullptr}; ///< drawable
71
72public:
73
74 template <class DRAWABLE>
75 RDrawableDisplayItem(const DRAWABLE &dr)
76 {
77 fDrawable = &dr;
78 }
79
80 const RDrawable *GetDrawable() const { return fDrawable; }
81
82 virtual ~RDrawableDisplayItem();
83
84};
85
86
87/** \class RIndirectDisplayItem
88\ingroup GpadROOT7
89\brief Extract (reference) only basic attributes from drawable, but not drawable itself
90\author Sergey Linev <s.linev@gsi.de>
91\date 2020-04-02
92\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
93*/
94
96protected:
97
98 const RAttrMap *fAttr{nullptr}; ///< pointer on drawable attributes
99 const std::string *fCssClass{nullptr}; ///< pointer on drawable class
100 const std::string *fId{nullptr}; ///< pointer on drawable id
101
102public:
103
105
107};
108
109
110/** \class TObjectDisplayItem
111\ingroup GpadROOT7
112\brief Display item for TObject with drawing options
113\author Sergey Linev <s.linev@gsi.de>
114\date 2017-05-31
115\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
116*/
117
119protected:
120
121 int fKind{0}; ///< object kind
122 const TObject *fObject{nullptr}; ///< ROOT6 object
123 std::string fOption; ///< drawing options
124 bool fOwner{false}; ///<! if object must be deleted
125
126public:
127
128 TObjectDisplayItem(int kind, const TObject *obj, const std::string &opt, bool owner = false)
129 {
130 fKind = kind;
131 fObject = obj;
132 fOption = opt;
133 fOwner = owner;
134 }
135
136 virtual ~TObjectDisplayItem();
137
138};
139
140} // namespace Experimental
141} // namespace ROOT
142
143#endif
XFontStruct * id
Definition TGX11.cxx:109
Base class for painting data for JS.
virtual void BuildFullId(const std::string &prefix)
Build full id, including prefix and object index.
std::string fObjectID
unique object identifier
void SetObjectID(const std::string &id)
bool fDummy
if true, just placeholder for drawable which does not changed
void SetObjectIDAsPtr(const void *ptr)
Assign id using arbitrary pointer value Typically drawable pointer should be used here.
unsigned fIndex
! index inside current pad, used to produce fully-qualified id, not send to client
static std::string ObjectIDFromPtr(const void *ptr)
Construct fillid using pointer value.
Generic display item for RDrawable, just reference drawable itself.
const RDrawable * GetDrawable() const
Base class for drawable entities: objects that can be painted on a RPad.
Extract (reference) only basic attributes from drawable, but not drawable itself.
const std::string * fId
pointer on drawable id
const std::string * fCssClass
pointer on drawable class
const RAttrMap * fAttr
pointer on drawable attributes
A set of defaults for graphics attributes, e.g.
Definition RStyle.hxx:32
Display item for TObject with drawing options.
const TObject * fObject
ROOT6 object.
std::string fOption
drawing options
TObjectDisplayItem(int kind, const TObject *obj, const std::string &opt, bool owner=false)
bool fOwner
! if object must be deleted
Mother of all ROOT objects.
Definition TObject.h:37
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
TCanvas * style()
Definition style.C:1