G3VolTableEntry Class Reference

#include <G3VolTableEntry.hh>


Public Member Functions

 G3VolTableEntry (G4String &vname, G4String &shape, G4double *rpar, G4int npar, G4int nmed, G4VSolid *solid, G4bool hasNegPars)
virtual ~G3VolTableEntry ()
G4bool operator== (const G3VolTableEntry &vte) const
void AddG3Pos (G3Pos *aG3Pos)
void AddDaughter (G3VolTableEntry *aDaughter)
void AddMother (G3VolTableEntry *aDaughter)
void AddClone (G3VolTableEntry *aDaughter)
void AddOverlap (G3VolTableEntry *aOverlap)
void ReplaceDaughter (G3VolTableEntry *vteOld, G3VolTableEntry *vteNew)
void ReplaceMother (G3VolTableEntry *vteOld, G3VolTableEntry *vteNew)
G3VolTableEntryFindDaughter (const G4String &vname)
G3VolTableEntryFindMother (const G4String &vname)
G3VolTableEntryFindClone (const G4String &vname)
void PrintSolidInfo ()
void SetName (G4String name)
void SetLV (G4LogicalVolume *lv)
void SetSolid (G4VSolid *solid)
void SetNmed (G4int nmed)
void SetNRpar (G4int npar, G4double *Rpar)
void SetDivision (G3Division *division)
void SetHasNegPars (G4bool hasNegPars)
void SetHasMANY (G4bool hasMANY)
void ClearG3PosCopy (G4int copy)
void ClearDivision ()
G4String GetName ()
G4String GetShape ()
G4int GetNmed ()
G4int GetNpar ()
G4doubleGetRpar ()
G4int NPCopies ()
G3PosGetG3PosCopy (G4int copy=0)
G3DivisionGetDivision ()
G4bool HasNegPars ()
G4bool HasMANY ()
G4VSolidGetSolid ()
G4LogicalVolumeGetLV ()
G4int GetNoDaughters ()
G4int GetNoMothers ()
G4int GetNoClones ()
G4int GetNoOverlaps ()
G3VolTableEntryGetDaughter (G4int i)
G3VolTableEntryGetMother (G4int i)
G3VolTableEntryGetMother ()
G3VolTableEntryGetClone (G4int i)
G3VolTableEntryGetMasterClone ()
std::vector< G3VolTableEntry * > * GetOverlaps ()


Detailed Description

Definition at line 80 of file G3VolTableEntry.hh.


Constructor & Destructor Documentation

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]

Definition at line 54 of file G3VolTableEntry.cc.

00054                                  {
00055   if (fRpar!=0) delete [] fRpar;
00056   delete fDivision;
00057 }


Member Function Documentation

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  ) 

Definition at line 98 of file G3VolTableEntry.cc.

Referenced by G4gsbool().

00098                                                    {
00099     fOverlaps.push_back(overlap);
00100 }

void G3VolTableEntry::ClearDivision (  ) 

Definition at line 223 of file G3VolTableEntry.cc.

Referenced by G3toG4BuildPVTree().

00223                                     {
00224   delete fDivision;
00225   fDivision = 0;
00226 }

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().

00166 { return fDivision; }

G3Pos * G3VolTableEntry::GetG3PosCopy ( G4int  copy = 0  ) 

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().

00282                        {
00283   return fLV;
00284 }

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 (  ) 

Definition at line 324 of file G3VolTableEntry.cc.

Referenced by FindMother().

00324                           {
00325   if (fMothers.size()>0)
00326     return fMothers[0];
00327   else
00328     return 0;  
00329 }

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().

00229                          {
00230   return fVname;
00231 }

G4int G3VolTableEntry::GetNmed (  ) 

Definition at line 239 of file G3VolTableEntry.cc.

Referenced by G3toG4BuildLVTree(), G4CreateCloneVTE(), and G3Division::UpdateVTE().

00239                          {
00240   return fNmed;
00241 }

G4int G3VolTableEntry::GetNoClones (  ) 

Definition at line 297 of file G3VolTableEntry.cc.

Referenced by FindClone(), G3toG4BuildLVTree(), G4CreateCloneVTE(), G4CreateCloneVTEWithDivision(), and G4gspos().

00297                              {
00298   return fClones.size();
00299 }

G4int G3VolTableEntry::GetNoDaughters (  ) 

Definition at line 287 of file G3VolTableEntry.cc.

Referenced by FindDaughter(), G3toG4BuildLVTree(), G3toG4BuildPVTree(), G3toG4MANY(), G4CloneDaughters(), G4ProcessDaughters(), ReplaceDaughter(), and SubstractSolids().

