Geant4  10.00.p03
G4LogicalSkinSurface.cc
Go to the documentation of this file.
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: G4LogicalSkinSurface.cc 81646 2014-06-04 09:28:37Z gcosmo $
28 //
29 // --------------------------------------------------------------------
30 // G4LogicalSkinSurface Implementation
31 // --------------------------------------------------------------------
32 //
33 // A Logical Surface class for the surface surrounding a single
34 // logical volume.
35 //
36 // Created: 1997-06-26
37 // Author: John Apostolakis (John.Apostolakis@cern.ch)
38 //
39 // ----------------------------------------------------------------------
40 
41 #include "G4LogicalSkinSurface.hh"
42 #include "G4LogicalVolume.hh"
43 
45 
46 //
47 // Constructors & destructor
48 //
49 
51  G4LogicalVolume* logicalVolume,
52  G4SurfaceProperty* surfaceProperty)
53  : G4LogicalSurface(name, surfaceProperty),
54  LogVolume(logicalVolume)
55 {
57  {
59  }
60  // Store in the table of Surfaces
61  //
62  theSkinSurfaceTable->push_back(this);
63 }
64 
66  : G4LogicalSurface(right.GetName(), right.GetSurfaceProperty())
67 {
69  {
71  }
73  LogVolume = right.LogVolume;
74  (*theSkinSurfaceTable) = (*right.theSkinSurfaceTable);
75 }
76 
78 {
79 // delete theSkinSurfaceTable; theSkinSurfaceTable = 0;
80 }
81 
82 //
83 // Operators
84 //
85 
88 {
89  if (&right == this) return *this;
90  if (&right)
91  {
93  SetName(right.GetName());
95  LogVolume = right.LogVolume;
96  (*theSkinSurfaceTable) = (*right.theSkinSurfaceTable);
97  }
98  return *this;
99 }
100 
101 G4int
103 {
104  return (this == (G4LogicalSkinSurface *) &right);
105 }
106 
107 G4int
109 {
110  return (this != (G4LogicalSkinSurface *) &right);
111 }
112 
113 //
114 // Methods
115 //
116 
118 {
119  if (!theSkinSurfaceTable)
120  {
122  }
123  return theSkinSurfaceTable;
124 }
125 
127 {
129  {
130  return theSkinSurfaceTable->size();
131  }
132  return 0;
133 }
134 
137 {
139  {
140  for (size_t i=0; i<theSkinSurfaceTable->size(); i++)
141  {
142  if((*theSkinSurfaceTable)[i]->GetLogicalVolume() == vol)
143  return (*theSkinSurfaceTable)[i];
144  }
145  }
146  return 0;
147 }
148 
149 // Dump info for known surfaces
150 //
152 {
153  G4cout << "***** Skin Surface Table : Nb of Surfaces = "
154  << GetNumberOfSkinSurfaces() << " *****" << G4endl;
155 
157  {
158  for (size_t i=0; i<theSkinSurfaceTable->size(); i++)
159  {
160  G4LogicalSkinSurface* pSkinSurface = (*theSkinSurfaceTable)[i];
161  G4cout << pSkinSurface->GetName() << " : " << G4endl
162  << " Skin of logical volume "
163  << pSkinSurface->GetLogicalVolume()->GetName()
164  << G4endl;
165  }
166  }
167  G4cout << G4endl;
168 }
169 
171 {
173  {
174  G4LogicalSkinSurfaceTable::iterator pos;
175  for(pos=theSkinSurfaceTable->begin();
176  pos!=theSkinSurfaceTable->end(); pos++)
177  {
178  if (*pos) { delete *pos; }
179  }
180  theSkinSurfaceTable->clear();
181  }
182  return;
183 }
G4TransitionRadiationSurface * GetTransitionRadiationSurface() const
G4String GetName() const
const G4LogicalVolume * GetLogicalVolume() const
G4int operator!=(const G4LogicalSkinSurface &right) const
G4String name
Definition: TRTMaterials.hh:40
G4LogicalSkinSurface & operator=(const G4LogicalSkinSurface &right)
void SetName(const G4String &name)
G4LogicalVolume * LogVolume
int G4int
Definition: G4Types.hh:78
static size_t GetNumberOfSkinSurfaces()
G4LogicalSkinSurface(const G4String &name, G4LogicalVolume *vol, G4SurfaceProperty *surfaceProperty)
static const G4LogicalSkinSurfaceTable * GetSurfaceTable()
const G4String & GetName() const
G4GLOB_DLL std::ostream G4cout
static G4LogicalSkinSurfaceTable * theSkinSurfaceTable
void SetTransitionRadiationSurface(G4TransitionRadiationSurface *tRadSurf)
void SetSurfaceProperty(G4SurfaceProperty *ptrSurfaceProperty)
G4int operator==(const G4LogicalSkinSurface &right) const
#define G4endl
Definition: G4ios.hh:61
G4SurfaceProperty * GetSurfaceProperty() const
std::vector< G4LogicalSkinSurface * > G4LogicalSkinSurfaceTable
static const G4double pos
static G4LogicalSkinSurface * GetSurface(const G4LogicalVolume *vol)