ROOT
6.12/07
Reference Guide
graf2d
gpad
v7
src
TDisplayItem.cxx
Go to the documentation of this file.
1
/// \file TDisplayItem.cxx
2
/// \ingroup Base ROOT7
3
/// \author Sergey Linev
4
/// \date 2017-05-31
5
/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6
/// is welcome!
7
8
/*************************************************************************
9
* Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
10
* All rights reserved. *
11
* *
12
* For the licensing terms see $ROOTSYS/LICENSE. *
13
* For the list of contributors see $ROOTSYS/README/CREDITS. *
14
*************************************************************************/
15
16
#include "
ROOT/TDisplayItem.hxx
"
17
18
#include "
TString.h
"
19
20
ROOT::Experimental::TDisplayItem::TDisplayItem
() : fObjectID(), fOption(), fKind(0)
21
{
22
}
23
24
ROOT::Experimental::TDisplayItem::TDisplayItem
(
const
TDisplayItem
&rhs)
25
:
fObjectID
(rhs.
fObjectID
),
fOption
(rhs.
fOption
),
fKind
(rhs.
fKind
)
26
{
27
}
28
29
// pin vtable
30
ROOT::Experimental::TDisplayItem::~TDisplayItem
()
31
{
32
}
33
34
std::string
ROOT::Experimental::TDisplayItem::MakeIDFromPtr
(
void
*ptr)
35
{
36
UInt_t
hash =
TString::Hash
(&ptr,
sizeof
(ptr));
37
TString
res =
TString::UItoa
(hash, 10);
38
return
std::string(res.
Data
());
39
}
40
41
void
ROOT::Experimental::TDisplayItem::SetObjectIDAsPtr
(
void
*ptr)
42
{
43
std::string
id
=
MakeIDFromPtr
(ptr);
44
SetObjectID
(
id
.c_str());
45
}
46
47
// =================
48
49
ROOT::Experimental::TPadDisplayItem::~TPadDisplayItem
()
50
{
51
Clear();
52
}
53
54
void
ROOT::Experimental::TPadDisplayItem::Clear
()
55
{
56
for
(
unsigned
n
= 0;
n
< fPrimitives.size(); ++
n
)
delete
fPrimitives[
n
];
57
fPrimitives.clear();
58
}
ROOT::Experimental::TDisplayItem::fKind
int fKind
Definition:
TDisplayItem.hxx:35
TDisplayItem.hxx
TString::UItoa
static TString UItoa(UInt_t value, Int_t base)
Converts a UInt_t (twice the range of an Int_t) to a TString with respect to the base specified (2-36...
Definition:
TString.cxx:2106
ROOT::Experimental::TDisplayItem::SetObjectIDAsPtr
void SetObjectIDAsPtr(void *ptr)
Definition:
TDisplayItem.cxx:41
TString
Basic string class.
Definition:
TString.h:125
TString::Hash
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition:
TString.cxx:616
ROOT::Experimental::TPadDisplayItem::Clear
void Clear()
Definition:
TDisplayItem.cxx:54
TString.h
UInt_t
unsigned int UInt_t
Definition:
RtypesCore.h:42
ROOT::Experimental::TDisplayItem::SetObjectID
void SetObjectID(const char *id)
Definition:
TDisplayItem.hxx:43
ROOT::Experimental::TDisplayItem::fOption
std::string fOption
Definition:
TDisplayItem.hxx:34
ROOT::Experimental::TDisplayItem::TDisplayItem
TDisplayItem()
Definition:
TDisplayItem.cxx:20
ROOT::Experimental::TDisplayItem::MakeIDFromPtr
static std::string MakeIDFromPtr(void *ptr)
Definition:
TDisplayItem.cxx:34
ROOT::Experimental::TDisplayItem::~TDisplayItem
virtual ~TDisplayItem()
Definition:
TDisplayItem.cxx:30
ROOT::Experimental::TDisplayItem
Base class for painting data for JS.
Definition:
TDisplayItem.hxx:31
ROOT::Experimental::TDisplayItem::fObjectID
std::string fObjectID
Definition:
TDisplayItem.hxx:33
n
const Int_t n
Definition:
legend1.C:16
ROOT::Experimental::TPadDisplayItem::~TPadDisplayItem
virtual ~TPadDisplayItem()
Definition:
TDisplayItem.cxx:49
TString::Data
const char * Data() const
Definition:
TString.h:345