Moved some methods from PartDesign::Body to Part::BodyBase so the SketchObjects will be removed cleanly from the Body when deleted

This commit is contained in:
jrheinlaender
2013-05-04 10:52:54 +04:30
committed by Stefan Tröger
parent 5b3d5e6bd8
commit 02dfb8551d
13 changed files with 77 additions and 62 deletions

View File

@@ -72,27 +72,3 @@ void ViewProvider::updateData(const App::Property* prop)
}
inherited::updateData(prop);
}
bool ViewProvider::onDelete(const std::vector<std::string> &)
{
// Body feature housekeeping
PartDesign::Body* body = PartDesign::Body::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();
}
}
// TODO: Ask user what to do about dependent objects, e.g. Sketches that have this feature as their support
// 1. Delete
// 2. Suppress
// 3. Re-route
return true;
}