40 const G4String& requiredPhysicalVolumeName,
42: fpSearchVolumesModel (pSearchVolumesModel)
43, fMatcher (requiredPhysicalVolumeName)
44, fRequiredCopyNo (requiredCopyNo)
47void G4PhysicalVolumesSearchScene::ProcessVolume (
const G4VSolid&)
56 if (fMatcher.Match(name)) {
57 if ((fRequiredCopyNo < 0 ||
58 fRequiredCopyNo == copyNo)) {
62 for (
auto& node: basePath) node.SetDrawn(
false);
76G4PhysicalVolumesSearchScene::Matcher::Matcher(
const G4String& requiredMatch)
79 if (requiredMatch.size()) {
80 std::size_t last = requiredMatch.size() - 1;
83 if (requiredMatch[0U] ==
'/' && requiredMatch[(G4int)last] ==
'/') {
88 fRequiredMatch = requiredMatch.substr(1,last-1);
92 fRequiredMatch = requiredMatch;
95 if (fRequiredMatch.empty()) {
97 (
"G4PhysicalVolumesSearchScene::Matcher::Matcher",
98 "modeling0013", JustWarning,
"Required match is null");
102G4bool G4PhysicalVolumesSearchScene::Matcher::Match(
const G4String& s)
108 if (fRequiredMatch.size()) {
110 std::regex requiredRegex(fRequiredMatch);
112 std::regex_search(s.c_str(), match, requiredRegex);
113 if (match.size() > 0) found =
true;
115 if (s == fRequiredMatch) found =
true;
G4int GetCurrentPVCopyNo() const
G4VPhysicalVolume * GetCurrentPV() const
const std::vector< G4PhysicalVolumeNodeID > & GetFullPVPath() const
G4VPhysicalVolume * GetTopPhysicalVolume() const
G4int GetCurrentDepth() const
G4PhysicalVolumesSearchScene(G4PhysicalVolumeModel *pSearchVolumeModel, const G4String &requiredPhysicalVolumeName, G4int requiredCopyNo=-1)
const G4Transform3D * fpCurrentObjectTransformation
const G4String & GetName() const