Enable Part_Mirror child item in tree

Part_Mirror now shows its child shape in the tree under
the newly created Mirror Feature. On deletion it's
child shape is set to show (if it had been hidden). Thus
making its behaviour and appearance consistant with other
Part tools, E.G. Part Fillet, Part Loft, etc.
This commit is contained in:
jmaustpc 2013-03-14 02:01:12 +11:00 committed by Yorik van Havre
parent 0b025ef5af
commit ecc28163bb
2 changed files with 21 additions and 0 deletions

View File

@ -169,6 +169,24 @@ void ViewProviderMirror::unsetEdit(int ModNum)
}
}
std::vector<App::DocumentObject*> ViewProviderMirror::claimChildren() const
{
std::vector<App::DocumentObject*> temp;
temp.push_back(static_cast<Part::Mirroring*>(getObject())->Source.getValue());
return temp;
}
bool ViewProviderMirror::onDelete(const std::vector<std::string> &)
{
// get the input shape
Part::Mirroring* pMirroring = static_cast<Part::Mirroring*>(getObject());
App::DocumentObject *pSource = pMirroring->Source.getValue();
if (pSource)
Gui::Application::Instance->showViewProvider(pSource);
return true;
}
void ViewProviderMirror::dragStartCallback(void *data, SoDragger *)
{
// This is called when a manipulator is about to manipulating

View File

@ -39,6 +39,9 @@ public:
/** @name Edit methods */
//@{
void setupContextMenu(QMenu*, QObject*, const char*);
std::vector<App::DocumentObject*> claimChildren() const;
bool onDelete(const std::vector<std::string> &);
protected:
bool setEdit(int ModNum);
void unsetEdit(int ModNum);