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