#include <G4AssemblyVolume.hh>
Public Member Functions | |
G4AssemblyVolume () | |
G4AssemblyVolume (G4LogicalVolume *volume, G4ThreeVector &translation, G4RotationMatrix *rotation) | |
~G4AssemblyVolume () | |
void | AddPlacedVolume (G4LogicalVolume *pPlacedVolume, G4ThreeVector &translation, G4RotationMatrix *rotation) |
void | AddPlacedVolume (G4LogicalVolume *pPlacedVolume, G4Transform3D &transformation) |
void | AddPlacedAssembly (G4AssemblyVolume *pAssembly, G4Transform3D &transformation) |
void | AddPlacedAssembly (G4AssemblyVolume *pAssembly, G4ThreeVector &translation, G4RotationMatrix *rotation) |
void | MakeImprint (G4LogicalVolume *pMotherLV, G4ThreeVector &translationInMother, G4RotationMatrix *pRotationInMother, G4int copyNumBase=0, G4bool surfCheck=false) |
void | MakeImprint (G4LogicalVolume *pMotherLV, G4Transform3D &transformation, G4int copyNumBase=0, G4bool surfCheck=false) |
std::vector< G4VPhysicalVolume * >::iterator | GetVolumesIterator () |
unsigned int | TotalImprintedVolumes () const |
unsigned int | GetImprintsCount () const |
unsigned int | GetInstanceCount () const |
unsigned int | GetAssemblyID () const |
Protected Member Functions | |
void | SetInstanceCount (unsigned int value) |
void | SetAssemblyID (unsigned int value) |
void | InstanceCountPlus () |
void | InstanceCountMinus () |
void | SetImprintsCount (unsigned int value) |
void | ImprintsCountPlus () |
void | ImprintsCountMinus () |
Definition at line 60 of file G4AssemblyVolume.hh.
G4AssemblyVolume::G4AssemblyVolume | ( | ) |
Definition at line 48 of file G4AssemblyVolume.cc.
References GetInstanceCount(), InstanceCountPlus(), SetAssemblyID(), and SetImprintsCount().
00049 : fAssemblyID( 0 ) 00050 { 00051 InstanceCountPlus(); 00052 SetAssemblyID( GetInstanceCount() ); 00053 SetImprintsCount( 0 ); 00054 }
G4AssemblyVolume::G4AssemblyVolume | ( | G4LogicalVolume * | volume, | |
G4ThreeVector & | translation, | |||
G4RotationMatrix * | rotation | |||
) |
Definition at line 58 of file G4AssemblyVolume.cc.
References AddPlacedVolume(), GetInstanceCount(), InstanceCountPlus(), SetAssemblyID(), and SetImprintsCount().
00061 : fAssemblyID( 0 ) 00062 { 00063 InstanceCountPlus(); 00064 SetAssemblyID( GetInstanceCount() ); 00065 SetImprintsCount( 0 ); 00066 AddPlacedVolume(volume, translation, rotation); 00067 }
G4AssemblyVolume::~G4AssemblyVolume | ( | ) |
Definition at line 71 of file G4AssemblyVolume.cc.
References InstanceCountMinus().
00072 { 00073 unsigned int howmany = fTriplets.size(); 00074 if( howmany != 0 ) 00075 { 00076 for( unsigned int i = 0; i < howmany; i++ ) 00077 { 00078 G4RotationMatrix* pRotToClean = fTriplets[i].GetRotation(); 00079 if( pRotToClean != 0 ) 00080 { 00081 delete pRotToClean; 00082 } 00083 } 00084 } 00085 fTriplets.clear(); 00086 00087 howmany = fPVStore.size(); 00088 if( howmany != 0 ) 00089 { 00090 for( unsigned int j = 0; j < howmany; j++ ) 00091 { 00092 delete fPVStore[j]; 00093 } 00094 } 00095 fPVStore.clear(); 00096 InstanceCountMinus(); 00097 }
void G4AssemblyVolume::AddPlacedAssembly | ( | G4AssemblyVolume * | pAssembly, | |
G4ThreeVector & | translation, | |||
G4RotationMatrix * | rotation | |||
) |
Definition at line 146 of file G4AssemblyVolume.cc.
00149 { 00150 G4RotationMatrix* toStore = new G4RotationMatrix; 00151 00152 if( pRotation != 0 ) { *toStore = *pRotation; } 00153 00154 G4AssemblyTriplet toAdd( pAssembly, translation, toStore ); 00155 fTriplets.push_back( toAdd ); 00156 }
void G4AssemblyVolume::AddPlacedAssembly | ( | G4AssemblyVolume * | pAssembly, | |
G4Transform3D & | transformation | |||
) |
Definition at line 161 of file G4AssemblyVolume.cc.
00163 { 00164 // Decompose transformation 00165 // 00166 G4Scale3D scale; 00167 G4Rotate3D rotation; 00168 G4Translate3D translation; 00169 transformation.getDecomposition(scale, rotation, translation); 00170 00171 G4ThreeVector v = translation.getTranslation(); 00172 G4RotationMatrix* r = new G4RotationMatrix; 00173 *r = rotation.getRotation(); 00174 00175 G4bool isReflection = false; 00176 if (scale(0,0)*scale(1,1)*scale(2,2) < 0.) { isReflection = true; } 00177 00178 G4AssemblyTriplet toAdd( pAssembly, v, r, isReflection ); 00179 fTriplets.push_back( toAdd ); 00180 }
void G4AssemblyVolume::AddPlacedVolume | ( | G4LogicalVolume * | pPlacedVolume, | |
G4Transform3D & | transformation | |||
) |
Definition at line 123 of file G4AssemblyVolume.cc.
00125 { 00126 // Decompose transformation 00127 G4Scale3D scale; 00128 G4Rotate3D rotation; 00129 G4Translate3D translation; 00130 transformation.getDecomposition(scale, rotation, translation); 00131 00132 G4ThreeVector v = translation.getTranslation(); 00133 G4RotationMatrix* r = new G4RotationMatrix; 00134 *r = rotation.getRotation(); 00135 00136 G4bool isReflection = false; 00137 if (scale(0,0)*scale(1,1)*scale(2,2) < 0.) { isReflection = true; } 00138 00139 G4AssemblyTriplet toAdd( pVolume, v, r, isReflection ); 00140 fTriplets.push_back( toAdd ); 00141 }
void G4AssemblyVolume::AddPlacedVolume | ( | G4LogicalVolume * | pPlacedVolume, | |
G4ThreeVector & | translation, | |||
G4RotationMatrix * | rotation | |||
) |
Definition at line 109 of file G4AssemblyVolume.cc.
Referenced by G4tgbVolume::ConstructG4PhysVol(), G4AssemblyVolume(), and G4GDMLReadStructure::PhysvolRead().
00112 { 00113 G4RotationMatrix* toStore = new G4RotationMatrix; 00114 00115 if( pRotation != 0 ) { *toStore = *pRotation; } 00116 00117 G4AssemblyTriplet toAdd( pVolume, translation, toStore ); 00118 fTriplets.push_back( toAdd ); 00119 }
unsigned int G4AssemblyVolume::GetAssemblyID | ( | ) | const [inline] |
unsigned int G4AssemblyVolume::GetImprintsCount | ( | ) | const [inline] |
unsigned int G4AssemblyVolume::GetInstanceCount | ( | ) | const |
std::vector< G4VPhysicalVolume * >::iterator G4AssemblyVolume::GetVolumesIterator | ( | ) | [inline] |
Definition at line 73 of file G4AssemblyVolume.icc.
00074 { 00075 std::vector<G4VPhysicalVolume*>::iterator iterator = fPVStore.begin(); 00076 return iterator; 00077 }
void G4AssemblyVolume::ImprintsCountMinus | ( | ) | [inline, protected] |
void G4AssemblyVolume::ImprintsCountPlus | ( | ) | [inline, protected] |
void G4AssemblyVolume::InstanceCountMinus | ( | ) | [protected] |
void G4AssemblyVolume::InstanceCountPlus | ( | ) | [protected] |
void G4AssemblyVolume::MakeImprint | ( | G4LogicalVolume * | pMotherLV, | |
G4Transform3D & | transformation, | |||
G4int | copyNumBase = 0 , |
|||
G4bool | surfCheck = false | |||
) |
Definition at line 337 of file G4AssemblyVolume.cc.
References MakeImprint().
00341 { 00342 // If needed user can specify explicitely the base count from which to start 00343 // off for the generation of phys. vol. copy numbers. 00344 // The old behaviour is preserved when copyNumBase == 0, e.g. the generated 00345 // copy numbers start from the count equal to current number of daughter 00346 // volumes before a imprint is made 00347 00348 MakeImprint(this, pMotherLV, transformation, copyNumBase, surfCheck); 00349 }
void G4AssemblyVolume::MakeImprint | ( | G4LogicalVolume * | pMotherLV, | |
G4ThreeVector & | translationInMother, | |||
G4RotationMatrix * | pRotationInMother, | |||
G4int | copyNumBase = 0 , |
|||
G4bool | surfCheck = false | |||
) |
Definition at line 310 of file G4AssemblyVolume.cc.
Referenced by G4tgbVolume::ConstructG4PhysVol(), MakeImprint(), and G4GDMLReadStructure::PhysvolRead().
00315 { 00316 // If needed user can specify explicitely the base count from which to start 00317 // off for the generation of phys. vol. copy numbers. 00318 // The old behaviour is preserved when copyNumBase == 0, e.g. the generated 00319 // copy numbers start from the count equal to current number of daughter 00320 // volumes before an imprint is made 00321 00322 // Compose transformation 00323 // 00324 if( pRotationInMother == 0 ) 00325 { 00326 // Make it by default an indentity matrix 00327 // 00328 pRotationInMother = 00329 const_cast<G4RotationMatrix*>( &G4RotationMatrix::IDENTITY ); 00330 } 00331 00332 G4Transform3D transform( *pRotationInMother, 00333 translationInMother ); 00334 MakeImprint(this, pMotherLV, transform, copyNumBase, surfCheck); 00335 }
void G4AssemblyVolume::SetAssemblyID | ( | unsigned int | value | ) | [inline, protected] |
void G4AssemblyVolume::SetImprintsCount | ( | unsigned int | value | ) | [inline, protected] |
void G4AssemblyVolume::SetInstanceCount | ( | unsigned int | value | ) | [protected] |
unsigned int G4AssemblyVolume::TotalImprintedVolumes | ( | ) | const [inline] |