From 0496df65383cc6bf0ea17dd8f22d08c4201a5d49 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 16 Jan 2012 14:45:48 +0000 Subject: [PATCH] + check if re-mapping causes cyclic dependency git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5409 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Mod/Sketcher/Gui/Command.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Mod/Sketcher/Gui/Command.cpp b/src/Mod/Sketcher/Gui/Command.cpp index eeddfb858..6a5a5061d 100644 --- a/src/Mod/Sketcher/Gui/Command.cpp +++ b/src/Mod/Sketcher/Gui/Command.cpp @@ -215,6 +215,15 @@ void CmdSketcherMapSketch::activated(int iMsg) qApp->translate(className(),"You have to select a single face as support for a sketch!")); return; } + + std::vector input = part->getOutList(); + if (std::find(input.begin(), input.end(), sel[index]) != input.end()) { + QMessageBox::warning(Gui::getMainWindow(), + qApp->translate(className(),"Cyclic dependency"), + qApp->translate(className(),"You cannot choose a support object depending on the selected sketch!")); + return; + } + // get the selected sub shape (a Face) const Part::TopoShape &shape = part->Shape.getValue(); TopoDS_Shape sh = shape.getSubShape(sub[0].c_str());