Toponaming: add code to implement guessing missing references

This commit is contained in:
bgbsww
2024-08-03 13:21:01 -04:00
committed by Chris Hennes
parent 87cc683ccc
commit 80045d0e88
4 changed files with 34 additions and 2 deletions

View File

@@ -461,6 +461,22 @@ TaskDlgDressUpParameters::TaskDlgDressUpParameters(ViewProviderDressUp *DressUpV
, parameter(nullptr)
{
assert(DressUpView);
auto pcDressUp = dynamic_cast<PartDesign::DressUp*>(DressUpView->getObject());
auto base = pcDressUp->Base.getValue();
std::vector<std::string> newSubList;
bool changed = false;
auto& shadowSubs = pcDressUp->Base.getShadowSubs();
for ( auto &shadowSub : shadowSubs ) {
auto displayName = shadowSub.oldName;
// If there is a missing tag on the shadow sub, take a guess at a new name.
if ( boost::starts_with(shadowSub.oldName,Data::MISSING_PREFIX)) {
Part::Feature::guessNewLink(displayName, base, shadowSub.newName.c_str());
newSubList.emplace_back(displayName);
changed = true;
}
}
if ( changed )
pcDressUp->Base.setValue(base, newSubList);
}
TaskDlgDressUpParameters::~TaskDlgDressUpParameters() = default;