+ fixes #0001058: Add items to Fusion by dragging item onto it
This commit is contained in:
parent
38d55b540e
commit
fb8b88773a
|
@ -235,6 +235,37 @@ bool ViewProviderMultiFuse::onDelete(const std::vector<std::string> &)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ViewProviderMultiFuse::canDragObjects() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ViewProviderMultiFuse::dragObject(App::DocumentObject* obj)
|
||||||
|
{
|
||||||
|
Part::MultiFuse* pBool = static_cast<Part::MultiFuse*>(getObject());
|
||||||
|
std::vector<App::DocumentObject*> pShapes = pBool->Shapes.getValues();
|
||||||
|
for (std::vector<App::DocumentObject*>::iterator it = pShapes.begin(); it != pShapes.end(); ++it) {
|
||||||
|
if (*it == obj) {
|
||||||
|
pShapes.erase(it);
|
||||||
|
pBool->Shapes.setValues(pShapes);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ViewProviderMultiFuse::canDropObjects() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ViewProviderMultiFuse::dropObject(App::DocumentObject* obj)
|
||||||
|
{
|
||||||
|
Part::MultiFuse* pBool = static_cast<Part::MultiFuse*>(getObject());
|
||||||
|
std::vector<App::DocumentObject*> pShapes = pBool->Shapes.getValues();
|
||||||
|
pShapes.push_back(obj);
|
||||||
|
pBool->Shapes.setValues(pShapes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PROPERTY_SOURCE(PartGui::ViewProviderMultiCommon,PartGui::ViewProviderPart)
|
PROPERTY_SOURCE(PartGui::ViewProviderMultiCommon,PartGui::ViewProviderPart)
|
||||||
|
|
||||||
|
@ -320,3 +351,34 @@ bool ViewProviderMultiCommon::onDelete(const std::vector<std::string> &)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ViewProviderMultiCommon::canDragObjects() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ViewProviderMultiCommon::dragObject(App::DocumentObject* obj)
|
||||||
|
{
|
||||||
|
Part::MultiCommon* pBool = static_cast<Part::MultiCommon*>(getObject());
|
||||||
|
std::vector<App::DocumentObject*> pShapes = pBool->Shapes.getValues();
|
||||||
|
for (std::vector<App::DocumentObject*>::iterator it = pShapes.begin(); it != pShapes.end(); ++it) {
|
||||||
|
if (*it == obj) {
|
||||||
|
pShapes.erase(it);
|
||||||
|
pBool->Shapes.setValues(pShapes);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ViewProviderMultiCommon::canDropObjects() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ViewProviderMultiCommon::dropObject(App::DocumentObject* obj)
|
||||||
|
{
|
||||||
|
Part::MultiCommon* pBool = static_cast<Part::MultiCommon*>(getObject());
|
||||||
|
std::vector<App::DocumentObject*> pShapes = pBool->Shapes.getValues();
|
||||||
|
pShapes.push_back(obj);
|
||||||
|
pBool->Shapes.setValues(pShapes);
|
||||||
|
}
|
||||||
|
|
|
@ -62,6 +62,12 @@ public:
|
||||||
QIcon getIcon(void) const;
|
QIcon getIcon(void) const;
|
||||||
void updateData(const App::Property*);
|
void updateData(const App::Property*);
|
||||||
bool onDelete(const std::vector<std::string> &);
|
bool onDelete(const std::vector<std::string> &);
|
||||||
|
|
||||||
|
/// drag and drop
|
||||||
|
bool canDragObjects() const;
|
||||||
|
void dragObject(App::DocumentObject*);
|
||||||
|
bool canDropObjects() const;
|
||||||
|
void dropObject(App::DocumentObject*);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ViewProvider for the MultiFuse feature
|
/// ViewProvider for the MultiFuse feature
|
||||||
|
@ -80,6 +86,12 @@ public:
|
||||||
QIcon getIcon(void) const;
|
QIcon getIcon(void) const;
|
||||||
void updateData(const App::Property*);
|
void updateData(const App::Property*);
|
||||||
bool onDelete(const std::vector<std::string> &);
|
bool onDelete(const std::vector<std::string> &);
|
||||||
|
|
||||||
|
/// drag and drop
|
||||||
|
bool canDragObjects() const;
|
||||||
|
void dragObject(App::DocumentObject*);
|
||||||
|
bool canDropObjects() const;
|
||||||
|
void dropObject(App::DocumentObject*);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user