- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/solids/Boolean/src/G4BooleanSolid.cc
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4BooleanSolid.cc,v 1.2 1 2006/10/19 15:34:49gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4BooleanSolid.cc,v 1.23 2010/05/11 15:03:45 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // Implementation for the abstract base class for solids created by boolean … … 40 40 #include "G4VSolid.hh" 41 41 #include "G4Polyhedron.hh" 42 #include "HepPolyhedronProcessor.h" 42 43 #include "Randomize.hh" 43 44 … … 231 232 return fpPolyhedron; 232 233 } 234 235 ////////////////////////////////////////////////////////////////////////// 236 // 237 // Stacks polyhedra for processing. Returns top polyhedron. 238 239 G4Polyhedron* 240 G4BooleanSolid::StackPolyhedron(HepPolyhedronProcessor& processor, 241 const G4VSolid* solid) const 242 { 243 HepPolyhedronProcessor::Operation operation; 244 const G4String& type = solid->GetEntityType(); 245 if (type == "G4UnionSolid") 246 { operation = HepPolyhedronProcessor::UNION; } 247 else if (type == "G4IntersectionSolid") 248 { operation = HepPolyhedronProcessor::INTERSECTION; } 249 else if (type == "G4SubtractionSolid") 250 { operation = HepPolyhedronProcessor::SUBTRACTION; } 251 else 252 { 253 std::ostringstream oss; 254 oss << "Solid - " << solid->GetName() 255 << " - Unrecognised composite solid" 256 << "\n Returning NULL !"; 257 G4Exception("StackPolyhedron()", "InvalidSetup", 258 JustWarning, oss.str().c_str()); 259 return 0; 260 } 261 262 G4Polyhedron* top = 0; 263 const G4VSolid* solidA = solid->GetConstituentSolid(0); 264 const G4VSolid* solidB = solid->GetConstituentSolid(1); 265 266 if (solidA->GetConstituentSolid(0)) 267 { 268 top = StackPolyhedron(processor, solidA); 269 } 270 else 271 { 272 top = solidA->GetPolyhedron(); 273 } 274 G4Polyhedron* operand = solidB->GetPolyhedron(); 275 processor.push_back (operation, *operand); 276 277 return top; 278 }
Note: See TracChangeset
for help on using the changeset viewer.