0000736: when object is deleted, auto show its parametric objects

This commit is contained in:
wmayer
2012-07-07 13:32:27 +02:00
parent d08334dacc
commit 847c44e6bb
5 changed files with 102 additions and 0 deletions

View File

@@ -243,6 +243,17 @@ std::vector<App::DocumentObject*> ViewProviderFillet::claimChildren() const
return temp;
}
bool ViewProviderFillet::onDelete(const std::vector<std::string> &)
{
// get the input shape
Part::Fillet* pFillet = static_cast<Part::Fillet*>(getObject());
App::DocumentObject *pBase = pFillet->Base.getValue();
if (pBase)
Gui::Application::Instance->showViewProvider(pBase);
return true;
}
// ---------------------------------------
PROPERTY_SOURCE(PartGui::ViewProviderChamfer, PartGui::ViewProviderPart)
@@ -296,6 +307,17 @@ std::vector<App::DocumentObject*> ViewProviderChamfer::claimChildren() const
return temp;
}
bool ViewProviderChamfer::onDelete(const std::vector<std::string> &)
{
// get the input shape
Part::Chamfer* pChamfer = static_cast<Part::Chamfer*>(getObject());
App::DocumentObject *pBase = pChamfer->Base.getValue();
if (pBase)
Gui::Application::Instance->showViewProvider(pBase);
return true;
}
// ---------------------------------------
PROPERTY_SOURCE(PartGui::ViewProviderRevolution, PartGui::ViewProviderPart)
@@ -315,3 +337,14 @@ std::vector<App::DocumentObject*> ViewProviderRevolution::claimChildren() const
temp.push_back(static_cast<Part::Revolution*>(getObject())->Source.getValue());
return temp;
}
bool ViewProviderRevolution::onDelete(const std::vector<std::string> &)
{
// get the input shape
Part::Revolution* pRevolve = static_cast<Part::Revolution*>(getObject());
App::DocumentObject *pBase = pRevolve->Source.getValue();
if (pBase)
Gui::Application::Instance->showViewProvider(pBase);
return true;
}