80 G4cout <<
"WARNING - Attempt to delete the solid store"
81 <<
" while geometry closed !" <<
G4endl;
93#ifdef G4GEOMETRY_VOXELDEBUG
94 G4cout <<
"Deleting Solids ... ";
97 for(
auto pos=store->cbegin();
pos!=store->cend(); ++
pos)
103#ifdef G4GEOMETRY_VOXELDEBUG
104 if (store->size() < i-1)
105 {
G4cout <<
"No solids deleted. Already deleted by user ?" <<
G4endl; }
136 const G4String& sol_name = (*pos)->GetName();
137 auto it =
bmap.find(sol_name);
138 if (it !=
bmap.cend())
140 it->second.push_back(*
pos);
144 std::vector<G4VSolid*> sol_vec { *
pos };
145 bmap.insert(std::make_pair(sol_name, sol_vec));
159 store->push_back(pSolid);
161 auto it = store->
bmap.find(sol_name);
162 if (it != store->
bmap.cend())
164 it->second.push_back(pSolid);
168 std::vector<G4VSolid*> sol_vec { pSolid };
169 store->
bmap.insert(std::make_pair(sol_name, sol_vec));
185 for (
auto i=store->crbegin(); i!=store->crend(); ++i)
189 store->erase(std::next(i).base());
195 auto it = store->
bmap.find(sol_name);
196 if (it != store->
bmap.cend())
198 if (it->second.size() > 1)
200 for (
auto i=it->second.cbegin(); i!=it->second.cend(); ++i)
211 store->
bmap.erase(it);
222 G4bool reverseSearch)
const
229 if ((verbose) && (
pos->second.size()>1))
231 std::ostringstream message;
232 message <<
"There exists more than ONE solid in store named: "
234 <<
"Returning the first found.";
240 return pos->second[
pos->second.size()-1];
244 return pos->second[0];
249 std::ostringstream message;
250 message <<
"Solid " <<
name <<
" not found in store !" <<
G4endl
251 <<
"Returning NULL pointer.";
static const G4double pos
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 G4ThreadLocal G4bool locked
static void DeRegister(G4VSolid *pSolid)
G4VSolid * GetSolid(const G4String &name, G4bool verbose=true, G4bool reverseSearch=false) const
std::map< G4String, std::vector< G4VSolid * > > bmap
static G4ThreadLocal G4VStoreNotifier * fgNotifier
static G4SolidStore * GetInstance()
static G4SolidStore * fgInstance
virtual void NotifyRegistration()=0
virtual void NotifyDeRegistration()=0
const char * name(G4int ptype)