From: Artem Zhidkov Date: Mon, 23 Mar 2020 04:44:17 +0000 (+0300) Subject: Protect usage of B-spline in Split and Trim features. X-Git-Tag: V9_5_0a2~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8299ed3ffd6d85551ce62a314015660d0680d1cf;p=modules%2Fshaper.git Protect usage of B-spline in Split and Trim features. --- 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é +