Changeset 1315 for trunk/source/geometry/solids/Boolean/src/G4UnionSolid.cc
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/solids/Boolean/src/G4UnionSolid.cc
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4UnionSolid.cc,v 1.3 5 2007/10/23 14:42:31 grichineExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4UnionSolid.cc,v 1.37 2010/05/11 15:03:45 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // Implementation of methods for the class G4IntersectionSolid … … 49 49 #include "G4VGraphicsScene.hh" 50 50 #include "G4Polyhedron.hh" 51 #include "HepPolyhedronProcessor.h" 51 52 #include "G4NURBS.hh" 52 53 // #include "G4NURBSbox.hh" … … 454 455 G4UnionSolid::CreatePolyhedron () const 455 456 { 456 G4Polyhedron* pA = fPtrSolidA->GetPolyhedron(); 457 G4Polyhedron* pB = fPtrSolidB->GetPolyhedron(); 458 if (pA && pB) { 459 G4Polyhedron* resultant = new G4Polyhedron (pA->add(*pB)); 460 return resultant; 461 } else { 462 std::ostringstream oss; 463 oss << GetName() << 464 ": one of the Boolean components has no corresponding polyhedron."; 465 G4Exception("G4UnionSolid::CreatePolyhedron", 466 "", JustWarning, oss.str().c_str()); 467 return 0; 468 } 457 HepPolyhedronProcessor processor; 458 // Stack components and components of components recursively 459 // See G4BooleanSolid::StackPolyhedron 460 G4Polyhedron* top = StackPolyhedron(processor, this); 461 G4Polyhedron* result = new G4Polyhedron(*top); 462 if (processor.execute(*result)) { return result; } 463 else { return 0; } 469 464 } 470 465
Note: See TracChangeset
for help on using the changeset viewer.