80 G4cout <<
"WARNING - Attempt to delete the solid store"
81 <<
" while geometry closed !" <<
G4endl;
92 for(
auto pos=store->cbegin(); pos!=store->cend(); ++pos)
98 store->bmap.clear(); store->mvalid =
false;
110 fgNotifier = pNotifier;
124 const G4String& sol_name = (*pos)->GetName();
125 auto it = bmap.find(sol_name);
126 if (it != bmap.cend())
128 it->second.push_back(*pos);
132 std::vector<G4VSolid*> sol_vec { *pos };
133 bmap.insert(std::make_pair(sol_name, sol_vec));
147 store->push_back(pSolid);
149 auto it = store->bmap.find(sol_name);
150 if (it != store->bmap.cend())
152 it->second.push_back(pSolid);
156 std::vector<G4VSolid*> sol_vec { pSolid };
157 store->bmap.insert(std::make_pair(sol_name, sol_vec));
160 store->mvalid =
true;
173 for (
auto i=store->crbegin(); i!=store->crend(); ++i)
177 store->erase(std::next(i).base());
178 store->mvalid =
false;
183 auto it = store->bmap.find(sol_name);
184 if (it != store->bmap.cend())
186 if (it->second.size() > 1)
188 for (
auto i=it->second.cbegin(); i!=it->second.cend(); ++i)
199 store->bmap.erase(it);
210 G4bool reverseSearch)
const
213 if (!store->mvalid) { store->
UpdateMap(); }
214 auto pos = store->bmap.find(name);
215 if(pos != store->bmap.cend())
217 if ((verbose) && (pos->second.size()>1))
219 std::ostringstream message;
220 message <<
"There exists more than ONE solid in store named: "
222 <<
"Returning the first found.";
228 return pos->second[pos->second.size()-1];
232 return pos->second[0];
237 std::ostringstream message;
238 message <<
"Solid " << name <<
" not found in store !" <<
G4endl
239 <<
"Returning NULL pointer.";
253 if (fgInstance ==
nullptr)
255 fgInstance = &worldStore;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
static G4bool IsGeometryClosed()
static void Register(G4VSolid *pSolid)
static void SetNotifier(G4VStoreNotifier *pNotifier)
static void DeRegister(G4VSolid *pSolid)
G4VSolid * GetSolid(const G4String &name, G4bool verbose=true, G4bool reverseSearch=false) const
static G4SolidStore * GetInstance()
virtual void NotifyRegistration()=0
virtual void NotifyDeRegistration()=0