ROOT  6.06/09
Reference Guide
TGeoStateInfo.cxx
Go to the documentation of this file.
1 // @(#):$Id$
2 // Author: Andrei Gheata 07/02/2012
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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 "TGeoStateInfo.h"
13 #include "TGeoNode.h"
14 #include "TGeoPolygon.h"
15 #include "TGeoManager.h"
16 
18 ////////////////////////////////////////////////////////////////////////////////
19 /// Constructor
20 
21 TGeoStateInfo::TGeoStateInfo(Int_t maxdaughters)
22  :fNode(0),
23  fAsmCurrent(0),
24  fAsmNext(0),
25  fDivCurrent(0),
26  fDivNext(0),
27  fDivTrans(),
28  fDivRot(),
29  fDivCombi(),
30  fVoxNcandidates(0),
31  fVoxCurrent(0),
32  fVoxCheckList(0),
33  fVoxBits1(0),
34  fBoolSelected(0),
35  fXtruSeg(0),
36  fXtruIz(0),
37  fXtruXc(0),
38  fXtruYc(0),
39  fXtruPoly(0)
40 {
41  Int_t maxDaughters = (maxdaughters>0) ? maxdaughters : TGeoManager::GetMaxDaughters();
42  Int_t maxXtruVert = TGeoManager::GetMaxXtruVert();
43  fVoxCheckList = new Int_t[maxDaughters];
44  fVoxBits1 = new UChar_t[2 + ((maxDaughters-1)>>3)];
45  fXtruXc = new Double_t[maxXtruVert];
46  fXtruYc = new Double_t[maxXtruVert];
47  fVoxSlices[0] = fVoxSlices[1] = fVoxSlices[2] = -1;
48  fVoxInc[0] = fVoxInc[1] = fVoxInc[2] = 0;
49  fVoxInvdir[0] = fVoxInvdir[1] = fVoxInvdir[2] = 0;
50  fVoxLimits[0] = fVoxLimits[1] = fVoxLimits[2] = 0;
51 }
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Destructor
55 
57 {
58  delete [] fVoxCheckList;
59  delete [] fVoxBits1;
60  delete [] fXtruXc;
61  delete [] fXtruYc;
62 }
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 /// Copy constructor.
66 
68  :fNode(other.fNode),
69  fAsmCurrent(other.fAsmCurrent),
70  fAsmNext(other.fAsmNext),
71  fDivCurrent(other.fDivCurrent),
72  fDivNext(other.fDivNext),
73  fDivTrans(other.fDivTrans),
74  fDivRot(other.fDivRot),
75  fDivCombi(other.fDivCombi),
76  fVoxNcandidates(other.fVoxNcandidates),
77  fVoxCurrent(other.fVoxCurrent),
78  fVoxCheckList(0),
79  fVoxBits1(0),
80  fBoolSelected(other.fBoolSelected),
81  fXtruSeg(other.fXtruSeg),
82  fXtruIz(other.fXtruIz),
83  fXtruXc(0),
84  fXtruYc(0),
85  fXtruPoly(other.fXtruPoly)
86 {
87  Int_t maxDaughters = TGeoManager::GetMaxDaughters();
88  Int_t maxXtruVert = TGeoManager::GetMaxXtruVert();
89  fVoxCheckList = new Int_t[maxDaughters];
90  fVoxBits1 = new UChar_t[1 + ((maxDaughters-1)>>3)];
91  fXtruXc = new Double_t[maxXtruVert];
92  fXtruYc = new Double_t[maxXtruVert];
93  fVoxSlices[0] = fVoxSlices[1] = fVoxSlices[2] = -1;
94  fVoxInc[0] = fVoxInc[1] = fVoxInc[2] = 0;
95  fVoxInvdir[0] = fVoxInvdir[1] = fVoxInvdir[2] = 0;
96  fVoxLimits[0] = fVoxLimits[1] = fVoxLimits[2] = 0;
97 }
98 
99 ////////////////////////////////////////////////////////////////////////////////
100 /// Assignment
101 
103 {
104  if (this==&other) return *this;
105  fNode = other.fNode;
106  fAsmCurrent = other.fAsmCurrent;
107  fAsmNext = other.fAsmNext;
108  fDivCurrent = other.fDivCurrent;
109  fDivNext = other.fDivNext;
110  fDivTrans = other.fDivTrans;
111  fDivRot = other.fDivRot;
112  fDivCombi = other.fDivCombi;
114  fVoxCurrent = other.fVoxCurrent;
116  fVoxBits1 = other.fVoxBits1;
118  fXtruSeg = other.fXtruSeg;
119  fXtruIz = other.fXtruIz;
120  fXtruXc = other.fXtruXc;
121  fXtruYc = other.fXtruYc;
122  fXtruPoly = other.fXtruPoly;
123  fVoxSlices[0] = fVoxSlices[1] = fVoxSlices[2] = -1;
124  fVoxInc[0] = fVoxInc[1] = fVoxInc[2] = 0;
125  fVoxInvdir[0] = fVoxInvdir[1] = fVoxInvdir[2] = 0;
126  fVoxLimits[0] = fVoxLimits[1] = fVoxLimits[2] = 0;
127  return *this;
128 }
Int_t fVoxSlices[3]
Definition: TGeoStateInfo.h:45
Double_t * fXtruYc
Definition: TGeoStateInfo.h:55
Int_t fBoolSelected
Definition: TGeoStateInfo.h:50
virtual ~TGeoStateInfo()
Destructor.
ClassImp(TGeoStateInfo) TGeoStateInfo
Constructor.
int Int_t
Definition: RtypesCore.h:41
UChar_t * fVoxBits1
Definition: TGeoStateInfo.h:44
TGeoCombiTrans fDivCombi
Definition: TGeoStateInfo.h:39
static Int_t GetMaxDaughters()
Return maximum number of daughters of a volume used in the geometry.
TGeoTranslation fDivTrans
Definition: TGeoStateInfo.h:37
Double_t fVoxLimits[3]
Definition: TGeoStateInfo.h:48
Double_t fVoxInvdir[3]
Definition: TGeoStateInfo.h:47
TGeoNode * fNode
Definition: TGeoStateInfo.h:30
Double_t * fXtruXc
Definition: TGeoStateInfo.h:54
Int_t fVoxInc[3]
Definition: TGeoStateInfo.h:46
TGeoRotation fDivRot
Definition: TGeoStateInfo.h:38
double Double_t
Definition: RtypesCore.h:55
Int_t * fVoxCheckList
Definition: TGeoStateInfo.h:43
static Int_t GetMaxXtruVert()
Return maximum number of vertices for an xtru shape used.
unsigned char UChar_t
Definition: RtypesCore.h:34
Int_t fVoxNcandidates
Definition: TGeoStateInfo.h:41
TGeoStateInfo & operator=(const TGeoStateInfo &other)
Assignment.
TGeoPolygon * fXtruPoly
Definition: TGeoStateInfo.h:56
TGeoStateInfo(Int_t maxdaughters=0)