From c57c9bfc22cb33017190c192918acf9fbe9a8025 Mon Sep 17 00:00:00 2001 From: Richard S <83545331+richeldichel@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:14:52 +0200 Subject: [PATCH] Add warning when user sets a tag instead of a distinct geometry path (#119) * Add warning when user sets a tag instead of a distinct geometry path * Move warning message to RetrieveSpacesBySpecifier and RetrieveSurfacesBySpecifier * Get rid of unnecessary include * Move check to better place --- KGeoBag/Source/Core/Source/KGInterface.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/KGeoBag/Source/Core/Source/KGInterface.cc b/KGeoBag/Source/Core/Source/KGInterface.cc index 6211c1f47..898a169a1 100644 --- a/KGeoBag/Source/Core/Source/KGInterface.cc +++ b/KGeoBag/Source/Core/Source/KGInterface.cc @@ -179,6 +179,10 @@ void KGInterface::RetrieveSurfacesByPath(vector& anAccumulator, KGSp if (tNestPos == string::npos) { if (tHead.find_first_of(sTag) == 0) { + if (aNode == fRoot){ + coremsg(eWarning) << "Path definition for surfaces just contains a tag, which can make it ambiguous: <" << aPath << ">. Please specify a distinct geometry path!" << eom; + } + string tTag; int tRecursion; @@ -310,6 +314,10 @@ void KGInterface::RetrieveSpacesByPath(vector& anAccumulator, KGSpace* if (tNestPos == string::npos) { if (tHead.find_first_of(sTag) == 0) { + if (aNode == fRoot){ + coremsg(eWarning) << "Path definition for spaces just contains a tag, which can make it ambiguous: <" << aPath << ">. Please specify a distinct geometry path!" << eom; + } + string tTag; int tRecursion;