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;
21
22/** \class RDisplayItem
23\ingroup GpadROOT7
24\brief Base class for painting data for JS.
25\author Sergey Linev <s.linev@gsi.de>
26\date 2017-05-31
27\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
28*/
29
31protected:
32 std::string fObjectID; ///< unique object identifier
33 RStyle *fStyle{nullptr}; ///< style object
34 unsigned fIndex{0}; ///<! index inside current pad, used to produce fully-qualified id, not send to client
35
36public:
37 RDisplayItem() = default;
38 virtual ~RDisplayItem() {}
39
40 void SetObjectID(const std::string &id) { fObjectID = id; }
41 std::string GetObjectID() const { return fObjectID; }
42
43 void SetObjectIDAsPtr(const void *ptr);
44
46
47 void SetIndex(unsigned indx) { fIndex = indx; }
48 unsigned GetIndex() const { return fIndex; }
49
50 virtual void BuildFullId(const std::string &prefix);
51
52 static std::string ObjectIDFromPtr(const void *ptr);
53};
54
55
56/** \class RDrawableDisplayItem
57\ingroup GpadROOT7
58\brief Generic display item for RDrawable, just reference drawable itself
59\author Sergey Linev <s.linev@gsi.de>
60\date 2017-05-31
61\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
62*/
63
65protected:
66
67 const RDrawable *fDrawable{nullptr}; ///< drawable
68
69public:
70
71 template <class DRAWABLE>
72 RDrawableDisplayItem(const DRAWABLE &dr)
73 {
74 fDrawable = &dr;
75 }
76
77};
78
79/** \class RObjectDisplayItem
80\ingroup GpadROOT7
81\brief Display item for TObject with drawing options
82\author Sergey Linev <s.linev@gsi.de>
83\date 2017-05-31
84\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
85*/
86
88protected:
89
90 const TObject *fObject{nullptr}; ///< ROOT6 object
91 std::string fOption; ///< drawing options
92
93public:
94
95 RObjectDisplayItem(const TObject *obj, const std::string &opt)
96 {
97 fObject = obj;
98 fOption = opt;
99 }
100
101};
102
103} // namespace Experimental
104} // namespace ROOT
105
106#endif
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)
unsigned fIndex
! index inside current pad, used to produce fully-qualified id, not send to client
static std::string ObjectIDFromPtr(const void *ptr)
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)
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:99
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:30
Mother of all ROOT objects.
Definition: TObject.h:37
VSD Structures.
Definition: StringConv.hxx:21
TCanvas * style()
Definition: style.C:1