00287                                 {
00288   return fDaughters.size();
00289 }

G4int G3VolTableEntry::GetNoMothers (  ) 

Definition at line 292 of file G3VolTableEntry.cc.

Referenced by FindMother(), G3toG4BuildPVTree(), and ReplaceMother().

00292                               {
00293   return fMothers.size();
00294 }

G4int G3VolTableEntry::GetNoOverlaps (  ) 

Definition at line 302 of file G3VolTableEntry.cc.

Referenced by G3toG4MANY().

00302                                {
00303   return fOverlaps.size();
00304 }

G4int G3VolTableEntry::GetNpar (  ) 

Definition at line 244 of file G3VolTableEntry.cc.

Referenced by G3NegVolPars(), G4CreateCloneVTE(), and G4gspos().

00244                          {
00245   return fNpar;
00246 }

std::vector< G3VolTableEntry * > * G3VolTableEntry::GetOverlaps (  ) 

Definition at line 354 of file G3VolTableEntry.cc.

Referenced by G3toG4MANY().

00354                             {
00355   return &fOverlaps;
00356 }

G4double * G3VolTableEntry::GetRpar (  ) 

Definition at line 249 of file G3VolTableEntry.cc.

Referenced by G3NegVolPars(), G4CreateCloneVTE(), and G4gspos().

00249                          {
00250   return fRpar;
00251 }

G4String G3VolTableEntry::GetShape (  ) 

Definition at line 234 of file G3VolTableEntry.cc.

Referenced by G3Division::CreatePVReplica(), G3NegVolPars(), G4CreateCloneVTE(), and G4CreateCloneVTEWithDivision().

00234                           {
00235   return fShape;
00236 }

G4VSolid * G3VolTableEntry::GetSolid (  ) 

Definition at line 277 of file G3VolTableEntry.cc.

Referenced by G3toG4BuildLVTree(), G3toG4BuildPVTree(), and SubstractSolids().

00277                           {
00278   return fSolid;
00279 }

G4bool G3VolTableEntry::HasMANY (  ) 

Definition at line 272 of file G3VolTableEntry.cc.

Referenced by G3toG4MANY().

00272                         {
00273   return fHasMANY;
00274 }

G4bool G3VolTableEntry::HasNegPars (  ) 

Definition at line 267 of file G3VolTableEntry.cc.

Referenced by G4gspos(), G4ProcessDaughters(), and G3Division::UpdateVTE().

00267                            {
00268   return fHasNegPars;
00269 }

G4int G3VolTableEntry::NPCopies (  ) 

Definition at line 254 of file G3VolTableEntry.cc.

Referenced by G3toG4BuildPVTree(), G3toG4MANY(), and G3VolTable::SetFirstVTE().

00254                           {
00255   return fG3Pos.size();
00256 }

G4bool G3VolTableEntry::operator== ( const G3VolTableEntry vte  )  const [inline]

Definition at line 60 of file G3VolTableEntry.cc.

00060                                                               {
00061   return (this==&lv) ? true : false;
00062 }

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().

00163 { fDivision = division; }

void G3VolTableEntry::SetHasMANY ( G4bool  hasMANY  ) 

Definition at line 209 of file G3VolTableEntry.cc.

Referenced by AddG3Pos().

00209                                                {
00210   fHasMANY = hasMANY;
00211 }

void G3VolTableEntry::SetHasNegPars ( G4bool  hasNegPars  ) 

Definition at line 205 of file G3VolTableEntry.cc.

Referenced by G3Division::G3Division(), and G4CreateCloneVTE().

00205                                                      {
00206   fHasNegPars = hasNegPars;
00207 }

void G3VolTableEntry::SetLV ( G4LogicalVolume lv  ) 

Definition at line 183 of file G3VolTableEntry.cc.

Referenced by G3toG4BuildLVTree().

00183                                          {
00184   fLV = lv;
00185 }

void G3VolTableEntry::SetName ( G4String  name  ) 

Definition at line 178 of file G3VolTableEntry.cc.

Referenced by G4CreateCloneVTE().

00178                                      {
00179   fVname = name;
00180 }

void G3VolTableEntry::SetNmed ( G4int  nmed  ) 

Definition at line 192 of file G3VolTableEntry.cc.

Referenced by G3Division::UpdateVTE().

00192                                         {
00193   fNmed = nmed;
00194 }

void G3VolTableEntry::SetNRpar ( G4int  npar,
G4double Rpar 
)

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().

00188                                         {
00189   fSolid = solid;
00190 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:23 2013 for Geant4 by  doxygen 1.4.7