diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 3249c20491..5238dd568a 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1445,9 +1445,9 @@ void CmdSketcherConstrainLock::activated(int iMsg) lastconstraintindex+=2; - if (edgeisblocked || GeoId[0] <= Sketcher::GeoEnum::RefExt - || isBsplineKnot(Obj,GeoId[0]) - || constraintCreationMode==Reference) { + if (edgeisblocked + || GeoId[0] <= Sketcher::GeoEnum::RefExt + || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)", @@ -2287,7 +2287,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg) // it is a constraint on a external line, make it non-driving if (arebothpointsorsegmentsfixed || GeoId1 <= Sketcher::GeoEnum::RefExt || - isBsplineKnot(Obj,GeoId1) || constraintCreationMode==Reference) { + constraintCreationMode==Reference) { const std::vector &ConStr = Obj->Constraints.getValues(); Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)", @@ -2379,9 +2379,8 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector &selSe GeoId1,ActLength); if (arebothpointsorsegmentsfixed - || GeoId1 <= Sketcher::GeoEnum::RefExt - || isBsplineKnot(Obj,GeoId1) - || constraintCreationMode==Reference) { + || GeoId1 <= Sketcher::GeoEnum::RefExt + || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving const std::vector &ConStr = Obj->Constraints.getValues(); @@ -3104,8 +3103,7 @@ void CmdSketcherConstrainDistanceY::activated(int iMsg) GeoId1,static_cast(PosId1),ActY); if (GeoId1 <= Sketcher::GeoEnum::RefExt - || isBsplineKnot(Obj,GeoId1) - || constraintCreationMode==Reference) { + || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving const std::vector &ConStr = Obj->Constraints.getValues(); diff --git a/src/Mod/Sketcher/Gui/Utils.cpp b/src/Mod/Sketcher/Gui/Utils.cpp index b1f669ce6a..5a24fd2fea 100644 --- a/src/Mod/Sketcher/Gui/Utils.cpp +++ b/src/Mod/Sketcher/Gui/Utils.cpp @@ -160,15 +160,6 @@ bool SketcherGui::checkBothExternal(int GeoId1, int GeoId2) return (GeoId1 < 0 && GeoId2 < 0); } -bool SketcherGui::checkBothExternalOrBSplinePoints(const Sketcher::SketchObject* Obj,int GeoId1, int GeoId2) -{ - if (GeoId1 == GeoEnum::GeoUndef || GeoId2 == GeoEnum::GeoUndef) - return false; - else - return (GeoId1 < 0 && GeoId2 < 0) || (isBsplineKnot(Obj,GeoId1) && isBsplineKnot(Obj,GeoId2)) || - (GeoId1 < 0 && isBsplineKnot(Obj,GeoId2)) || (GeoId2 < 0 && isBsplineKnot(Obj,GeoId1)); -} - bool SketcherGui::isPointOrSegmentFixed(const Sketcher::SketchObject* Obj, int GeoId) { const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); @@ -176,7 +167,7 @@ bool SketcherGui::isPointOrSegmentFixed(const Sketcher::SketchObject* Obj, int G if (GeoId == GeoEnum::GeoUndef) return false; else - return checkConstraint(vals, Sketcher::Block, GeoId, Sketcher::PointPos::none) || GeoId <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId); + return checkConstraint(vals, Sketcher::Block, GeoId, Sketcher::PointPos::none) || GeoId <= Sketcher::GeoEnum::RtPnt; } bool SketcherGui::areBothPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, int GeoId1, int GeoId2) @@ -186,8 +177,8 @@ bool SketcherGui::areBothPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj if (GeoId1 == GeoEnum::GeoUndef || GeoId2 == GeoEnum::GeoUndef) return false; else - return ((checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::PointPos::none) || GeoId1 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId1)) && - (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::PointPos::none) || GeoId2 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId2))); + return ((checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::PointPos::none) || GeoId1 <= Sketcher::GeoEnum::RtPnt) && + (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::PointPos::none) || GeoId2 <= Sketcher::GeoEnum::RtPnt)); } bool SketcherGui::areAllPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, int GeoId1, int GeoId2, int GeoId3) @@ -197,9 +188,9 @@ bool SketcherGui::areAllPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, if (GeoId1 == GeoEnum::GeoUndef || GeoId2 == GeoEnum::GeoUndef || GeoId3 == GeoEnum::GeoUndef) return false; else - return ((checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::PointPos::none) || GeoId1 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId1)) && - (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::PointPos::none) || GeoId2 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId2)) && - (checkConstraint(vals, Sketcher::Block, GeoId3, Sketcher::PointPos::none) || GeoId3 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId3))); + return ((checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::PointPos::none) || GeoId1 <= Sketcher::GeoEnum::RtPnt) && + (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::PointPos::none) || GeoId2 <= Sketcher::GeoEnum::RtPnt) && + (checkConstraint(vals, Sketcher::Block, GeoId3, Sketcher::PointPos::none) || GeoId3 <= Sketcher::GeoEnum::RtPnt)); } bool SketcherGui::isSimpleVertex(const Sketcher::SketchObject* Obj, int GeoId, PointPos PosId) diff --git a/src/Mod/Sketcher/Gui/Utils.h b/src/Mod/Sketcher/Gui/Utils.h index 6c0a1a1853..1bab078582 100644 --- a/src/Mod/Sketcher/Gui/Utils.h +++ b/src/Mod/Sketcher/Gui/Utils.h @@ -72,8 +72,6 @@ void getIdsFromName(const std::string &name, const Sketcher::SketchObject* Obj, bool checkBothExternal(int GeoId1, int GeoId2); -bool checkBothExternalOrBSplinePoints(const Sketcher::SketchObject* Obj,int GeoId1, int GeoId2); - bool isPointOrSegmentFixed(const Sketcher::SketchObject* Obj, int GeoId); bool areBothPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, int GeoId1, int GeoId2);