source: trunk/source/geometry/management/include/G4Region.icc @ 1202

Last change on this file since 1202 was 1058, checked in by garnier, 15 years ago

file release beta

File size: 8.7 KB
Line 
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//
27// $Id: G4Region.icc,v 1.15 2007/04/28 01:48:29 asaim Exp $
28// GEANT4 tag $Name: geant4-09-02-ref-02 $
29//
30//
31// class G4Region Inline Implementation file
32//
33// 19.09.02 - G.Cosmo: Created
34// --------------------------------------------------------------------
35
36// ********************************************************************
37// Equality operator, defined by address only
38// ********************************************************************
39//
40inline
41G4bool G4Region::operator==(const G4Region& rg) const
42{
43  return (this==&rg) ? true : false;
44}
45
46// ********************************************************************
47// GetName
48// ********************************************************************
49//
50inline
51const G4String& G4Region::GetName() const
52{
53  return fName;
54}
55   
56// ********************************************************************
57// SetName
58// ********************************************************************
59//
60inline
61void G4Region::SetName(const G4String& pName)
62{
63  fName = pName;
64}
65
66// ********************************************************************
67// RegionModified
68// ********************************************************************
69//
70inline
71void G4Region::RegionModified(G4bool flag)
72{
73  fRegionMod = flag;
74}
75
76// ********************************************************************
77// IsModified
78// ********************************************************************
79//
80inline
81G4bool G4Region::IsModified() const
82{
83  return fRegionMod;
84}
85
86// ********************************************************************
87// SetProductionCuts
88// ********************************************************************
89//
90inline
91void G4Region::SetProductionCuts(G4ProductionCuts* cut)
92{
93  fCut = cut;
94  fRegionMod = true;
95}
96
97// ********************************************************************
98// GetProductionCuts
99// ********************************************************************
100//
101inline
102G4ProductionCuts* G4Region::GetProductionCuts() const
103{
104  return fCut;
105}
106
107// ********************************************************************
108// GetLogicalVolumeIterator
109// ********************************************************************
110//
111inline
112std::vector<G4LogicalVolume*>::iterator
113G4Region::GetRootLogicalVolumeIterator()
114{
115  G4RootLVList::iterator iterator =
116    G4RootLVList::iterator(fRootVolumes.begin());
117  return iterator;
118}
119
120// ********************************************************************
121// GetMaterialIterator
122// ********************************************************************
123//
124inline
125std::vector<G4Material*>::const_iterator
126G4Region::GetMaterialIterator() const
127{
128  G4MaterialList::const_iterator iterator = fMaterials.begin();
129  return iterator;
130}
131
132// ********************************************************************
133// GetNumberOfMaterials
134// ********************************************************************
135//
136inline
137size_t G4Region::GetNumberOfMaterials() const
138{
139  return fMaterials.size();
140}
141
142// ********************************************************************
143// GetNumberOfRootVolumes
144// ********************************************************************
145//
146inline
147size_t G4Region::GetNumberOfRootVolumes() const
148{
149  return fRootVolumes.size();
150}
151
152// ********************************************************************
153// SetUserInformation
154// ********************************************************************
155//
156inline
157void G4Region::SetUserInformation(G4VUserRegionInformation* ui)
158{
159  fUserInfo = ui;
160}
161
162// ********************************************************************
163// GetUserInformation
164// ********************************************************************
165//
166inline
167G4VUserRegionInformation* G4Region::GetUserInformation() const
168{
169  return fUserInfo;
170}
171
172// ********************************************************************
173// SetUserLimits
174// ********************************************************************
175//
176inline
177void G4Region::SetUserLimits(G4UserLimits* ul)
178{
179  fUserLimits = ul;
180}
181
182// ********************************************************************
183// GetUserLimits
184// ********************************************************************
185//
186inline
187G4UserLimits* G4Region::GetUserLimits() const
188{
189  return fUserLimits;
190}
191
192// ********************************************************************
193// ClearMap
194// ********************************************************************
195//
196inline
197void G4Region::ClearMap()
198{
199  if(!(fMaterialCoupleMap.empty()))
200  {
201    G4MaterialCoupleMap::iterator b = fMaterialCoupleMap.begin();
202    G4MaterialCoupleMap::iterator e = fMaterialCoupleMap.end();
203    fMaterialCoupleMap.erase(b,e);
204  }
205}
206
207// ********************************************************************
208// RegisterMateralCouplePair
209// ********************************************************************
210//
211inline
212void G4Region::RegisterMaterialCouplePair(G4Material* mat,
213                                          G4MaterialCutsCouple* couple)
214{
215  fMaterialCoupleMap.insert(G4MaterialCouplePair(mat,couple));
216}
217
218// ********************************************************************
219// FindCouple
220// ********************************************************************
221//
222inline
223G4MaterialCutsCouple* G4Region::FindCouple(G4Material* mat)
224{
225  G4MaterialCoupleMap::iterator c = fMaterialCoupleMap.find(mat);
226  G4MaterialCutsCouple* couple = 0;
227  if(c!=fMaterialCoupleMap.end()) couple = (*c).second;
228  return couple;
229}
230
231// ********************************************************************
232// SetFastSimulationManager
233// ********************************************************************
234//
235inline
236void G4Region::SetFastSimulationManager(G4FastSimulationManager* fsm)
237{
238  fFastSimulationManager = fsm;
239}
240
241// ********************************************************************
242// GetFastSimulationManager
243// ********************************************************************
244//
245inline
246G4FastSimulationManager* G4Region::GetFastSimulationManager() const
247{
248  return fFastSimulationManager;
249}
250
251// ********************************************************************
252// GetWorldPhysical
253// ********************************************************************
254//
255inline
256G4VPhysicalVolume* G4Region::GetWorldPhysical() const
257{
258  return fWorldPhys;
259}
260
261// ********************************************************************
262// AddMaterial
263// ********************************************************************
264//
265inline
266void G4Region::AddMaterial(G4Material* aMaterial)
267{
268  G4MaterialList::iterator pos =
269    std::find(fMaterials.begin(),fMaterials.end(),aMaterial);
270  if (pos == fMaterials.end())
271  {
272    fMaterials.push_back(aMaterial);
273    fRegionMod = true;
274  }
275}
276
277// ********************************************************************
278// SetRegionalSteppingAction
279// ********************************************************************
280//
281inline
282void G4Region::SetRegionalSteppingAction(G4UserSteppingAction* rusa)
283{ fRegionalSteppingAction = rusa; }
284
285// ********************************************************************
286// GetRegionalSteppingAction
287// ********************************************************************
288//
289inline
290G4UserSteppingAction* G4Region::GetRegionalSteppingAction() const
291{ return fRegionalSteppingAction; }
292
293
Note: See TracBrowser for help on using the repository browser.