#include <G4PhysicalVolumeStore.hh>
Definition at line 54 of file G4PhysicalVolumeStore.hh.
◆ ~G4PhysicalVolumeStore()
G4PhysicalVolumeStore::~G4PhysicalVolumeStore |
( |
| ) |
|
|
virtual |
◆ G4PhysicalVolumeStore() [1/2]
◆ G4PhysicalVolumeStore() [2/2]
G4PhysicalVolumeStore::G4PhysicalVolumeStore |
( |
| ) |
|
|
protected |
◆ Clean()
void G4PhysicalVolumeStore::Clean |
( |
| ) |
|
|
static |
Definition at line 76 of file G4PhysicalVolumeStore.cc.
77{
78
79
81 {
82 G4cout <<
"WARNING - Attempt to delete the physical volume store"
83 <<
" while geometry closed !" <<
G4endl;
84 return;
85 }
86
87
88
89
90
91 locked = true;
92
94
95 for(auto pos=store->cbegin(); pos!=store->cend(); ++pos)
96 {
99 }
100
101 store->bmap.clear(); store->mvalid = false;
102 locked = false;
103 store->clear();
104}
G4GLOB_DLL std::ostream G4cout
static G4bool IsGeometryClosed()
static G4PhysicalVolumeStore * GetInstance()
virtual void NotifyDeRegistration()=0
Referenced by G4RunManager::ReinitializeGeometry(), and ~G4PhysicalVolumeStore().
◆ DeRegister()
Definition at line 171 of file G4PhysicalVolumeStore.cc.
172{
174 if (!locked)
175 {
178 if (motherLogical !=
nullptr) { motherLogical->
RemoveDaughter(pVolume); }
179 for (auto i=store->cbegin(); i!=store->cend(); ++i)
180 {
181 if (**i==*pVolume)
182 {
183 store->erase(i);
184 break;
185 }
186 }
187 const G4String& vol_name = pVolume->GetName();
188 auto it = store->bmap.find(vol_name);
189 if (it != store->bmap.cend())
190 {
191 if (it->second.size() > 1)
192 {
193 for (auto i=it->second.cbegin(); i!=it->second.cend(); ++i)
194 {
195 if (**i==*pVolume)
196 {
197 it->second.erase(i);
198 break;
199 }
200 }
201 }
202 else
203 {
204 store->bmap.erase(it);
205 }
206 }
207 }
208}
void RemoveDaughter(const G4VPhysicalVolume *p)
Referenced by G4VPhysicalVolume::~G4VPhysicalVolume().
◆ GetInstance()
Definition at line 257 of file G4PhysicalVolumeStore.cc.
258{
260 if (fgInstance == nullptr)
261 {
262 fgInstance = &worldStore;
263 }
264 return fgInstance;
265}
Referenced by G4AdjointCrossSurfChecker::AddanExtSurfaceOfAvolume(), G4AdjointCrossSurfChecker::AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(), Clean(), G4SPSPosDistribution::ConfineSourceToVolume(), G4AdjointPosOnPhysVolGenerator::DefinePhysicalVolume(), DeRegister(), G4GeometryWorkspace::DestroyWorkspace(), G4GDMLReadStructure::GetPhysvol(), G4tgbGeometryDumper::GetTopPhysVol(), GetVolume(), G4GeometryWorkspace::InitialisePhysicalVolumes(), Register(), G4RunManager::ReinitializeGeometry(), G4VPhysicalVolume::SetName(), SetNotifier(), G4VViewer::SetTouchable(), G4ScoringRealWorld::SetupGeometry(), G4RegionStore::SetWorldVolume(), G4GDMLRead::StripNames(), UpdateMap(), and G4PhysicalVolumeModel::Validate().
◆ GetMap()
◆ GetVolume()
◆ IsMapValid()
G4bool G4PhysicalVolumeStore::IsMapValid |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ Register()
Definition at line 147 of file G4PhysicalVolumeStore.cc.
148{
150 store->push_back(pVolume);
151 const G4String& vol_name = pVolume->GetName();
152 auto it = store->bmap.find(vol_name);
153 if (it != store->bmap.cend())
154 {
155 it->second.push_back(pVolume);
156 }
157 else
158 {
159 std::vector<G4VPhysicalVolume*> vol_vec { pVolume };
160 store->bmap.insert(std::make_pair(vol_name, vol_vec));
161 }
163 store->mvalid = true;
164}
virtual void NotifyRegistration()=0
Referenced by G4VPhysicalVolume::G4VPhysicalVolume(), and G4VPhysicalVolume::G4VPhysicalVolume().
◆ SetMapValid()
void G4PhysicalVolumeStore::SetMapValid |
( |
G4bool | val | ) |
|
|
inline |
◆ SetNotifier()
◆ UpdateMap()
void G4PhysicalVolumeStore::UpdateMap |
( |
| ) |
|
Definition at line 120 of file G4PhysicalVolumeStore.cc.
121{
123 if (mvalid) return;
124 bmap.clear();
126 {
127 const G4String& vol_name = (*pos)->GetName();
128 auto it = bmap.find(vol_name);
129 if (it != bmap.cend())
130 {
131 it->second.push_back(*pos);
132 }
133 else
134 {
135 std::vector<G4VPhysicalVolume*> vol_vec { *
pos };
136 bmap.insert(std::make_pair(vol_name, vol_vec));
137 }
138 }
139 mvalid = true;
140 l.unlock();
141}
Referenced by GetVolume(), and G4GDMLRead::StripNames().
The documentation for this class was generated from the following files: