Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TEveGeoShapeExtract.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, 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 "TEveGeoShapeExtract.h"
13#include "TEveGeoNode.h"
14#include "TEveGeoShape.h"
15
16#include "TList.h"
17#include "TGeoManager.h"
18#include "TGeoShape.h"
19
20/** \class TEveGeoShapeExtract
21\ingroup TEve
22Globally positioned TGeoShape with rendering attributes and an
23optional list of daughter shape-extracts.
24
25Vessel to carry hand-picked geometry from gled to reve.
26This class exists in both frameworks.
27*/
28
29
30////////////////////////////////////////////////////////////////////////////////
31/// Constructor.
32
33TEveGeoShapeExtract::TEveGeoShapeExtract(const char* n, const char* t) :
34 TNamed (n,t),
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
56
57////////////////////////////////////////////////////////////////////////////////
58/// True if has at least one element.
59
61{
62 return fElements != nullptr && fElements->GetSize() > 0;
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// Add a child element.
67
69{
70 if (fElements == nullptr)
71 fElements = new TList;
72
73 fElements->Add(gse);
74}
75
76////////////////////////////////////////////////////////////////////////////////
77/// Set transformation matrix.
78
80{
81 for(Int_t i=0; i<16; ++i)
82 fTrans[i] = arr[i];
83}
84
85////////////////////////////////////////////////////////////////////////////////
86/// Set RGBA color.
87
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
98{
99 for(Int_t i=0; i<4; ++i)
100 fRGBALine[i] = arr[i];
101}
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
void AddElement(TEveGeoShapeExtract *gse)
Add a child element.
Bool_t HasElements()
True if has at least one element.
void SetRGBA(const Float_t arr[4])
Set RGBA color.
void SetRGBALine(const Float_t arr[4])
Set RGBA color for line.
void SetTrans(const Double_t arr[16])
Set transformation matrix.
~TEveGeoShapeExtract() override
Destructor. Delete shape and elements.
TEveGeoShapeExtract(const TEveGeoShapeExtract &)
A doubly linked list.
Definition TList.h:38
TNamed()
Definition TNamed.h:38
const Int_t n
Definition legend1.C:16