Skip to content

Commit

Permalink
Sketcher: BSpline - Informing the user of non-supported tangencies
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullahtahiriyo committed Jan 14, 2017
1 parent e53dc90 commit 340d33f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Mod/Sketcher/Gui/CommandConstraints.cpp
Expand Up @@ -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(
Expand All @@ -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() )){
Expand Down

0 comments on commit 340d33f

Please sign in to comment.