Logo ROOT  
Reference Guide
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;
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};
81
82
83/** \class RDrawableDisplayItem
84\ingroup GpadROOT7
85\brief Generic display item for RDrawable, just reference drawable itself
86\author Sergey Linev <s.linev@gsi.de>
87\date 2017-05-31
88\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
89*/
90
92protected:
93
94 const RAttrMap *fAttr{nullptr}; ///< pointer on drawable attributes
95 const std::string *fCssClass{nullptr}; ///< pointer on drawable class
96 const std::string *fId{nullptr}; ///< pointer on drawable id
97
98public:
99
101
103};
104
105
106/** \class RObjectDisplayItem
107\ingroup GpadROOT7
108\brief Display item for TObject with drawing options
109\author Sergey Linev <s.linev@gsi.de>
110\date 2017-05-31
111\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
112*/
113
115protected:
116
117 const TObject *fObject{nullptr}; ///< ROOT6 object
118 std::string fOption; ///< drawing options
119
120public:
121
122 RObjectDisplayItem(const TObject *obj, const std::string &opt)
123 {
124 fObject = obj;
125 fOption = opt;
126 }
127
128};
129
130} // namespace Experimental
131} // namespace ROOT
132
133#endif
static RooMathCoreReg dummy
XFontStruct * id
Definition: TGX11.cxx:108
Base class for painting data for JS.
std::string fObjectID
unique object identifier
void SetObjectID(const std::string &id)
bool fDummy
if true, just placeholder for drawable which does not changed
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.
void SetObjectIDAsPtr(const void *ptr)
Assign id using arbitrary pointer value Typically drawable pointer should be used here.
virtual void BuildFullId(const std::string &prefix)
Build full id, including prefix and object index.
std::string GetObjectID() const
Generic display item for RDrawable, just reference drawable itself.
const RDrawable * fDrawable
drawable
Base class for drawable entities: objects that can be painted on a RPad.
Definition: RDrawable.hxx:102
const std::string * fId
pointer on drawable id
const std::string * fCssClass
pointer on drawable class
const RAttrMap * fAttr
pointer on drawable attributes
Display item for TObject with drawing options.
std::string fOption
drawing options
const TObject * fObject
ROOT6 object.
RObjectDisplayItem(const TObject *obj, const std::string &opt)
A set of defaults for graphics attributes, e.g.
Definition: RStyle.hxx:31
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...
Definition: StringConv.hxx:21
TCanvas * style()
Definition: style.C:1