Warning, file /include/Geant4/G4NavigationLevelRep.icc was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 extern G4GEOM_DLL G4Allocator<G4NavigationLevelRep>*& aNavigLevelRepAllocator();
0032
0033
0034
0035
0036 inline
0037 G4NavigationLevelRep::G4NavigationLevelRep( G4VPhysicalVolume* pPhysVol,
0038 const G4AffineTransform& afTransform,
0039 EVolume volTp,
0040 G4int repNo )
0041 : sTransform(afTransform),
0042 sPhysicalVolumePtr(pPhysVol),
0043 sReplicaNo(repNo),
0044 sVolumeType(volTp)
0045 {
0046 }
0047
0048 inline
0049 G4NavigationLevelRep::G4NavigationLevelRep()
0050 : sVolumeType(kReplica)
0051 {
0052 }
0053
0054 inline
0055 G4NavigationLevelRep::G4NavigationLevelRep( G4VPhysicalVolume* pPhysVol,
0056 const G4AffineTransform& levelAbove,
0057 const G4AffineTransform& relativeCurrent,
0058 EVolume volTp,
0059 G4int repNo )
0060 : sPhysicalVolumePtr(pPhysVol),
0061 sReplicaNo(repNo),
0062 sVolumeType(volTp)
0063 {
0064 sTransform.InverseProduct( levelAbove, relativeCurrent );
0065 }
0066
0067 inline
0068 G4NavigationLevelRep::G4NavigationLevelRep( G4NavigationLevelRep& right )
0069 : sTransform(right.sTransform),
0070 sPhysicalVolumePtr(right.sPhysicalVolumePtr),
0071 sReplicaNo(right.sReplicaNo),
0072 sVolumeType(right.sVolumeType)
0073 {
0074 }
0075
0076
0077
0078
0079 inline
0080 G4NavigationLevelRep::~G4NavigationLevelRep()
0081 {
0082 #ifdef DEBUG_NAVIG_LEVEL
0083 if(fCountRef>0)
0084 {
0085 G4Exception("G4NavigationLevelRep::~G4NavigationLevelRep()",
0086 "GeomVol0003", FatalException,
0087 "Deletion of data-level object with positive reference count.");
0088 }
0089 #endif
0090 }
0091
0092
0093
0094
0095 inline
0096 G4NavigationLevelRep&
0097 G4NavigationLevelRep::operator=( const G4NavigationLevelRep& right )
0098 {
0099 if ( &right != this )
0100 {
0101 sTransform = right.sTransform;
0102 sPhysicalVolumePtr = right.sPhysicalVolumePtr;
0103 sVolumeType = right.sVolumeType;
0104 sReplicaNo = right.sReplicaNo;
0105 fCountRef = right.fCountRef;
0106 }
0107 return *this;
0108 }
0109
0110
0111
0112
0113 inline
0114 G4VPhysicalVolume*
0115 G4NavigationLevelRep::GetPhysicalVolume()
0116 {
0117 return sPhysicalVolumePtr;
0118 }
0119
0120 inline
0121 const G4AffineTransform&
0122 G4NavigationLevelRep::GetTransform() const
0123 {
0124 return sTransform;
0125 }
0126
0127 inline
0128 const G4AffineTransform*
0129 G4NavigationLevelRep::GetTransformPtr() const
0130 {
0131 return &sTransform;
0132 }
0133
0134 inline
0135 EVolume G4NavigationLevelRep::GetVolumeType() const
0136 {
0137 return sVolumeType;
0138 }
0139
0140 inline
0141 G4int G4NavigationLevelRep::GetReplicaNo() const
0142 {
0143 return sReplicaNo;
0144 }
0145
0146 inline
0147 void G4NavigationLevelRep::AddAReference()
0148 {
0149 ++fCountRef;
0150 }
0151
0152 inline
0153 G4bool G4NavigationLevelRep::RemoveAReference()
0154 {
0155 return( --fCountRef <= 0 );
0156 }
0157
0158
0159
0160
0161
0162 inline
0163 void* G4NavigationLevelRep::operator new(size_t)
0164 {
0165 if (aNavigLevelRepAllocator() == nullptr)
0166 {
0167 aNavigLevelRepAllocator() = new G4Allocator<G4NavigationLevelRep>;
0168 }
0169 return (void *) aNavigLevelRepAllocator()->MallocSingle();
0170 }
0171
0172 inline
0173 void G4NavigationLevelRep::operator delete(void* aLevelRep)
0174 {
0175 aNavigLevelRepAllocator()->FreeSingle((G4NavigationLevelRep *) aLevelRep);
0176 }