From 340d33f3a5b19a768e752be99f6d7a672bb49b1d Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sun, 15 Jan 2017 00:57:05 +0100 Subject: [PATCH] Sketcher: BSpline - Informing the user of non-supported tangencies --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 6554383fa..1f9d4a338 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -2340,6 +2340,15 @@ void CmdSketcherConstrainTangent::activated(int iMsg) QObject::tr("Cannot add a tangency constraint at an unconnected point!")); return; } + + const Part::Geometry *geom2 = Obj->getGeometry(GeoId2); + + if( geom2 && geom2->getTypeId() == Part::GeomBSplineCurve::getClassTypeId() ){ + // unsupported until tangent to BSpline at any point implemented. + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("Tangency to BSpline edge currently unsupported.")); + return; + } openCommand("add tangent constraint"); Gui::Command::doCommand( @@ -2361,6 +2370,17 @@ void CmdSketcherConstrainTangent::activated(int iMsg) const Part::Geometry *geom1 = Obj->getGeometry(GeoId1); const Part::Geometry *geom2 = Obj->getGeometry(GeoId2); + if( geom1 && geom2 && + ( geom1->getTypeId() == Part::GeomBSplineCurve::getClassTypeId() || + geom2->getTypeId() == Part::GeomBSplineCurve::getClassTypeId() )){ + + // unsupported until tangent to BSpline at any point implemented. + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("Tangency to BSpline edge currently unsupported.")); + return; + } + + if( geom1 && geom2 && ( geom1->getTypeId() == Part::GeomEllipse::getClassTypeId() || geom2->getTypeId() == Part::GeomEllipse::getClassTypeId() )){