PartDesign: Port body to be a origin group

This commit is contained in:
Stefan Tröger
2016-12-21 08:51:54 +01:00
committed by wmayer
parent 47ed29fffd
commit 9a3b952fb9
17 changed files with 82 additions and 128 deletions

View File

@@ -136,7 +136,7 @@ bool TaskDlgDatumParameters::accept() {
//the user has to decide which option we should take if external references are used
bool ext = false;
for(App::DocumentObject* obj : pcDatum->Support.getValues()) {
if(!pcActiveBody->hasFeature(obj) && !pcActiveBody->getOrigin()->hasObject(obj))
if(!pcActiveBody->hasObject(obj) && !pcActiveBody->getOrigin()->hasObject(obj))
ext = true;
}
if(ext) {
@@ -155,7 +155,7 @@ bool TaskDlgDatumParameters::accept() {
int index = 0;
for(App::DocumentObject* obj : pcDatum->Support.getValues()) {
if(!pcActiveBody->hasFeature(obj) && !pcActiveBody->getOrigin()->hasObject(obj)) {
if(!pcActiveBody->hasObject(obj) && !pcActiveBody->getOrigin()->hasObject(obj)) {
objs.push_back(PartDesignGui::TaskFeaturePick::makeCopy(obj, subs[index], dlg.radioIndependent->isChecked()));
copies.push_back(objs.back());
subs[index] = "";
@@ -176,7 +176,7 @@ bool TaskDlgDatumParameters::accept() {
//we need to add the copied features to the body after the command action, as otherwise freecad crashs unexplainable
for(auto obj : copies) {
if(pcActiveBody)
pcActiveBody->addFeature(obj);
pcActiveBody->addObject(obj);
else if (pcActivePart)
pcActivePart->addObject(obj);
}