Import Geant4 11.0.2 source tree
This commit is contained in:
@@ -216,11 +216,12 @@ void G4LogicalVolumeStore::DeRegister(G4LogicalVolume* pVolume)
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
// Retrieve the first volume pointer in the container having that name
|
||||
// Retrieve the first or last volume pointer in the container having that name
|
||||
// ***************************************************************************
|
||||
//
|
||||
G4LogicalVolume*
|
||||
G4LogicalVolumeStore::GetVolume(const G4String& name, G4bool verbose) const
|
||||
G4LogicalVolumeStore::GetVolume(const G4String& name, G4bool verbose,
|
||||
G4bool reverseSearch) const
|
||||
{
|
||||
G4LogicalVolumeStore* store = GetInstance();
|
||||
if (!store->mvalid) { store->UpdateMap(); }
|
||||
@@ -236,7 +237,14 @@ G4LogicalVolumeStore::GetVolume(const G4String& name, G4bool verbose) const
|
||||
G4Exception("G4LogicalVolumeStore::GetVolume()",
|
||||
"GeomMgt1001", JustWarning, message);
|
||||
}
|
||||
return pos->second[0];
|
||||
if(reverseSearch)
|
||||
{
|
||||
return pos->second[pos->second.size()-1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return pos->second[0];
|
||||
}
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
|
||||
@@ -220,11 +220,12 @@ void G4PhysicalVolumeStore::DeRegister(G4VPhysicalVolume* pVolume)
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
// Retrieve the first volume pointer in the container having that name
|
||||
// Retrieve the first or last volume pointer in the container having that name
|
||||
// ***************************************************************************
|
||||
//
|
||||
G4VPhysicalVolume*
|
||||
G4PhysicalVolumeStore::GetVolume(const G4String& name, G4bool verbose) const
|
||||
G4PhysicalVolumeStore::GetVolume(const G4String& name, G4bool verbose,
|
||||
G4bool reverseSearch) const
|
||||
{
|
||||
G4PhysicalVolumeStore* store = GetInstance();
|
||||
if (!store->mvalid) { store->UpdateMap(); }
|
||||
@@ -240,7 +241,14 @@ G4PhysicalVolumeStore::GetVolume(const G4String& name, G4bool verbose) const
|
||||
G4Exception("G4PhysicalVolumeStore::GetVolume()",
|
||||
"GeomMgt1001", JustWarning, message);
|
||||
}
|
||||
return pos->second[0];
|
||||
if(reverseSearch)
|
||||
{
|
||||
return pos->second[pos->second.size()-1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return pos->second[0];
|
||||
}
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
|
||||
@@ -215,10 +215,11 @@ void G4SolidStore::DeRegister(G4VSolid* pSolid)
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
// Retrieve the first solid pointer in the container having that name
|
||||
// Retrieve the first or last solid pointer in the container having that name
|
||||
// ***************************************************************************
|
||||
//
|
||||
G4VSolid* G4SolidStore::GetSolid(const G4String& name, G4bool verbose) const
|
||||
G4VSolid* G4SolidStore::GetSolid(const G4String& name, G4bool verbose,
|
||||
G4bool reverseSearch) const
|
||||
{
|
||||
G4SolidStore* store = GetInstance();
|
||||
if (!store->mvalid) { store->UpdateMap(); }
|
||||
@@ -234,7 +235,14 @@ G4VSolid* G4SolidStore::GetSolid(const G4String& name, G4bool verbose) const
|
||||
G4Exception("G4SolidStore::GetSolid()",
|
||||
"GeomMgt1001", JustWarning, message);
|
||||
}
|
||||
return pos->second[0];
|
||||
if(reverseSearch)
|
||||
{
|
||||
return pos->second[pos->second.size()-1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return pos->second[0];
|
||||
}
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user