Salome HOME
Deleted check after build for transformations.
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Validators.cpp
index 613e343629388cc70f11c205ccccd512b75b4233..fc93bc7dfd204b0f6486da93f2012aaf0f9c2dcb 100644 (file)
@@ -135,9 +135,11 @@ bool BuildPlugin_ValidatorBaseForWire::isValid(const std::shared_ptr<ModelAPI_Fe
     AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
     GeomShapePtr aShape = aSelection->value();
     if(!aShape.get()) {
-      aShape = aSelection->context()->shape();
+      if (aSelection->context().get())
+        aShape = aSelection->context()->shape();
     }
-    aListOfShapes.push_back(aShape);
+    if (aShape.get())
+      aListOfShapes.push_back(aShape);
   }
 
   // Create wire.
@@ -190,6 +192,11 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptr<ModelAPI_Fe
     }
   }
 
+  if(anEdges.empty()) {
+    theError = "Objects not selected.";
+    return false;
+  }
+
   // Check that edges does not have intersections.
   if(anEdges.size() > 1) {
     GeomAlgoAPI_PaveFiller aPaveFiller(anEdges, false);
@@ -213,7 +220,7 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptr<ModelAPI_Fe
   // Check that they are planar.
   std::shared_ptr<GeomAPI_Pln> aPln = GeomAlgoAPI_ShapeTools::findPlane(anEdges);
   if(!aPln.get()) {
-    theError = "Selected objects are not planar.";
+    theError = "Selected object(s) should belong to only one plane.";
     return false;
   }
 
@@ -222,7 +229,7 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptr<ModelAPI_Fe
   GeomAlgoAPI_SketchBuilder::createFaces(aPln->location(), aPln->xDirection(),
                                          aPln->direction(), anEdges, aFaces);
   if(aFaces.empty()) {
-    theError = "Selected objects does not have closed contours.";
+    theError = "Selected objects do not generate closed contour.";
     return false;
   }