Toponaming: fix secondElementSelection and SelectionView

This commit is contained in:
bgbsww
2024-06-15 17:21:49 -04:00
committed by Chris Hennes
parent 1f4b8d74d5
commit 2d9e9efdd3
3 changed files with 84 additions and 72 deletions

View File

@@ -71,6 +71,7 @@
#endif
#include <App/Document.h>
#include <App/GeoFeature.h>
#include <App/ElementNamingUtils.h>
#include <Base/Tools.h>
#include <Base/UnitsApi.h>
@@ -396,8 +397,14 @@ void SoFCUnifiedSelection::doAction(SoAction *action)
if (vp && (useNewSelection.getValue()||vp->useNewSelectionModel()) && vp->isSelectable()) {
SoDetail *detail = nullptr;
detailPath->truncate(0);
auto subName = selaction->SelChange.pSubName;
#ifdef FC_USE_TNP_FIX
std::pair<std::string, std::string> elementName;
App::GeoFeature::resolveElement(obj,subName,elementName);
subName = elementName.second.c_str(); // Use the shortened element name not the full one.
#endif
if(!selaction->SelChange.pSubName || !selaction->SelChange.pSubName[0] ||
vp->getDetailPath(selaction->SelChange.pSubName,detailPath,true,detail))
vp->getDetailPath(subName,detailPath,true,detail))
{
SoSelectionElementAction::Type type = SoSelectionElementAction::None;
if (selaction->SelChange.Type == SelectionChanges::AddSelection) {