#include <G4LogicalVolumeStore.hh>
Definition at line 55 of file G4LogicalVolumeStore.hh.
◆ ~G4LogicalVolumeStore()
G4LogicalVolumeStore::~G4LogicalVolumeStore |
( |
| ) |
|
|
virtual |
◆ G4LogicalVolumeStore() [1/2]
◆ G4LogicalVolumeStore() [2/2]
G4LogicalVolumeStore::G4LogicalVolumeStore |
( |
| ) |
|
|
protected |
◆ Clean()
void G4LogicalVolumeStore::Clean |
( |
| ) |
|
|
static |
Definition at line 75 of file G4LogicalVolumeStore.cc.
76{
77
78
80 {
81 G4cout <<
"WARNING - Attempt to delete the logical volume store"
82 <<
" while geometry closed !" <<
G4endl;
83 return;
84 }
85
86
87
88
89 locked = true;
90
92
93 for(auto pos=store->cbegin(); pos!=store->cend(); ++pos)
94 {
96 if (*pos !=
nullptr) { (*pos)->Lock();
delete *
pos; }
97 }
98
99 store->bmap.clear(); store->mvalid = false;
100 locked = false;
101 store->clear();
102}
G4GLOB_DLL std::ostream G4cout
static G4bool IsGeometryClosed()
static G4LogicalVolumeStore * GetInstance()
virtual void NotifyDeRegistration()=0
Referenced by G4RunManager::ReinitializeGeometry(), and ~G4LogicalVolumeStore().
◆ DeRegister()
Definition at line 168 of file G4LogicalVolumeStore.cc.
169{
171 if (!locked)
172 {
174 for (auto i=store->cbegin(); i!=store->cend(); ++i)
175 {
176 if (**i==*pVolume)
177 {
178 store->erase(i);
179 break;
180 }
181 }
183 auto it = store->bmap.find(vol_name);
184 if (it != store->bmap.cend())
185 {
186 if (it->second.size() > 1)
187 {
188 for (auto i=it->second.cbegin(); i!=it->second.cend(); ++i)
189 {
190 if (**i==*pVolume)
191 {
192 it->second.erase(i);
193 break;
194 }
195 }
196 }
197 else
198 {
199 store->bmap.erase(it);
200 }
201 }
202 }
203}
const G4String & GetName() const
Referenced by G4LogicalVolume::~G4LogicalVolume().
◆ GetInstance()
Definition at line 252 of file G4LogicalVolumeStore.cc.
253{
255 if (fgInstance == nullptr)
256 {
257 fgInstance = &worldStore;
258 }
259 return fgInstance;
260}
Referenced by checkVol(), Clean(), G4VUserDetectorConstruction::CloneF(), G4VUserDetectorConstruction::CloneSD(), DeRegister(), G4RadioactiveDecay::DeselectAVolume(), G4Region::GetParentRegion(), G4GDMLReadStructure::GetVolume(), GetVolume(), Register(), G4RunManager::ReinitializeGeometry(), G4RadioactiveDecay::SelectAllVolumes(), G4RadioactiveDecay::SelectAVolume(), G4VVisCommandGeometrySet::Set(), G4LogicalVolume::SetName(), G4GDMLMessenger::SetNewValue(), G4VisCommandGeometryList::SetNewValue(), G4VisCommandGeometryRestore::SetNewValue(), G4VisCommandSceneAddLogicalVolume::SetNewValue(), SetNotifier(), G4VUserDetectorConstruction::SetSensitiveDetector(), G4VUserParallelWorld::SetSensitiveDetector(), G4ScoringProbe::SetupGeometry(), G4ScoringRealWorld::SetupGeometry(), G4GDMLRead::StripNames(), G4WorkerThread::UpdateGeometryAndPhysicsVectorFromMaster(), and UpdateMap().
◆ GetMap()
◆ GetVolume()
◆ IsMapValid()
G4bool G4LogicalVolumeStore::IsMapValid |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ Register()
Definition at line 145 of file G4LogicalVolumeStore.cc.
146{
148 store->push_back(pVolume);
150 auto it = store->bmap.find(vol_name);
151 if (it != store->bmap.cend())
152 {
153 it->second.push_back(pVolume);
154 }
155 else
156 {
157 std::vector<G4LogicalVolume*> vol_vec { pVolume };
158 store->bmap.insert(std::make_pair(vol_name, vol_vec));
159 }
161 store->mvalid = true;
162}
virtual void NotifyRegistration()=0
Referenced by G4LogicalVolume::G4LogicalVolume(), and G4LogicalVolume::G4LogicalVolume().
◆ SetMapValid()
void G4LogicalVolumeStore::SetMapValid |
( |
G4bool | val | ) |
|
|
inline |
◆ SetNotifier()
◆ UpdateMap()
void G4LogicalVolumeStore::UpdateMap |
( |
| ) |
|
Definition at line 118 of file G4LogicalVolumeStore.cc.
119{
121 if (mvalid) return;
122 bmap.clear();
124 {
125 const G4String& vol_name = (*pos)->GetName();
126 auto it = bmap.find(vol_name);
127 if (it != bmap.cend())
128 {
129 it->second.push_back(*pos);
130 }
131 else
132 {
133 std::vector<G4LogicalVolume*> vol_vec { *
pos };
134 bmap.insert(std::make_pair(vol_name, vol_vec));
135 }
136 }
137 mvalid = true;
138 l.unlock();
139}
Referenced by GetVolume(), and G4GDMLRead::StripNames().
The documentation for this class was generated from the following files: