Toponaming: Process mapped names during selection
This commit is contained in:
@@ -415,7 +415,6 @@ bool PropertyLinkBase::_updateElementReference(DocumentObject *feature,
|
||||
const char* oldElement = Data::findElementName(shadow.second.c_str());
|
||||
if (!Data::hasMissingElement(oldElement)) {
|
||||
const auto& names = geo->searchElementCache(oldElement);
|
||||
// std::vector<std::string> names; // searchElementCache isn't implemented.
|
||||
if (names.size()) {
|
||||
missing = false;
|
||||
std::string newsub(subname, strlen(subname) - strlen(element));
|
||||
|
||||
@@ -625,6 +625,17 @@ bool SoFCUnifiedSelection::setSelection(const std::vector<PickedInfo> &infos, bo
|
||||
std::string subName = info.element;
|
||||
std::string objectName = objname;
|
||||
|
||||
#ifdef FC_USE_TNP_FIX
|
||||
// We need to convert the short name in the selection to a full element path to look it up
|
||||
// Ex: Body.Pad.Face9 to Body.Pad.;g3;SKT;:H12dc,E;FAC;:H12dc:4,F;:G0;XTR;:H12dc:8,F.Face9
|
||||
std::pair<std::string, std::string> elementName;
|
||||
App::GeoFeature::resolveElement(vpd->getObject(), subName.c_str(), elementName);
|
||||
if ( !elementName.first.empty()) { // If we have a mapped name use it
|
||||
auto elementNameSuffix = Data::findElementName(subName.c_str()); // Only suffix
|
||||
subName.erase(subName.find(elementNameSuffix)); // Everything except original suffix suffix
|
||||
subName = subName.append(elementName.first); // Add the mapped name suffix,
|
||||
}
|
||||
#endif
|
||||
const char *subSelected = Gui::Selection().getSelectedElement(
|
||||
vpd->getObject(),subName.c_str());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user