2// ********************************************************************
3// * License and Disclaimer *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
26// G4Region inline implementation
28// 19.09.02, G.Cosmo - Created
29// --------------------------------------------------------------------
31// ********************************************************************
32// Equality operator, defined by address only
33// ********************************************************************
36G4bool G4Region::operator==(const G4Region& rg) const
38 return (this==&rg) ? true : false;
41// ********************************************************************
43// ********************************************************************
46G4int G4Region::GetInstanceID() const
51// ********************************************************************
53// ********************************************************************
56const G4String& G4Region::GetName() const
61// ********************************************************************
63// ********************************************************************
66void G4Region::RegionModified(G4bool flag)
71// ********************************************************************
73// ********************************************************************
76G4bool G4Region::IsModified() const
81// ********************************************************************
83// ********************************************************************
86void G4Region::SetProductionCuts(G4ProductionCuts* cut)
92// ********************************************************************
94// ********************************************************************
97G4ProductionCuts* G4Region::GetProductionCuts() const
102// ********************************************************************
103// GetLogicalVolumeIterator
104// ********************************************************************
107std::vector<G4LogicalVolume*>::iterator
108G4Region::GetRootLogicalVolumeIterator()
110 return G4RootLVList::iterator(fRootVolumes.begin());
113// ********************************************************************
114// GetMaterialIterator
115// ********************************************************************
118std::vector<G4Material*>::const_iterator
119G4Region::GetMaterialIterator() const
121 return fMaterials.cbegin();
124// ********************************************************************
125// GetNumberOfMaterials
126// ********************************************************************
129size_t G4Region::GetNumberOfMaterials() const
131 return fMaterials.size();
134// ********************************************************************
135// GetNumberOfRootVolumes
136// ********************************************************************
139size_t G4Region::GetNumberOfRootVolumes() const
141 return fRootVolumes.size();
144// ********************************************************************
146// ********************************************************************
149void G4Region::SetUserInformation(G4VUserRegionInformation* ui)
154// ********************************************************************
156// ********************************************************************
159G4VUserRegionInformation* G4Region::GetUserInformation() const
164// ********************************************************************
166// ********************************************************************
169void G4Region::SetUserLimits(G4UserLimits* ul)
174// ********************************************************************
176// ********************************************************************
179G4UserLimits* G4Region::GetUserLimits() const
184// ********************************************************************
186// ********************************************************************
189void G4Region::ClearMap()
191 if(!(fMaterialCoupleMap.empty()))
193 auto b = fMaterialCoupleMap.cbegin();
194 auto e = fMaterialCoupleMap.cend();
195 fMaterialCoupleMap.erase(b,e);
199// ********************************************************************
200// RegisterMateralCouplePair
201// ********************************************************************
204void G4Region::RegisterMaterialCouplePair(G4Material* mat,
205 G4MaterialCutsCouple* couple)
207 fMaterialCoupleMap.insert(G4MaterialCouplePair(mat,couple));
210// ********************************************************************
212// ********************************************************************
215G4MaterialCutsCouple* G4Region::FindCouple(G4Material* mat)
217 auto c = fMaterialCoupleMap.find(mat);
218 G4MaterialCutsCouple* couple = nullptr;
219 if(c!=fMaterialCoupleMap.cend()) couple = (*c).second;
223// ********************************************************************
225// ********************************************************************
228G4FieldManager* G4Region::GetFieldManager() const
230 return fFieldManager;
233// ********************************************************************
235// ********************************************************************
238void G4Region::SetFieldManager(G4FieldManager* fm)
243// ********************************************************************
245// ********************************************************************
248G4VPhysicalVolume* G4Region::GetWorldPhysical() const
253// ********************************************************************
255// ********************************************************************
258void G4Region::AddMaterial(G4Material* aMaterial)
260 auto pos = std::find(fMaterials.cbegin(),fMaterials.cend(),aMaterial);
261 if (pos == fMaterials.cend())
263 fMaterials.push_back(aMaterial);
268// ********************************************************************
270// ********************************************************************
273void G4Region::UsedInMassGeometry(G4bool val)
275 fInMassGeometry = val;
278// ********************************************************************
279// UsedInParallelGeometry
280// ********************************************************************
283void G4Region::UsedInParallelGeometry(G4bool val)
285 fInParallelGeometry = val;
288// ********************************************************************
290// ********************************************************************
293G4bool G4Region::IsInMassGeometry() const
295 return fInMassGeometry;
298// ********************************************************************
299// IsInParallelGeometry
300// ********************************************************************
303G4bool G4Region::IsInParallelGeometry() const
305 return fInParallelGeometry;