From 8299ed3ffd6d85551ce62a314015660d0680d1cf Mon Sep 17 00:00:00 2001 From: Artem Zhidkov Date: Mon, 23 Mar 2020 07:44:17 +0300 Subject: [PATCH] Protect usage of B-spline in Split and Trim features. --- src/SketchPlugin/SketchPlugin_Validators.cpp | 14 ++++++++++++++ src/SketchPlugin/SketchPlugin_msg_fr.ts | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index a541519ad..9c96e9ad2 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -1019,6 +1019,13 @@ bool SketchPlugin_SplitValidator::isValid(const AttributePtr& theAttribute, if (!anAttrFeature) return aValid; + // B-splines are not supported by the Split yet + if (anAttrFeature->getKind() == SketchPlugin_BSpline::ID() || + anAttrFeature->getKind() == SketchPlugin_BSplinePeriodic::ID()) { + theError = "Not supported"; + return false; + } + std::set anEdgeShapes; ModelGeomAlgo_Shape::shapesOfType(anAttrFeature, GeomAPI_Shape::EDGE, anEdgeShapes); if (anEdgeShapes.empty() || anEdgeShapes.size() > 1 /*there case has not existed yet*/) @@ -1096,6 +1103,13 @@ bool SketchPlugin_TrimValidator::isValid(const AttributePtr& theAttribute, if (!aSketchFeature.get() || aSketchFeature->isCopy()) return aValid; + // B-splines are not supported by the Trim yet + if (aBaseFeature->getKind() == SketchPlugin_BSpline::ID() || + aBaseFeature->getKind() == SketchPlugin_BSplinePeriodic::ID()) { + theError = "Not supported"; + return false; + } + // point on feature AttributePoint2DPtr aPoint = std::dynamic_pointer_cast( aTrimFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT())); diff --git a/src/SketchPlugin/SketchPlugin_msg_fr.ts b/src/SketchPlugin/SketchPlugin_msg_fr.ts index 5e1b889ba..8faf6bec1 100644 --- a/src/SketchPlugin/SketchPlugin_msg_fr.ts +++ b/src/SketchPlugin/SketchPlugin_msg_fr.ts @@ -3998,6 +3998,10 @@ Unknown error. Erreur inconnue. + + Not supported + Non supporté + SketchSplit:ConstraintEntityA:SketchPlugin_SplitValidator @@ -4046,6 +4050,10 @@ Unknown error. Erreur inconnue. + + Not supported + Non supporté + -- 2.39.2