]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/TGeoShapeExtract.cxx
7e46e1ae8ed31db0aeda76931e4176671f96a05c
[u/mrichter/AliRoot.git] / EVE / Reve / TGeoShapeExtract.cxx
1 // $Header$
2
3 // Copyright (C) 1999-2005, Matevz Tadel. All rights reserved.
4 // This file is part of GLED, released under GNU General Public License version 2.
5 // For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.
6
7 //__________________________________________________________________________
8 // TGeoShapeExtract
9 //
10 // Vessel to carry hand-picked geometry from gled to reve.
11 // This class exists in both frameworks.
12
13 #include "TGeoShapeExtract.h"
14
15 #include <TList.h>
16 #include <TGeoShape.h>
17
18 ClassImp(TGeoShapeExtract)
19
20 /**************************************************************************/
21
22 TGeoShapeExtract::TGeoShapeExtract(const Text_t* n, const Text_t* t) :
23   TNamed(n,t),
24   mRnrSelf     (true),
25   mRnrElements (true),
26   mShape       (0),
27   mElements    (0)
28 {
29   memset(mTrans, 0, sizeof(mTrans));
30   mTrans[0] = mTrans[5] = mTrans[10] = mTrans[15] = 1;
31   mRGBA [0] = mRGBA [1] = mRGBA [2]  = mRGBA [3]  = 1;
32 }
33
34 TGeoShapeExtract::~TGeoShapeExtract()
35 {
36   delete mShape;
37   delete mElements;
38 }
39
40 /**************************************************************************/
41
42 Bool_t TGeoShapeExtract::HasElements()
43 {
44   return mElements != 0 && mElements->GetSize() > 0;
45 }
46
47 void TGeoShapeExtract::AddElement(TGeoShapeExtract* gse)
48 {
49   if (mElements == 0)
50     mElements = new TList;
51
52   mElements->Add(gse);
53 }
54
55 /**************************************************************************/
56
57 void TGeoShapeExtract::SetTrans(const Double_t arr[16])
58 {
59   for(Int_t i=0; i<16; ++i)
60     mTrans[i] = arr[i];
61 }
62
63 void TGeoShapeExtract::SetRGBA (const Float_t  arr[4])
64 {
65   for(Int_t i=0; i<4; ++i)
66     mRGBA[i] = arr[i];
67 }