Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TouchableUtils Namespace Reference

Functions

G4PhysicalVolumeModel::TouchableProperties FindTouchableProperties (G4ModelingParameters::PVNameCopyNoPath path)
 

Function Documentation

◆ FindTouchableProperties()

G4PhysicalVolumeModel::TouchableProperties G4TouchableUtils::FindTouchableProperties ( G4ModelingParameters::PVNameCopyNoPath  path)

Definition at line 37 of file G4TouchableUtils.cc.

39{
40 // If the search is not successful properties.fpTouchablePV will be null.
42 G4TransportationManager* transportationManager =
44 size_t nWorlds = transportationManager->GetNoWorlds();
45 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
46 transportationManager->GetWorldsIterator();
47 for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
48 G4PhysicalVolumeModel pvModel (*iterWorld); // Unlimited depth.
49 G4ModelingParameters mp; // Default - no culling.
50 pvModel.SetModelingParameters (&mp);
51 G4TouchablePropertiesScene scene (&pvModel,path);
52 pvModel.DescribeYourselfTo (scene); // Initiate geometry tree traversal.
53 if (scene.GetFoundTouchableProperties().fpTouchablePV) {
54 properties = scene.GetFoundTouchableProperties();
55 break; // Found, so no need to scan more worlds.
56 }
57 }
58 return properties;
59}
static G4TransportationManager * GetTransportationManager()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
size_t GetNoWorlds() const

Referenced by G4VisCommandsTouchable::SetNewValue().