#include <G3VolTableEntry.hh>
Definition at line 80 of file G3VolTableEntry.hh.
G3VolTableEntry::G3VolTableEntry | ( | G4String & | vname, | |
G4String & | shape, | |||
G4double * | rpar, | |||
G4int | npar, | |||
G4int | nmed, | |||
G4VSolid * | solid, | |||
G4bool | hasNegPars | |||
) |
Definition at line 40 of file G3VolTableEntry.cc.
00043 : fVname(vname), fShape(shape), fRpar(0), fNpar(npar), fNmed(nmed), 00044 fSolid(solid), fLV(0), fHasNegPars(hasNegPars), fHasMANY(false), 00045 fDivision(0) 00046 { 00047 if (npar>0 && rpar!=0) { 00048 fRpar = new G4double[npar]; 00049 for (G4int i=0; i<npar; i++) fRpar[i] = rpar[i]; 00050 } 00051 fClones.push_back(this); 00052 }
G3VolTableEntry::~G3VolTableEntry | ( | ) | [virtual] |
void G3VolTableEntry::AddClone | ( | G3VolTableEntry * | aDaughter | ) |
Definition at line 91 of file G3VolTableEntry.cc.
References FindClone(), and GetName().
Referenced by G4CloneDaughters(), G4CreateCloneVTE(), and G4CreateCloneVTEWithDivision().
00091 { 00092 if (FindClone(itsClone->GetName()) == 0) { 00093 fClones.push_back(itsClone); 00094 } 00095 }
void G3VolTableEntry::AddDaughter | ( | G3VolTableEntry * | aDaughter | ) |
Definition at line 77 of file G3VolTableEntry.cc.
References FindDaughter(), and GetName().
Referenced by G4CloneDaughters(), G4CreateCloneVTEWithDivision(), and G3Division::UpdateVTE().
00077 { 00078 if (FindDaughter(aDaughter->GetName()) == 0) { 00079 fDaughters.push_back(aDaughter); 00080 } 00081 }
void G3VolTableEntry::AddG3Pos | ( | G3Pos * | aG3Pos | ) |
Definition at line 65 of file G3VolTableEntry.cc.
References G3VolTable::CountG3Pos(), G3Vol, G3Pos::GetOnly(), and SetHasMANY().
Referenced by G4CloneDaughters(), G4CreateCloneVTE(), and G4gspos().
00065 { 00066 00067 // insert this position to the vector 00068 G3Vol.CountG3Pos(); 00069 fG3Pos.push_back(aG3Pos); 00070 00071 // pass MANY info 00072 G4String vonly = aG3Pos->GetOnly(); 00073 if (vonly == "MANY") SetHasMANY(true); 00074 }
void G3VolTableEntry::AddMother | ( | G3VolTableEntry * | aDaughter | ) |
Definition at line 84 of file G3VolTableEntry.cc.
References FindMother(), and GetName().
Referenced by G4CloneDaughters(), G4CreateCloneVTE(), G4CreateCloneVTEWithDivision(), G4gspos(), and G3Division::UpdateVTE().
00084 { 00085 if (FindMother(itsMother->GetName()) == 0) { 00086 fMothers.push_back(itsMother); 00087 } 00088 }
void G3VolTableEntry::AddOverlap | ( | G3VolTableEntry * | aOverlap | ) |
void G3VolTableEntry::ClearDivision | ( | ) |
void G3VolTableEntry::ClearG3PosCopy | ( | G4int | copy | ) |
Definition at line 213 of file G3VolTableEntry.cc.
Referenced by G3toG4BuildPVTree().
00213 { 00214 if (fG3Pos.size()>0 && copy>=0 && copy<G4int(fG3Pos.size())) { 00215 std::vector<G3Pos*>::iterator it=fG3Pos.begin(); 00216 for(G4int j=0;j<copy;j++) it++; 00217 if(it!=fG3Pos.end()) { 00218 fG3Pos.erase(it); 00219 } 00220 } 00221 }
G3VolTableEntry * G3VolTableEntry::FindClone | ( | const G4String & | vname | ) |
Definition at line 156 of file G3VolTableEntry.cc.
References GetClone(), and GetNoClones().
Referenced by AddClone().
00156 { 00157 for (G4int i=0; i<GetNoClones(); i++){ 00158 G3VolTableEntry* cvte = GetClone(i); 00159 if (cvte->GetName() == Cname) return cvte; 00160 } 00161 return 0; 00162 }
G3VolTableEntry * G3VolTableEntry::FindDaughter | ( | const G4String & | vname | ) |
Definition at line 139 of file G3VolTableEntry.cc.
References GetDaughter(), GetName(), and GetNoDaughters().
Referenced by AddDaughter().
00139 { 00140 for (G4int idau=0; idau<GetNoDaughters(); idau++){ 00141 if (GetDaughter(idau)->GetName() == Dname) return GetDaughter(idau); 00142 } 00143 return 0; 00144 }
G3VolTableEntry * G3VolTableEntry::FindMother | ( | const G4String & | vname | ) |
Definition at line 147 of file G3VolTableEntry.cc.
References GetMother(), and GetNoMothers().
Referenced by AddMother(), and G3toG4BuildPVTree().
00147 { 00148 for (G4int i=0; i<GetNoMothers(); i++){ 00149 G3VolTableEntry* mvte = GetMother(i); 00150 if (mvte->GetName() == Mname) return mvte; 00151 } 00152 return 0; 00153 }
G3VolTableEntry * G3VolTableEntry::GetClone | ( | G4int | i | ) |
Definition at line 332 of file G3VolTableEntry.cc.
Referenced by FindClone(), G4CreateCloneVTE(), G4CreateCloneVTEWithDivision(), and G4gspos().
00332 { 00333 if (i<G4int(fClones.size()) && i>=0) 00334 return fClones[i]; 00335 else 00336 return 0; 00337 }
G3VolTableEntry * G3VolTableEntry::GetDaughter | ( | G4int | i | ) |
Definition at line 307 of file G3VolTableEntry.cc.
Referenced by FindDaughter(), G3toG4BuildLVTree(), G3toG4BuildPVTree(), G3toG4MANY(), G4CloneDaughters(), G4ProcessDaughters(), and SubstractSolids().
00307 { 00308 if (i<G4int(fDaughters.size()) && i>=0) 00309 return fDaughters[i]; 00310 else 00311 return 0; 00312 }
G3Division * G3VolTableEntry::GetDivision | ( | ) | [inline] |
Definition at line 165 of file G3VolTableEntry.hh.
Referenced by G3toG4BuildLVTree(), G3toG4BuildPVTree(), and G4ProcessDaughters().
Definition at line 259 of file G3VolTableEntry.cc.
Referenced by G3toG4BuildPVTree(), G3toG4MANY(), and SubstractSolids().
00259 { 00260 if (fG3Pos.size()>0 && copy>=0) 00261 return fG3Pos[copy]; 00262 else 00263 return 0; 00264 }
G4LogicalVolume * G3VolTableEntry::GetLV | ( | ) |
Definition at line 282 of file G3VolTableEntry.cc.
Referenced by G3Division::CreatePVReplica(), G3toG4BuildLVTree(), G3toG4BuildPVTree(), and G4BuildGeom().
G3VolTableEntry * G3VolTableEntry::GetMasterClone | ( | ) |
Definition at line 340 of file G3VolTableEntry.cc.
References G4String::contains(), G4String::first(), G3Vol, G3VolTable::GetVTE(), and gSeparator.
Referenced by G3toG4BuildLVTree(), and G4CloneDaughters().
00340 { 00341 G3VolTableEntry* master; 00342 G4String name = fVname; 00343 if (name.contains(gSeparator)) { 00344 name = name(0, name.first(gSeparator)); 00345 master = G3Vol.GetVTE(name); 00346 } 00347 else 00348 master = this; 00349 00350 return master; 00351 }
G3VolTableEntry * G3VolTableEntry::GetMother | ( | ) |
G3VolTableEntry * G3VolTableEntry::GetMother | ( | G4int | i | ) |
Definition at line 315 of file G3VolTableEntry.cc.
Referenced by G3toG4BuildPVTree(), and G3VolTable::SetFirstVTE().
00315 { 00316 if (i<G4int(fMothers.size()) && i>=0) 00317 return fMothers[i]; 00318 else 00319 return 0; 00320 }
G4String G3VolTableEntry::GetName | ( | ) |
Definition at line 229 of file G3VolTableEntry.cc.
Referenced by AddClone(), AddDaughter(), AddMother(), G3Division::CreatePVReplica(), FindDaughter(), G3toG4BuildLVTree(), G3toG4BuildPVTree(), G3toG4MANY(), G4BuildGeom(), G4CreateCloneVTE(), MakeBooleanSolids(), G3VolTable::PutVTE(), ReplaceDaughter(), ReplaceMother(), G3VolTable::SetFirstVTE(), and SubstractSolids().
G4int G3VolTableEntry::GetNmed | ( | ) |
Definition at line 239 of file G3VolTableEntry.cc.
Referenced by G3toG4BuildLVTree(), G4CreateCloneVTE(), and G3Division::UpdateVTE().
G4int G3VolTableEntry::GetNoClones | ( | ) |
Definition at line 297 of file G3VolTableEntry.cc.
Referenced by FindClone(), G3toG4BuildLVTree(), G4CreateCloneVTE(), G4CreateCloneVTEWithDivision(), and G4gspos().
G4int G3VolTableEntry::GetNoDaughters | ( | ) |
Definition at line 287 of file G3VolTableEntry.cc.
Referenced by FindDaughter(), G3toG4BuildLVTree(), G3toG4BuildPVTree(), G3toG4MANY(), G4CloneDaughters(), G4ProcessDaughters(), ReplaceDaughter(), and SubstractSolids().
G4int G3VolTableEntry::GetNoMothers | ( | ) |
Definition at line 292 of file G3VolTableEntry.cc.
Referenced by FindMother(), G3toG4BuildPVTree(), and ReplaceMother().
G4int G3VolTableEntry::GetNoOverlaps | ( | ) |
G4int G3VolTableEntry::GetNpar | ( | ) |
Definition at line 244 of file G3VolTableEntry.cc.
Referenced by G3NegVolPars(), G4CreateCloneVTE(), and G4gspos().
std::vector< G3VolTableEntry * > * G3VolTableEntry::GetOverlaps | ( | ) |
G4double * G3VolTableEntry::GetRpar | ( | ) |
Definition at line 249 of file G3VolTableEntry.cc.
Referenced by G3NegVolPars(), G4CreateCloneVTE(), and G4gspos().
G4String G3VolTableEntry::GetShape | ( | ) |
Definition at line 234 of file G3VolTableEntry.cc.
Referenced by G3Division::CreatePVReplica(), G3NegVolPars(), G4CreateCloneVTE(), and G4CreateCloneVTEWithDivision().
G4VSolid * G3VolTableEntry::GetSolid | ( | ) |
Definition at line 277 of file G3VolTableEntry.cc.
Referenced by G3toG4BuildLVTree(), G3toG4BuildPVTree(), and SubstractSolids().
G4bool G3VolTableEntry::HasMANY | ( | ) |
G4bool G3VolTableEntry::HasNegPars | ( | ) |
Definition at line 267 of file G3VolTableEntry.cc.
Referenced by G4gspos(), G4ProcessDaughters(), and G3Division::UpdateVTE().
G4int G3VolTableEntry::NPCopies | ( | ) |
Definition at line 254 of file G3VolTableEntry.cc.
Referenced by G3toG4BuildPVTree(), G3toG4MANY(), and G3VolTable::SetFirstVTE().
G4bool G3VolTableEntry::operator== | ( | const G3VolTableEntry & | vte | ) | const [inline] |
void G3VolTableEntry::PrintSolidInfo | ( | ) |
Definition at line 164 of file G3VolTableEntry.cc.
References G4cout, and G4endl.
00164 { 00165 // only parameters related to solid definition 00166 // are printed 00167 G4cout << "VTE: " << fVname << " " << this << G4endl; 00168 G4cout << "Solid: " << fSolid << G4endl; 00169 G4cout << "Parameters (npar = " << fNpar << ") fRpar: "; 00170 for (G4int i=0; i<fNpar; i++) G4cout << fRpar[i] << " "; 00171 G4cout << G4endl; 00172 G4cout << "HasNegPars: " << fHasNegPars << G4endl; 00173 G4cout << "HasMANY: " << fHasMANY << G4endl; 00174 G4cout << "================================= " << G4endl; 00175 }
void G3VolTableEntry::ReplaceDaughter | ( | G3VolTableEntry * | vteOld, | |
G3VolTableEntry * | vteNew | |||
) |
Definition at line 103 of file G3VolTableEntry.cc.
References FatalException, G4Exception(), GetName(), and GetNoDaughters().
Referenced by G3Division::UpdateVTE().
00105 { 00106 G4int index = -1; 00107 for (G4int i=0; i<GetNoDaughters(); i++){ 00108 if (fDaughters[i]->GetName() == vteOld->GetName()) index = i; 00109 } 00110 if (index<0) { 00111 G4String err_message = "Old daughter " + vteOld->GetName() 00112 + " does not exist."; 00113 G4Exception("G3VolTableEntry::ReplaceDaughter()", "G3toG40007", 00114 FatalException, err_message); 00115 return; 00116 } 00117 fDaughters[index] = vteNew; 00118 }
void G3VolTableEntry::ReplaceMother | ( | G3VolTableEntry * | vteOld, | |
G3VolTableEntry * | vteNew | |||
) |
Definition at line 121 of file G3VolTableEntry.cc.
References FatalException, G4Exception(), GetName(), and GetNoMothers().
00123 { 00124 G4int index = -1; 00125 for (G4int i=0; i<GetNoMothers(); i++){ 00126 if (fMothers[i]->GetName() == vteOld->GetName()) index = i; 00127 } 00128 if (index<0) { 00129 G4String err_message = "Old mother " + vteOld->GetName() 00130 + " does not exist."; 00131 G4Exception("G3VolTableEntry::ReplaceMother()", "G3toG40008", 00132 FatalException, err_message); 00133 return; 00134 } 00135 fMothers[index] = vteNew; 00136 }
void G3VolTableEntry::SetDivision | ( | G3Division * | division | ) | [inline] |
Definition at line 162 of file G3VolTableEntry.hh.
Referenced by G4CloneDaughters(), and G4CreateCloneVTEWithDivision().
void G3VolTableEntry::SetHasMANY | ( | G4bool | hasMANY | ) |
void G3VolTableEntry::SetHasNegPars | ( | G4bool | hasNegPars | ) |
Definition at line 205 of file G3VolTableEntry.cc.
Referenced by G3Division::G3Division(), and G4CreateCloneVTE().
void G3VolTableEntry::SetLV | ( | G4LogicalVolume * | lv | ) |
void G3VolTableEntry::SetName | ( | G4String | name | ) |
void G3VolTableEntry::SetNmed | ( | G4int | nmed | ) |
Definition at line 196 of file G3VolTableEntry.cc.
00196 { 00197 if (npar != fNpar) { 00198 fNpar = npar; 00199 delete [] fRpar; 00200 fRpar = new G4double[fNpar]; 00201 } 00202 for (G4int i=0; i<fNpar; i++) fRpar[i] = rpar[i]; 00203 }
void G3VolTableEntry::SetSolid | ( | G4VSolid * | solid | ) |
Definition at line 188 of file G3VolTableEntry.cc.
Referenced by G4CreateCloneVTE(), and SubstractSolids().