Salome HOME
Extend the validator of 3D Fillet selection to get only sub-shapes of solids
authorazv <azv@opencascade.com>
Wed, 6 Dec 2017 11:45:05 +0000 (14:45 +0300)
committermpv <mpv@opencascade.com>
Wed, 6 Dec 2017 14:39:31 +0000 (17:39 +0300)
src/FeaturesPlugin/FeaturesPlugin_Validators.cpp

index 4c53bcbb2bf6b58047f571810267a58d4d249803..0df681c49b57241e0041271f751178918fd39a66 100644 (file)
@@ -693,6 +693,13 @@ bool FeaturesPlugin_ValidatorFilletSelection::isValid(const AttributePtr& theAtt
 
     ResultCompSolidPtr aContextOwner = ModelAPI_Tools::compSolidOwner(aContext);
     GeomShapePtr anOwner = aContextOwner.get() ? aContextOwner->shape() : aContext->shape();
+
+    if (anOwner->shapeType() != GeomAPI_Shape::SOLID &&
+        anOwner->shapeType() != GeomAPI_Shape::COMPSOLID) {
+      theError = "Error: Not all selected shapes are sub-shapes of solids";
+      return false;
+    }
+
     if (!aBaseSolid)
       aBaseSolid = anOwner;
     else if (!aBaseSolid->isEqual(anOwner)) {