|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4LogicalVolumeStore is a singleton class, acting as container for all solids primitives, with functionality derived from std::vector<T>. All solids should be registered with G4SolidStore, and removed on their destruction. The underlying container initially has a capacity of 100. A map indexed by solid names is also recorded for fast search; pointers to solids with same name are stored in buckets. More...
#include <G4SolidStore.hh>
Public Member Functions | |
| virtual | ~G4SolidStore () |
| G4SolidStore (const G4SolidStore &)=delete | |
| G4SolidStore & | operator= (const G4SolidStore &)=delete |
| G4VSolid * | GetSolid (const G4String &name, G4bool verbose=true, G4bool reverseSearch=false) const |
| G4bool | IsMapValid () const |
| void | SetMapValid (G4bool val) |
| const std::map< G4String, std::vector< G4VSolid * > > & | GetMap () const |
| void | UpdateMap () |
Static Public Member Functions | |
| static void | Register (G4VSolid *pSolid) |
| static void | DeRegister (G4VSolid *pSolid) |
| static G4SolidStore * | GetInstance () |
| static void | SetNotifier (G4VStoreNotifier *pNotifier) |
| static void | Clean () |
Protected Member Functions | |
| G4SolidStore () | |
G4LogicalVolumeStore is a singleton class, acting as container for all solids primitives, with functionality derived from std::vector<T>. All solids should be registered with G4SolidStore, and removed on their destruction. The underlying container initially has a capacity of 100. A map indexed by solid names is also recorded for fast search; pointers to solids with same name are stored in buckets.
Definition at line 63 of file G4SolidStore.hh.
|
virtual |
Destructor: takes care to delete allocated solids.
Definition at line 65 of file G4SolidStore.cc.
|
delete |
Copy constructor and assignment operator not allowed.
Referenced by Clean(), DeRegister(), G4SolidStore(), GetInstance(), GetSolid(), operator=(), and Register().
|
protected |
Protected singleton constructor.
Definition at line 55 of file G4SolidStore.cc.
|
static |
Deletes all solids from the store.
Definition at line 74 of file G4SolidStore.cc.
Referenced by G4RunManager::ReinitializeGeometry(), and ~G4SolidStore().
|
static |
Removes the solid 'pSolid' from the collection.
Definition at line 167 of file G4SolidStore.cc.
Referenced by G4Voxelizer::G4Voxelizer(), and G4VSolid::~G4VSolid().
|
static |
Returns a pointer to the unique instance of G4SolidStore, creating it if necessary.
Definition at line 247 of file G4SolidStore.cc.
Referenced by Clean(), DeRegister(), G4Voxelizer::G4Voxelizer(), G4VSolid::G4VSolid(), G4VSolid::G4VSolid(), G4VSolid::G4VSolid(), G4GDMLReadSolids::GetSolid(), GetSolid(), Register(), G4RunManager::ReinitializeGeometry(), G4VSolid::SetName(), SetNotifier(), G4GeometryManager::SetWorldMaximumExtent(), G4GDMLRead::StripNames(), UpdateMap(), and G4VSolid::~G4VSolid().
| G4VSolid * G4SolidStore::GetSolid | ( | const G4String & | name, |
| G4bool | verbose = true, | ||
| G4bool | reverseSearch = false ) const |
Returns a pointer to 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.
| [in] | name | The name of the solid to search. |
| [in] | verbose | Flag for enabling verbosity (default true). |
| [in] | reverseSearch | Flag to enable inverse search (default false). |
Definition at line 209 of file G4SolidStore.cc.
Referenced by G4GDMLReadSolids::GetSolid().
|
inline |
Accessor and modifier to assess validity of the internal map.
Definition at line 118 of file G4SolidStore.hh.
|
delete |
|
static |
Adds the solid 'pSolid' to the collection.
Definition at line 144 of file G4SolidStore.cc.
Referenced by G4VSolid::G4VSolid(), G4VSolid::G4VSolid(), and G4VSolid::G4VSolid().
|
inline |
Definition at line 119 of file G4SolidStore.hh.
Referenced by G4VSolid::SetName().
|
static |
Assigns a notifier for allocation/deallocation of the solids.
Definition at line 107 of file G4SolidStore.cc.
| void G4SolidStore::UpdateMap | ( | ) |
Brings contents of the internal map up to date and resets validity flag.
Definition at line 117 of file G4SolidStore.cc.
Referenced by GetSolid(), and G4GDMLRead::StripNames().