ROOT
master
Reference Guide
Loading...
Searching...
No Matches
REveGeoShapeExtract.cxx
Go to the documentation of this file.
1
// @(#)root/eve7:$Id$
2
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4
/*************************************************************************
5
* Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#include <
ROOT/REveGeoShapeExtract.hxx
>
13
#include <
ROOT/REveGeoShape.hxx
>
14
15
#include "
TList.h
"
16
#include "
TGeoManager.h
"
17
#include "
TGeoShape.h
"
18
19
using namespace
ROOT::Experimental
;
20
21
/** \class REveGeoShapeExtract
22
\ingroup REve
23
Globally positioned TGeoShape with rendering attributes and an
24
optional list of daughter shape-extracts.
25
26
Vessel to carry hand-picked geometry from gled to reve.
27
This class exists in both frameworks.
28
*/
29
30
////////////////////////////////////////////////////////////////////////////////
31
/// Constructor.
32
33
REveGeoShapeExtract::REveGeoShapeExtract(
const
char
*
n
,
const
char
* t) :
34
TNamed
(
n
,t),
35
fRnrSelf (
kTRUE
),
36
fRnrElements (
kTRUE
),
37
fRnrFrame (
kTRUE
),
38
fMiniFrame (
kTRUE
),
39
fShape
(nullptr),
40
fElements (nullptr)
41
{
42
memset(
fTrans
, 0,
sizeof
(
fTrans
));
43
fTrans
[0] =
fTrans
[5] =
fTrans
[10] =
fTrans
[15] = 1;
44
fRGBA
[0] =
fRGBA
[1] =
fRGBA
[2] =
fRGBA
[3] = 1;
45
fRGBALine
[0] =
fRGBALine
[1] =
fRGBALine
[2] = 0;
fRGBALine
[3] = 1;
46
}
47
48
////////////////////////////////////////////////////////////////////////////////
49
/// Destructor. Delete shape and elements.
50
51
REveGeoShapeExtract::~REveGeoShapeExtract
()
52
{
53
delete
fShape
;
54
delete
fElements
;
55
}
56
57
////////////////////////////////////////////////////////////////////////////////
58
/// True if has at least one element.
59
60
Bool_t
REveGeoShapeExtract::HasElements
()
61
{
62
return
fElements
&& (
fElements
->
GetSize
() > 0);
63
}
64
65
////////////////////////////////////////////////////////////////////////////////
66
/// Add a child element.
67
68
void
REveGeoShapeExtract::AddElement
(
REveGeoShapeExtract
* gse)
69
{
70
if
(!
fElements
)
71
fElements
=
new
TList
;
72
73
fElements
->
Add
(gse);
74
}
75
76
////////////////////////////////////////////////////////////////////////////////
77
/// Set transformation matrix.
78
79
void
REveGeoShapeExtract::SetTrans
(
const
Double_t
arr[16])
80
{
81
for
(
Int_t
i=0; i<16; ++i)
82
fTrans
[i] = arr[i];
83
}
84
85
////////////////////////////////////////////////////////////////////////////////
86
/// Set RGBA color.
87
88
void
REveGeoShapeExtract::SetRGBA
(
const
Float_t
arr[4])
89
{
90
for
(
Int_t
i=0; i<4; ++i)
91
fRGBA
[i] = arr[i];
92
}
93
94
////////////////////////////////////////////////////////////////////////////////
95
/// Set RGBA color for line.
96
97
void
REveGeoShapeExtract::SetRGBALine
(
const
Float_t
arr[4])
98
{
99
for
(
Int_t
i=0; i<4; ++i)
100
fRGBALine
[i] = arr[i];
101
}
fShape
dims_t fShape
Definition
DeclareConverters.h:205
REveGeoShapeExtract.hxx
REveGeoShape.hxx
kTRUE
constexpr Bool_t kTRUE
Definition
RtypesCore.h:93
TGeoManager.h
TGeoShape.h
TList.h
Float_t
ROOT::Experimental::REveGeoShapeExtract
Definition
REveGeoShapeExtract.hxx:24
ROOT::Experimental::REveGeoShapeExtract::fElements
TList * fElements
Definition
REveGeoShapeExtract.hxx:37
ROOT::Experimental::REveGeoShapeExtract::SetRGBA
void SetRGBA(const Float_t arr[4])
Set RGBA color.
Definition
REveGeoShapeExtract.cxx:88
ROOT::Experimental::REveGeoShapeExtract::AddElement
void AddElement(REveGeoShapeExtract *gse)
Add a child element.
Definition
REveGeoShapeExtract.cxx:68
ROOT::Experimental::REveGeoShapeExtract::fShape
TGeoShape * fShape
Definition
REveGeoShapeExtract.hxx:36
ROOT::Experimental::REveGeoShapeExtract::SetTrans
void SetTrans(const Double_t arr[16])
Set transformation matrix.
Definition
REveGeoShapeExtract.cxx:79
ROOT::Experimental::REveGeoShapeExtract::HasElements
Bool_t HasElements()
True if has at least one element.
Definition
REveGeoShapeExtract.cxx:60
ROOT::Experimental::REveGeoShapeExtract::~REveGeoShapeExtract
~REveGeoShapeExtract() override
Destructor. Delete shape and elements.
Definition
REveGeoShapeExtract.cxx:51
ROOT::Experimental::REveGeoShapeExtract::fRGBALine
Float_t fRGBALine[4]
Definition
REveGeoShapeExtract.hxx:31
ROOT::Experimental::REveGeoShapeExtract::fRGBA
Float_t fRGBA[4]
Definition
REveGeoShapeExtract.hxx:30
ROOT::Experimental::REveGeoShapeExtract::SetRGBALine
void SetRGBALine(const Float_t arr[4])
Set RGBA color for line.
Definition
REveGeoShapeExtract.cxx:97
ROOT::Experimental::REveGeoShapeExtract::fTrans
Double_t fTrans[16]
Definition
REveGeoShapeExtract.hxx:29
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition
TCollection.h:184
TList
A doubly linked list.
Definition
TList.h:38
TList::Add
void Add(TObject *obj) override
Definition
TList.h:81
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition
TNamed.h:29
bool
double
int
n
const Int_t n
Definition
legend1.C:16
ROOT::Experimental
Definition
RDirectory.hxx:30
graf3d
eve7
src
REveGeoShapeExtract.cxx
ROOT master - Reference Guide Generated on Sat Nov 16 2024 09:37:52 (GVA Time) using Doxygen 1.9.8