#include <G4LogicalVolumeModel.hh>
Inheritance diagram for G4LogicalVolumeModel:
Public Member Functions | |
G4LogicalVolumeModel (G4LogicalVolume *, G4int soughtDepth=1, G4bool booleans=true, G4bool voxels=true, G4bool readout=true, const G4Transform3D &modelTransformation=G4Transform3D(), const G4ModelingParameters *=0) | |
virtual | ~G4LogicalVolumeModel () |
void | DescribeYourselfTo (G4VGraphicsScene &) |
G4bool | Validate (G4bool) |
Protected Member Functions | |
void | DescribeSolid (const G4Transform3D &theAT, G4VSolid *pSol, const G4VisAttributes *pVisAttribs, G4VGraphicsScene &sceneHandler) |
Protected Attributes | |
G4LogicalVolume * | fpLV |
G4bool | fBooleans |
G4bool | fVoxels |
G4bool | fReadout |
Definition at line 51 of file G4LogicalVolumeModel.hh.
G4LogicalVolumeModel::G4LogicalVolumeModel | ( | G4LogicalVolume * | , | |
G4int | soughtDepth = 1 , |
|||
G4bool | booleans = true , |
|||
G4bool | voxels = true , |
|||
G4bool | readout = true , |
|||
const G4Transform3D & | modelTransformation = G4Transform3D() , |
|||
const G4ModelingParameters * | = 0 | |||
) |
Definition at line 45 of file G4LogicalVolumeModel.cc.
00051 : 00052 // Instantiate a G4PhysicalVolumeModel with a G4PVPlacement to 00053 // represent this logical volume. It has no rotation and a null 00054 // translation so that the logical volume will be seen in its own 00055 // reference system. It will be added to the physical volume store 00056 // but it will not be part of the normal geometry heirarchy so it 00057 // has no mother. 00058 G4PhysicalVolumeModel 00059 (new G4PVPlacement (0, // No rotation. 00060 G4ThreeVector(), // Null traslation. 00061 "PhysVol representation of LogVol " + pLV -> GetName (), 00062 pLV, 00063 0, // No mother. 00064 false, // Not "MANY". 00065 0), // Copy number. 00066 soughtDepth, 00067 modelTransformation, 00068 pMP, 00069 true), // Use full extent. 00070 fpLV (pLV), 00071 fBooleans (booleans), 00072 fVoxels (voxels), 00073 fReadout (readout) 00074 { 00075 fType = "G4LogicalVolumeModel"; 00076 fGlobalTag = fpLV -> GetName (); 00077 fGlobalDescription = "G4LogicalVolumeModel " + fGlobalTag; 00078 }
G4LogicalVolumeModel::~G4LogicalVolumeModel | ( | ) | [virtual] |
void G4LogicalVolumeModel::DescribeSolid | ( | const G4Transform3D & | theAT, | |
G4VSolid * | pSol, | |||
const G4VisAttributes * | pVisAttribs, | |||
G4VGraphicsScene & | sceneHandler | |||
) | [protected, virtual] |
Reimplemented from G4PhysicalVolumeModel.
Definition at line 133 of file G4LogicalVolumeModel.cc.
References FatalException, G4Exception(), G4VGraphicsScene::PostAddSolid(), G4VGraphicsScene::PreAddSolid(), and G4VisAttributes::SetForceWireframe().
00136 { 00137 00138 if (fBooleans) { 00139 // Look for "constituents". Could be a Boolean solid. 00140 G4VSolid* pSol0 = pSol -> GetConstituentSolid (0); 00141 if (pSol0) { // Composite solid... 00142 G4VSolid* pSol1 = pSol -> GetConstituentSolid (1); 00143 if (!pSol1) { 00144 G4Exception 00145 ("G4PhysicalVolumeModel::DescribeSolid", 00146 "modeling0001", FatalException, 00147 "2nd component solid in Boolean is missing."); 00148 } 00149 // Draw these constituents white and "forced wireframe"... 00150 G4VisAttributes constituentAttributes; 00151 constituentAttributes.SetForceWireframe(true); 00152 DescribeSolid (theAT, pSol0, &constituentAttributes, sceneHandler); 00153 DescribeSolid (theAT, pSol1, &constituentAttributes, sceneHandler); 00154 } 00155 } 00156 00157 // In any case draw the original/resultant solid... 00158 sceneHandler.PreAddSolid (theAT, *pVisAttribs); 00159 pSol -> DescribeYourselfTo (sceneHandler); 00160 sceneHandler.PostAddSolid (); 00161 }
void G4LogicalVolumeModel::DescribeYourselfTo | ( | G4VGraphicsScene & | ) | [virtual] |
Reimplemented from G4PhysicalVolumeModel.
Definition at line 83 of file G4LogicalVolumeModel.cc.
References G4VGraphicsScene::AddPrimitive(), G4VGraphicsScene::BeginPrimitives(), G4PhysicalVolumeModel::DescribeYourselfTo(), G4VGraphicsScene::EndPrimitives(), G4cout, G4endl, G4VPhysicalVolume::GetName(), G4VReadOutGeometry::GetName(), G4VSensitiveDetector::GetROgeometry(), G4VReadOutGeometry::GetROWorld(), G4ModelingParameters::SetCulling(), and G4VModel::SetModelingParameters().
00083 { 00084 00085 // Store current modeling parameters and ensure nothing is culled. 00086 const G4ModelingParameters* tmpMP = fpMP; 00087 G4ModelingParameters nonCulledMP; 00088 if (fpMP) nonCulledMP = *fpMP; 00089 nonCulledMP.SetCulling (false); 00090 fpMP = &nonCulledMP; 00091 G4PhysicalVolumeModel::DescribeYourselfTo (sceneHandler); 00092 fpMP = tmpMP; 00093 00094 if (fVoxels) { 00095 if (fpTopPV->GetLogicalVolume()->GetVoxelHeader()) { 00096 // Add Voxels. 00097 G4DrawVoxels dv; 00098 G4PlacedPolyhedronList* pPPL = 00099 dv.CreatePlacedPolyhedra (fpTopPV -> GetLogicalVolume ()); 00100 for (size_t i = 0; i < pPPL -> size (); i++) { 00101 const G4Transform3D& transform = (*pPPL)[i].GetTransform (); 00102 const G4Polyhedron& polyhedron = (*pPPL)[i].GetPolyhedron (); 00103 sceneHandler.BeginPrimitives (transform); 00104 sceneHandler.AddPrimitive (polyhedron); 00105 sceneHandler.EndPrimitives (); 00106 } 00107 delete pPPL; 00108 } 00109 } 00110 00111 if (fReadout) { 00112 // Draw readout geometry... 00113 G4VSensitiveDetector* sd = fpLV->GetSensitiveDetector(); 00114 if (sd) { 00115 G4VReadOutGeometry* roGeom = sd->GetROgeometry(); 00116 if (roGeom) { 00117 G4VPhysicalVolume* roWorld = roGeom->GetROWorld(); 00118 G4cout << "Readout geometry \"" << roGeom->GetName() 00119 << "\" with top physical volume \"" 00120 << roWorld->GetName() 00121 << "\"" << G4endl; 00122 G4PhysicalVolumeModel pvModel(roWorld); 00123 pvModel.SetModelingParameters(fpMP); 00124 pvModel.DescribeYourselfTo(sceneHandler); 00125 } 00126 } 00127 } 00128 }
G4bool G4LogicalVolumeModel::fBooleans [protected] |
Definition at line 84 of file G4LogicalVolumeModel.hh.
G4LogicalVolume* G4LogicalVolumeModel::fpLV [protected] |
Definition at line 83 of file G4LogicalVolumeModel.hh.
G4bool G4LogicalVolumeModel::fReadout [protected] |
Definition at line 86 of file G4LogicalVolumeModel.hh.
G4bool G4LogicalVolumeModel::fVoxels [protected] |
Definition at line 85 of file G4LogicalVolumeModel.hh.