MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / importSubNames

Method importSubNames

src/App/ObjectIdentifier.cpp:1775–1810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1773}
1774
1775void ObjectIdentifier::importSubNames(const ObjectIdentifier::SubNameMap& subNameMap)
1776{
1777 if (!owner || !owner->getDocument()) {
1778 return;
1779 }
1780 ResolveResults result(*this);
1781 auto it = subNameMap.find(std::make_pair(result.resolvedDocumentObject, std::string()));
1782 if (it != subNameMap.end()) {
1783 auto obj = owner->getDocument()->getObject(it->second.c_str());
1784 if (!obj) {
1785 FC_ERR("Failed to find import object " << it->second << " from "
1786 << result.resolvedDocumentObject->getFullName());
1787 return;
1788 }
1789 documentNameSet = false;
1790 documentName.str.clear();
1791 if (documentObjectName.isRealString()) {
1792 documentObjectName.str = obj->Label.getValue();
1793 }
1794 else {
1795 documentObjectName.str = obj->getNameInDocument();
1796 }
1797 _cache.clear();
1798 }
1799 if (subObjectName.getString().empty()) {
1800 return;
1801 }
1802 it = subNameMap.find(std::make_pair(result.resolvedDocumentObject, subObjectName.str));
1803 if (it == subNameMap.end()) {
1804 return;
1805 }
1806 subObjectName = String(it->second, true);
1807 _cache.clear();
1808 shadowSub.newName.clear();
1809 shadowSub.oldName.clear();
1810}
1811
1812bool ObjectIdentifier::updateElementReference(ExpressionVisitor& v,
1813 App::DocumentObject* feature,

Callers

nothing calls this directly

Calls 13

isRealStringMethod · 0.80
StringClass · 0.70
getDocumentMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getObjectMethod · 0.45
c_strMethod · 0.45
getFullNameMethod · 0.45
clearMethod · 0.45
getValueMethod · 0.45
getNameInDocumentMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected