Fixed bug that didn't clean up the Body when deleting an object from it
This commit is contained in:
parent
f9b0e5908a
commit
c21f21666f
|
@ -108,3 +108,22 @@ void ViewProvider::updateData(const App::Property* prop)
|
|||
}
|
||||
inherited::updateData(prop);
|
||||
}
|
||||
|
||||
bool ViewProvider::onDelete(const std::vector<std::string> &)
|
||||
{
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ public:
|
|||
protected:
|
||||
virtual void unsetEdit(int ModNum);
|
||||
|
||||
virtual bool onDelete(const std::vector<std::string> &);
|
||||
|
||||
std::string oldWb;
|
||||
App::DocumentObject* oldTip;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user