]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Protect usage of B-spline in Split and Trim features.
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Mon, 23 Mar 2020 04:44:17 +0000 (07:44 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Mon, 23 Mar 2020 04:44:17 +0000 (07:44 +0300)
src/SketchPlugin/SketchPlugin_Validators.cpp
src/SketchPlugin/SketchPlugin_msg_fr.ts

index a541519adbc838f38c73c7ff6346b07b6fce7fa5..9c96e9ad224fd8f5893b617358c214ddca4b9560 100644 (file)
@@ -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<ResultPtr> 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<GeomDataAPI_Point2D>(
                        aTrimFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
index 5e1b889bacf01f47d7bb547ff7cc876c1f8e3330..8faf6bec1f50d6b1f91576e7f96999cdd83aea12 100644 (file)
       <source>Unknown error.</source>
       <translation>Erreur inconnue.</translation>
     </message>
+    <message>
+      <source>Not supported</source>
+      <translation>Non supporté</translation>
+    </message>
   </context>
   <context>
     <name>SketchSplit:ConstraintEntityA:SketchPlugin_SplitValidator</name>
       <source>Unknown error.</source>
       <translation>Erreur inconnue.</translation>
     </message>
+    <message>
+      <source>Not supported</source>
+      <translation>Non supporté</translation>
+    </message>
   </context>
 
   <context>