Allow external references from other body but not from same body outside the support

This commit is contained in:
jrheinlaender 2013-07-15 07:40:03 +02:00 committed by Stefan Tröger
parent e735cf7c3a
commit 38ab82a94d

View File

@ -48,6 +48,7 @@
#include <Gui/SelectionFilter.h>
#include <Mod/Sketcher/App/SketchObject.h>
#include <Mod/Part/App/DatumFeature.h>
#include <Mod/Part/App/BodyBase.h>
#include "ViewProviderSketch.h"
#include "DrawSketchHandler.h"
@ -4481,8 +4482,17 @@ namespace SketcherGui {
pObj->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId()))
return true;
if (!sketch->allowOtherBody && (pObj != support))
return false;
if (pObj != support) {
// Selection outside of support not allowed
if (!sketch->allowOtherBody)
return false;
// Selection outside of support allowed if from other body
// TODO: There is still a possibility of creating cyclic references here
if (Part::BodyBase::findBodyOf(pObj) == Part::BodyBase::findBodyOf(support))
return false;
}
if (!sSubName || sSubName[0] == '\0')
return false;
std::string element(sSubName);