GeoFeatureGroup: Handle drag into document

This commit is contained in:
Stefan Tröger
2017-02-09 21:34:02 +01:00
committed by wmayer
parent aa0d25f54f
commit 183a4b4ef3
10 changed files with 69 additions and 31 deletions

View File

@@ -265,16 +265,19 @@ Body* Body::findBodyOf(const App::DocumentObject* feature)
}
void Body::addObject(App::DocumentObject *feature)
std::vector<App::DocumentObject*> Body::addObject(App::DocumentObject *feature)
{
if(!isAllowed(feature))
throw Base::Exception("Body: object is not allowed");
//TODO: features should not add all links
/*
//only one group per object
auto *group = App::GroupExtension::getGroupOfObject(feature);
if(group && group != getExtendedObject())
group->getExtensionByType<App::GroupExtension>()->removeObject(feature);
*/
insertObject (feature, getNextSolidFeature (), /*after = */ false);
// Move the Tip if we added a solid
if (isSolidFeature(feature)) {
@@ -345,7 +348,7 @@ void Body::insertObject(App::DocumentObject* feature, App::DocumentObject* targe
}
void Body::removeObject(App::DocumentObject* feature)
std::vector<App::DocumentObject*> Body::removeObject(App::DocumentObject* feature)
{
App::DocumentObject* nextSolidFeature = getNextSolidFeature(feature);
App::DocumentObject* prevSolidFeature = getPrevSolidFeature(feature);