Sketcher: BSpline - Informing the user of non-supported tangencies

This commit is contained in:
Abdullah Tahiri 2017-01-15 00:57:05 +01:00
parent e53dc90c9a
commit 340d33f3a5

View File

@ -2341,6 +2341,15 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
return; 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"); openCommand("add tangent constraint");
Gui::Command::doCommand( Gui::Command::doCommand(
Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Tangent',%d,%d,%d)) ", Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Tangent',%d,%d,%d)) ",
@ -2361,6 +2370,17 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
const Part::Geometry *geom1 = Obj->getGeometry(GeoId1); const Part::Geometry *geom1 = Obj->getGeometry(GeoId1);
const Part::Geometry *geom2 = Obj->getGeometry(GeoId2); 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 && if( geom1 && geom2 &&
( geom1->getTypeId() == Part::GeomEllipse::getClassTypeId() || ( geom1->getTypeId() == Part::GeomEllipse::getClassTypeId() ||
geom2->getTypeId() == Part::GeomEllipse::getClassTypeId() )){ geom2->getTypeId() == Part::GeomEllipse::getClassTypeId() )){