- Timestamp:
- May 20, 2010, 11:49:26 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/management/src/G4VSceneHandler.cc
r1241 r1258 25 25 // 26 26 // 27 // $Id: G4VSceneHandler.cc,v 1.9 1 2009/11/16 13:51:08 lgarnierExp $27 // $Id: G4VSceneHandler.cc,v 1.92 2010/05/11 10:55:07 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 67 67 #include "G4Polycone.hh" 68 68 #include "G4Polyhedra.hh" 69 #include "G4DisplacedSolid.hh" 69 70 #include "G4LogicalVolume.hh" 70 71 #include "G4PhysicalVolumeModel.hh" … … 258 259 259 260 void G4VSceneHandler::AddCompound (const G4VTrajectory& traj) { 260 G4TrajectoriesModel* pTrModel =261 G4TrajectoriesModel* trajectoriesModel = 261 262 dynamic_cast<G4TrajectoriesModel*>(fpModel); 262 if (! pTrModel) G4Exception263 if (!trajectoriesModel) G4Exception 263 264 ("G4VSceneHandler::AddCompound(const G4VTrajectory&): Not a G4TrajectoriesModel."); 264 traj.DrawTrajectory(pTrModel->GetDrawingMode()); 265 G4VVisManager::IsDefaultDrawTrajectory = false; 266 if (trajectoriesModel->IsDrawingModeSet()) { 267 traj.DrawTrajectory(trajectoriesModel->GetDrawingMode()); 268 } else { 269 traj.DrawTrajectory(); 270 } 271 if (!G4VVisManager::IsDefaultDrawTrajectory) { 272 static G4bool warnedAboutIMode = false; 273 if (!warnedAboutIMode) { 274 G4Exception 275 ("G4VSceneHandler::AddCompound(const G4VTrajectory&)", 276 "", 277 JustWarning, 278 "WARNING: DEPRECATED: The use of the i_mode argument in DrawTrajectory" 279 "\n is deprecated and will be removed in a future major release."); 280 warnedAboutIMode = true; 281 } 282 } 265 283 } 266 284 … … 741 759 pModelingParams->SetExplodeCentre(vp.GetExplodeCentre()); 742 760 743 pModelingParams->SetSection Polyhedron(CreateSectionPolyhedron());744 pModelingParams->SetCutaway Polyhedron(CreateCutawayPolyhedron());761 pModelingParams->SetSectionSolid(CreateSectionSolid()); 762 pModelingParams->SetCutawaySolid(CreateCutawaySolid()); 745 763 // The polyhedron objects are deleted in the modeling parameters destructor. 746 764 … … 748 766 } 749 767 750 const G4Polyhedron* G4VSceneHandler::CreateSectionPolyhedron()751 { 752 /* Disable for now. Boolean processor not up to it.768 G4VSolid* G4VSceneHandler::CreateSectionSolid() 769 { 770 G4VSolid* sectioner = 0; 753 771 const G4ViewParameters& vp = fpViewer->GetViewParameters(); 754 772 if (vp.IsSection () ) { 755 773 G4double radius = fpScene->GetExtent().GetExtentRadius(); 756 774 G4double safe = radius + fpScene->GetExtent().GetExtentCentre().mag(); 757 G4Box sectionBox("clipper", 758 safe, safe, 1.e-5 * radius); // Thin in z-plane. 759 G4Polyhedron* sectioner = sectionBox.CreatePolyhedron(); 775 G4VSolid* sectionBox = 776 new G4Box("_sectioner", safe, safe, 1.e-5 * radius); // Thin in z-plane. 760 777 const G4Plane3D& s = vp.GetSectionPlane (); 761 778 G4double a = s.a(); … … 770 787 transform = G4Rotate3D(angle, axis) * transform; 771 788 } 772 sectioner->Transform(transform); 773 return sectioner; 774 } else { 775 return 0; 776 } 777 */ 778 return 0; 779 } 780 781 const G4Polyhedron* G4VSceneHandler::CreateCutawayPolyhedron() 789 sectioner = new G4DisplacedSolid 790 ("_displaced_sectioning_box", sectionBox, transform); 791 } 792 return sectioner; 793 } 794 795 G4VSolid* G4VSceneHandler::CreateCutawaySolid() 782 796 { 783 797 return 0;
Note: See TracChangeset
for help on using the changeset viewer.