Logo ROOT   6.12/07
Reference Guide
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
22 Globally positioned TGeoShape with rendering attributes and an
23 optional list of daughter shape-extracts.
24 
25 Vessel to carry hand-picked geometry from gled to reve.
26 This class exists in both frameworks.
27 */
28 
30 
31 ////////////////////////////////////////////////////////////////////////////////
32 /// Constructor.
33 
34 TEveGeoShapeExtract::TEveGeoShapeExtract(const char* n, const char* t) :
35  TNamed (n,t),
36  fRnrSelf (kTRUE),
37  fRnrElements (kTRUE),
38  fRnrFrame (kTRUE),
39  fMiniFrame (kTRUE),
40  fShape (0),
41  fElements (0)
42 {
43  memset(fTrans, 0, sizeof(fTrans));
44  fTrans[0] = fTrans[5] = fTrans[10] = fTrans[15] = 1;
45  fRGBA [0] = fRGBA [1] = fRGBA [2] = fRGBA [3] = 1;
46  fRGBALine[0] = fRGBALine[1] = fRGBALine[2] = 0; fRGBALine[3] = 1;
47 }
48 
49 ////////////////////////////////////////////////////////////////////////////////
50 /// Destructor. Delete shape and elements.
51 
53 {
54  delete fShape;
55  delete fElements;
56 }
57 
58 ////////////////////////////////////////////////////////////////////////////////
59 /// True if has at least one element.
60 
62 {
63  return fElements != 0 && fElements->GetSize() > 0;
64 }
65 
66 ////////////////////////////////////////////////////////////////////////////////
67 /// Add a child element.
68 
70 {
71  if (fElements == 0)
72  fElements = new TList;
73 
74  fElements->Add(gse);
75 }
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Set transformation matrix.
79 
81 {
82  for(Int_t i=0; i<16; ++i)
83  fTrans[i] = arr[i];
84 }
85 
86 ////////////////////////////////////////////////////////////////////////////////
87 /// Set RGBA color.
88 
90 {
91  for(Int_t i=0; i<4; ++i)
92  fRGBA[i] = arr[i];
93 }
94 
95 ////////////////////////////////////////////////////////////////////////////////
96 /// Set RGBA color for line.
97 
99 {
100  for(Int_t i=0; i<4; ++i)
101  fRGBALine[i] = arr[i];
102 }
void SetTrans(const Double_t arr[16])
Set transformation matrix.
void SetRGBA(const Float_t arr[4])
Set RGBA color.
~TEveGeoShapeExtract()
Destructor. Delete shape and elements.
Globally positioned TGeoShape with rendering attributes and an optional list of daughter shape-extrac...
float Float_t
Definition: RtypesCore.h:53
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
A doubly linked list.
Definition: TList.h:44
void AddElement(TEveGeoShapeExtract *gse)
Add a child element.
void SetRGBALine(const Float_t arr[4])
Set RGBA color for line.
#define ClassImp(name)
Definition: Rtypes.h:359
double Double_t
Definition: RtypesCore.h:55
Bool_t HasElements()
True if has at least one element.
TEveGeoShapeExtract(const TEveGeoShapeExtract &)
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual Int_t GetSize() const
Definition: TCollection.h:180
const Bool_t kTRUE
Definition: RtypesCore.h:87
const Int_t n
Definition: legend1.C:16