Logo ROOT   6.10/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 
14 #include "Rtypes.h"
15 #include "TGeoNode.h"
16 #include "TGeoManager.h"
17 #include "TGeoPolygon.h"
18 
19 /** \class TGeoStateInfo
20 \ingroup Geometry_classes
21 Statefull info for the current geometry level.
22 */
23 
25 
26 ////////////////////////////////////////////////////////////////////////////////
27 /// Constructor
28 
30  :fNode(0),
31  fAsmCurrent(0),
32  fAsmNext(0),
33  fDivCurrent(0),
34  fDivNext(0),
35  fDivTrans(),
36  fDivRot(),
37  fDivCombi(),
38  fVoxNcandidates(0),
39  fVoxCurrent(0),
40  fVoxCheckList(0),
41  fVoxBits1(0),
42  fBoolSelected(0),
43  fXtruSeg(0),
44  fXtruIz(0),
45  fXtruXc(0),
46  fXtruYc(0),
47  fXtruPoly(0)
48 {
49  Int_t maxDaughters = (maxdaughters>0) ? maxdaughters : TGeoManager::GetMaxDaughters();
50  Int_t maxXtruVert = TGeoManager::GetMaxXtruVert();
51  fVoxCheckList = new Int_t[maxDaughters];
52  fVoxBits1 = new UChar_t[2 + ((maxDaughters-1)>>3)];
53  fXtruXc = new Double_t[maxXtruVert];
54  fXtruYc = new Double_t[maxXtruVert];
55  fVoxSlices[0] = fVoxSlices[1] = fVoxSlices[2] = -1;
56  fVoxInc[0] = fVoxInc[1] = fVoxInc[2] = 0;
57  fVoxInvdir[0] = fVoxInvdir[1] = fVoxInvdir[2] = 0;
58  fVoxLimits[0] = fVoxLimits[1] = fVoxLimits[2] = 0;
59 }
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Destructor
63 
65 {
66  delete [] fVoxCheckList;
67  delete [] fVoxBits1;
68  delete [] fXtruXc;
69  delete [] fXtruYc;
70 }
71 
72 ////////////////////////////////////////////////////////////////////////////////
73 /// Copy constructor.
74 
76  :fNode(other.fNode),
77  fAsmCurrent(other.fAsmCurrent),
78  fAsmNext(other.fAsmNext),
79  fDivCurrent(other.fDivCurrent),
80  fDivNext(other.fDivNext),
81  fDivTrans(other.fDivTrans),
82  fDivRot(other.fDivRot),
83  fDivCombi(other.fDivCombi),
85  fVoxCurrent(other.fVoxCurrent),
86  fVoxCheckList(0),
87  fVoxBits1(0),
89  fXtruSeg(other.fXtruSeg),
90  fXtruIz(other.fXtruIz),
91  fXtruXc(0),
92  fXtruYc(0),
93  fXtruPoly(other.fXtruPoly)
94 {
95  Int_t maxDaughters = TGeoManager::GetMaxDaughters();
96  Int_t maxXtruVert = TGeoManager::GetMaxXtruVert();
97  fVoxCheckList = new Int_t[maxDaughters];
98  fVoxBits1 = new UChar_t[1 + ((maxDaughters-1)>>3)];
99  fXtruXc = new Double_t[maxXtruVert];
100  fXtruYc = new Double_t[maxXtruVert];
101  fVoxSlices[0] = fVoxSlices[1] = fVoxSlices[2] = -1;
102  fVoxInc[0] = fVoxInc[1] = fVoxInc[2] = 0;
103  fVoxInvdir[0] = fVoxInvdir[1] = fVoxInvdir[2] = 0;
104  fVoxLimits[0] = fVoxLimits[1] = fVoxLimits[2] = 0;
105 }
106 
107 ////////////////////////////////////////////////////////////////////////////////
108 /// Assignment
109 
111 {
112  if (this==&other) return *this;
113  fNode = other.fNode;
114  fAsmCurrent = other.fAsmCurrent;
115  fAsmNext = other.fAsmNext;
116  fDivCurrent = other.fDivCurrent;
117  fDivNext = other.fDivNext;
118  fDivTrans = other.fDivTrans;
119  fDivRot = other.fDivRot;
120  fDivCombi = other.fDivCombi;
122  fVoxCurrent = other.fVoxCurrent;
124  fVoxBits1 = other.fVoxBits1;
126  fXtruSeg = other.fXtruSeg;
127  fXtruIz = other.fXtruIz;
128  fXtruXc = other.fXtruXc;
129  fXtruYc = other.fXtruYc;
130  fXtruPoly = other.fXtruPoly;
131  fVoxSlices[0] = fVoxSlices[1] = fVoxSlices[2] = -1;
132  fVoxInc[0] = fVoxInc[1] = fVoxInc[2] = 0;
133  fVoxInvdir[0] = fVoxInvdir[1] = fVoxInvdir[2] = 0;
134  fVoxLimits[0] = fVoxLimits[1] = fVoxLimits[2] = 0;
135  return *this;
136 }
Statefull info for the current geometry level.
Definition: TGeoStateInfo.h:21
Int_t fVoxSlices[3]
Definition: TGeoStateInfo.h:37
Double_t * fXtruYc
Definition: TGeoStateInfo.h:47
Int_t fBoolSelected
Definition: TGeoStateInfo.h:42
virtual ~TGeoStateInfo()
Destructor.
int Int_t
Definition: RtypesCore.h:41
UChar_t * fVoxBits1
Definition: TGeoStateInfo.h:36
TGeoCombiTrans fDivCombi
Definition: TGeoStateInfo.h:31
static Int_t GetMaxDaughters()
Return maximum number of daughters of a volume used in the geometry.
TGeoTranslation fDivTrans
Definition: TGeoStateInfo.h:29
Double_t fVoxLimits[3]
Definition: TGeoStateInfo.h:40
Double_t fVoxInvdir[3]
Definition: TGeoStateInfo.h:39
TGeoNode * fNode
Definition: TGeoStateInfo.h:22
Double_t * fXtruXc
Definition: TGeoStateInfo.h:46
Int_t fVoxInc[3]
Definition: TGeoStateInfo.h:38
#define ClassImp(name)
Definition: Rtypes.h:336
TGeoRotation fDivRot
Definition: TGeoStateInfo.h:30
double Double_t
Definition: RtypesCore.h:55
Int_t * fVoxCheckList
Definition: TGeoStateInfo.h:35
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:33
TGeoStateInfo & operator=(const TGeoStateInfo &other)
Assignment.
TGeoPolygon * fXtruPoly
Definition: TGeoStateInfo.h:48
TGeoStateInfo(Int_t maxdaughters=0)
Constructor.