Import Geant4 11.0.2 source tree
This commit is contained in:
@@ -16,6 +16,10 @@ commit in the repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
March 5 2022 M.Asai (geommng-V10-07-08)
|
||||
- G4SolidStore, G4LogicalVolumeStore, G4PhysicalVolumeStore:
|
||||
extend getter methods to optionally return the last-found object.
|
||||
|
||||
September 28, 2021 G.Cosmo (geommng-V10-07-07)
|
||||
- Use G4Allocator to dynamically allocate nodes and proxies for the
|
||||
voxels optimisation structure. Should help reducing memory fragmentation.
|
||||
|
||||
@@ -67,8 +67,9 @@ class G4LogicalVolumeStore : public std::vector<G4LogicalVolume*>
|
||||
static void Clean();
|
||||
// Delete all volumes from the store.
|
||||
|
||||
G4LogicalVolume* GetVolume(const G4String& name, G4bool verbose=true) const;
|
||||
// Return the pointer of the first volume in the collection having
|
||||
G4LogicalVolume* GetVolume(const G4String& name, G4bool verbose=true,
|
||||
G4bool reverseSearch=false) const;
|
||||
// Return the pointer of the first or last volume in the collection having
|
||||
// that name. Uses the internal map for fast search and warns if
|
||||
// a volume in the collection is not unique or not found.
|
||||
|
||||
|
||||
@@ -68,8 +68,9 @@ class G4PhysicalVolumeStore : public std::vector<G4VPhysicalVolume*>
|
||||
// are automatically notified and have their daughters de-registered.
|
||||
|
||||
G4VPhysicalVolume* GetVolume(const G4String& name,
|
||||
G4bool verbose = true) const;
|
||||
// Return the pointer of the first volume in the collection having
|
||||
G4bool verbose = true,
|
||||
G4bool reverseSearch = false) const;
|
||||
// Return the pointer of the first or last volume in the collection having
|
||||
// that name. Uses the internal map for fast search and warns if
|
||||
// a volume in the collection is not unique or not found.
|
||||
|
||||
|
||||
@@ -66,8 +66,9 @@ class G4SolidStore : public std::vector<G4VSolid*>
|
||||
static void Clean();
|
||||
// Delete all solids from the store.
|
||||
|
||||
G4VSolid* GetSolid(const G4String& name, G4bool verbose = true) const;
|
||||
// Return the pointer of the first solid in the collection having
|
||||
G4VSolid* GetSolid(const G4String& name, G4bool verbose = true,
|
||||
G4bool reverseSearch = false) const;
|
||||
// Return the pointer of the first or last solid in the collection having
|
||||
// that name. Uses the internal map for fast search and warns if
|
||||
// a solid in the collection is not unique or not found.
|
||||
|
||||
|
||||
@@ -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