|
Lines 51-57
G4LogicalSkinSurface::G4LogicalSkinSurface(const G4String& name,
Link Here
|
| 51 |
} |
51 |
} |
| 52 |
// Store in the table of Surfaces |
52 |
// Store in the table of Surfaces |
| 53 |
// |
53 |
// |
| 54 |
theSkinSurfaceTable->push_back(this); |
54 |
theSkinSurfaceTable->insert(std::make_pair(logicalVolume, this)); |
| 55 |
} |
55 |
} |
| 56 |
|
56 |
|
| 57 |
// -------------------------------------------------------------------- |
57 |
// -------------------------------------------------------------------- |
|
Lines 99-108
G4LogicalSkinSurface::GetSurface(const G4LogicalVolume* vol)
Link Here
|
| 99 |
{ |
99 |
{ |
| 100 |
if (theSkinSurfaceTable != nullptr) |
100 |
if (theSkinSurfaceTable != nullptr) |
| 101 |
{ |
101 |
{ |
| 102 |
for(auto pos : *theSkinSurfaceTable) |
102 |
auto pos = theSkinSurfaceTable->find(vol); |
| 103 |
{ |
103 |
if(pos != theSkinSurfaceTable->cend()) return pos->second; |
| 104 |
if (pos->GetLogicalVolume() == vol) { return pos; } |
|
|
| 105 |
} |
| 106 |
} |
104 |
} |
| 107 |
return nullptr; |
105 |
return nullptr; |
| 108 |
} |
106 |
} |
|
Lines 117-127
void G4LogicalSkinSurface::DumpInfo()
Link Here
|
| 117 |
|
115 |
|
| 118 |
if (theSkinSurfaceTable != nullptr) |
116 |
if (theSkinSurfaceTable != nullptr) |
| 119 |
{ |
117 |
{ |
| 120 |
for(auto pos : *theSkinSurfaceTable) |
118 |
for(const auto & pos : *theSkinSurfaceTable) |
| 121 |
{ |
119 |
{ |
| 122 |
G4cout << pos->GetName() << " : " << G4endl |
120 |
G4LogicalSkinSurface* pSurf = pos.second; |
|
|
121 |
G4cout << pSurf->GetName() << " : " << G4endl |
| 123 |
<< " Skin of logical volume " |
122 |
<< " Skin of logical volume " |
| 124 |
<< pos->GetLogicalVolume()->GetName() |
123 |
<< pSurf->GetLogicalVolume()->GetName() |
| 125 |
<< G4endl; |
124 |
<< G4endl; |
| 126 |
} |
125 |
} |
| 127 |
} |
126 |
} |
|
Lines 135-141
void G4LogicalSkinSurface::CleanSurfaceTable()
Link Here
|
| 135 |
{ |
134 |
{ |
| 136 |
for(auto pos : *theSkinSurfaceTable) |
135 |
for(auto pos : *theSkinSurfaceTable) |
| 137 |
{ |
136 |
{ |
| 138 |
if (pos != nullptr) { delete pos; } |
137 |
delete pos.second; |
| 139 |
} |
138 |
} |
| 140 |
theSkinSurfaceTable->clear(); |
139 |
theSkinSurfaceTable->clear(); |
| 141 |
} |
140 |
} |