PartDesign: Highlight body tip

==============================

It generates a small green icon on the treeview for those features being the tip of the body.
This commit is contained in:
Abdullah Tahiri
2018-01-30 19:45:11 +01:00
committed by wmayer
parent bb39cc783a
commit 758745f0be
4 changed files with 71 additions and 2 deletions

View File

@@ -225,6 +225,21 @@ void ViewProviderBody::updateData(const App::Property* prop)
//ensure all model features are in visual body mode
setVisualBodyMode(true);
}
if (prop == &body->Tip) {
// We changed Tip
App::DocumentObject* tip = body->Tip.getValue();
auto features = body->Group.getValues();
// restore icons
for ( auto feature : features) {
Gui::ViewProvider* vp = Gui::Application::Instance->activeDocument()->getViewProvider(feature);
if(vp->isDerivedFrom(PartDesignGui::ViewProvider::getClassTypeId())) {
static_cast<PartDesignGui::ViewProvider*>(vp)->setTipIcon(feature == tip);
}
}
}
PartGui::ViewProviderPart::updateData(prop);
}