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5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  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.                             *
 10 // *                                                                  *
 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.         *
 17 // *                                                                  *
 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 // ********************************************************************
 25 // 
 26 // G4Region inline implementation
 27 //
 28 // 19.09.02, G.Cosmo - Created
 29 // --------------------------------------------------------------------
 30 
 31 // ********************************************************************
 32 // Equality operator, defined by address only
 33 // ********************************************************************
 34 //
 35 inline
 36 G4bool G4Region::operator==(const G4Region& rg) const
 37 {
 38   return this==&rg;
 39 }
 40 
 41 // ********************************************************************
 42 // GetInstanceID
 43 // ********************************************************************
 44 //
 45 inline
 46 G4int G4Region::GetInstanceID() const
 47 {
 48   return instanceID;
 49 }
 50     
 51 // ********************************************************************
 52 // GetName
 53 // ********************************************************************
 54 //
 55 inline
 56 const G4String& G4Region::GetName() const
 57 {
 58   return fName;
 59 }
 60     
 61 // ********************************************************************
 62 // RegionModified
 63 // ********************************************************************
 64 //
 65 inline
 66 void G4Region::RegionModified(G4bool flag)
 67 {
 68   fRegionMod = flag;
 69 }
 70 
 71 // ********************************************************************
 72 // IsModified
 73 // ********************************************************************
 74 //
 75 inline
 76 G4bool G4Region::IsModified() const
 77 {
 78   return fRegionMod;
 79 }
 80 
 81 // ********************************************************************
 82 // SetProductionCuts
 83 // ********************************************************************
 84 //
 85 inline
 86 void G4Region::SetProductionCuts(G4ProductionCuts* cut)
 87 {
 88   fCut = cut;
 89   fRegionMod = true;
 90 }
 91 
 92 // ********************************************************************
 93 // GetProductionCuts
 94 // ********************************************************************
 95 //
 96 inline
 97 G4ProductionCuts* G4Region::GetProductionCuts() const
 98 {
 99   return fCut;
100 }
101 
102 // ********************************************************************
103 // GetLogicalVolumeIterator
104 // ********************************************************************
105 //
106 inline
107 std::vector<G4LogicalVolume*>::iterator
108 G4Region::GetRootLogicalVolumeIterator()
109 {
110   return G4RootLVList::iterator(fRootVolumes.begin());
111 }
112 
113 // ********************************************************************
114 // GetMaterialIterator
115 // ********************************************************************
116 //
117 inline
118 std::vector<G4Material*>::const_iterator
119 G4Region::GetMaterialIterator() const
120 {
121   return fMaterials.cbegin();
122 }
123 
124 // ********************************************************************
125 // GetNumberOfMaterials
126 // ********************************************************************
127 //
128 inline
129 size_t G4Region::GetNumberOfMaterials() const
130 {
131   return fMaterials.size();
132 }
133 
134 // ********************************************************************
135 // GetNumberOfRootVolumes
136 // ********************************************************************
137 //
138 inline
139 size_t G4Region::GetNumberOfRootVolumes() const
140 {
141   return fRootVolumes.size();
142 }
143 
144 // ********************************************************************
145 // SetUserInformation
146 // ********************************************************************
147 //
148 inline
149 void G4Region::SetUserInformation(G4VUserRegionInformation* ui)
150 {
151   fUserInfo = ui;
152 }
153 
154 // ********************************************************************
155 // GetUserInformation
156 // ********************************************************************
157 //
158 inline
159 G4VUserRegionInformation* G4Region::GetUserInformation() const
160 {
161   return fUserInfo;
162 }
163 
164 // ********************************************************************
165 // SetUserLimits
166 // ********************************************************************
167 //
168 inline
169 void G4Region::SetUserLimits(G4UserLimits* ul)
170 {
171   fUserLimits = ul;
172 }
173 
174 // ********************************************************************
175 // GetUserLimits
176 // ********************************************************************
177 //
178 inline
179 G4UserLimits* G4Region::GetUserLimits() const
180 {
181   return fUserLimits;
182 }
183 
184 // ********************************************************************
185 // ClearMap
186 // ********************************************************************
187 //
188 inline
189 void G4Region::ClearMap()
190 {
191   if(!(fMaterialCoupleMap.empty()))
192   {
193     auto b = fMaterialCoupleMap.cbegin();
194     auto e = fMaterialCoupleMap.cend();
195     fMaterialCoupleMap.erase(b,e);
196   }
197 }
198 
199 // ********************************************************************
200 // RegisterMateralCouplePair
201 // ********************************************************************
202 //
203 inline
204 void G4Region::RegisterMaterialCouplePair(G4Material* mat,
205                                           G4MaterialCutsCouple* couple)
206 {
207   fMaterialCoupleMap.insert(G4MaterialCouplePair(mat,couple));
208 }
209 
210 // ********************************************************************
211 // FindCouple
212 // ********************************************************************
213 //
214 inline
215 G4MaterialCutsCouple* G4Region::FindCouple(G4Material* mat)
216 {
217   auto c = fMaterialCoupleMap.find(mat);
218   G4MaterialCutsCouple* couple = nullptr;
219   if(c!=fMaterialCoupleMap.cend()) couple = (*c).second;
220   return couple;
221 }
222 
223 // ********************************************************************
224 // GetFieldManager
225 // ********************************************************************
226 //
227 inline 
228 G4FieldManager* G4Region::GetFieldManager() const
229 {
230   return fFieldManager;
231 }
232 
233 // ********************************************************************
234 // SetFieldManager
235 // ********************************************************************
236 //
237 inline
238 void G4Region::SetFieldManager(G4FieldManager* fm)
239 {
240   fFieldManager = fm;
241 }
242 
243 // ********************************************************************
244 // GetWorldPhysical
245 // ********************************************************************
246 //
247 inline
248 G4VPhysicalVolume* G4Region::GetWorldPhysical() const
249 {
250   return fWorldPhys;
251 }
252 
253 // ********************************************************************
254 // AddMaterial
255 // ********************************************************************
256 //
257 inline
258 void G4Region::AddMaterial(G4Material* aMaterial)
259 {
260   auto pos = std::find(fMaterials.cbegin(),fMaterials.cend(),aMaterial);
261   if (pos == fMaterials.cend())
262   {
263     fMaterials.push_back(aMaterial);
264     fRegionMod = true;
265   }
266 }
267 
268 // ********************************************************************
269 // UsedInMassGeometry
270 // ********************************************************************
271 //
272 inline 
273 void G4Region::UsedInMassGeometry(G4bool val)
274 {
275   fInMassGeometry = val;
276 }
277 
278 // ********************************************************************
279 // UsedInParallelGeometry
280 // ********************************************************************
281 //
282 inline 
283 void G4Region::UsedInParallelGeometry(G4bool val)
284 {
285   fInParallelGeometry = val;
286 }
287 
288 // ********************************************************************
289 // IsInMassGeometry
290 // ********************************************************************
291 //
292 inline 
293 G4bool G4Region::IsInMassGeometry() const
294 {
295   return fInMassGeometry;
296 }
297 
298 // ********************************************************************
299 // IsInParallelGeometry
300 // ********************************************************************
301 //
302 inline 
303 G4bool G4Region::IsInParallelGeometry() const
304 {
305   return fInParallelGeometry;
306 }
307