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);
75G4PhysicalVolumesSearchScene::Matcher::Matcher(
const G4String& requiredMatch)
78 if (requiredMatch.size()) {
79 size_t last = requiredMatch.size() - 1;
82 if (requiredMatch[0U] ==
'/' && requiredMatch[last] ==
'/') {
87 fRequiredMatch = requiredMatch.substr(1,last-1);
91 fRequiredMatch = requiredMatch;
94 if (fRequiredMatch.isNull()) {
96 (
"G4PhysicalVolumesSearchScene::Matcher::Matcher",
97 "modeling0013",
JustWarning,
"Required match is null");
101G4bool G4PhysicalVolumesSearchScene::Matcher::Match(
const G4String& s)
107 if (fRequiredMatch.size()) {
109 std::regex requiredRegex(fRequiredMatch);
111 std::regex_search(s.c_str(), match, requiredRegex);
112 if (match.size() > 0) found =
true;
114 if (s == fRequiredMatch) found =
true;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
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