PartDesign: Body rework - add BaseFeature property and make Tip always point to solid

This commit is contained in:
Alexander Golubev
2015-08-06 20:46:26 +03:00
committed by Stefan Tröger
parent 37320a0bfa
commit 8c5d514b18
17 changed files with 470 additions and 416 deletions

View File

@@ -127,17 +127,15 @@ bool ViewProviderPart::doubleClicked(void)
bool ViewProviderPart::onDelete(const std::vector<std::string> &)
{
// TODO Why the heck it's here? (2015-08-05, Fat-Zer)
// Body feature housekeeping
Part::BodyBase* body = Part::BodyBase::findBodyOf(getObject());
if (body != NULL) {
body->removeFeature(getObject());
// Make the new Tip and the previous solid feature visible again
App::DocumentObject* tip = body->Tip.getValue();
App::DocumentObject* prev = body->getPrevSolidFeature();
if (tip != NULL) {
Gui::Application::Instance->getViewProvider(tip)->show();
if ((tip != prev) && (prev != NULL))
Gui::Application::Instance->getViewProvider(prev)->show();
}
}