Salome HOME
Issue #3135: Provide standard mode of building for non-dragging objects
[modules/shaper.git] / src / PartSet / PartSet_Validators.cpp
index 4b72de19888a5286ef2696dc4b2e3c3a50581179..f8d05fe0a6c011c731d314ee19bc06739368b871 100644 (file)
@@ -282,26 +282,19 @@ bool PartSet_TangentSelection::isValid(const ModuleBase_ISelection* theSelection
       return false;
     GeomAPI_Edge aEdge1(aShape);
 
-    if (aEdge1.isLine() || aEdge1.isArc()) {
-      if (aList.size() == 2) {
-        // Check second selection
-        aPrs = aList.last();
-        const GeomShapePtr& aShape2 = aPrs->shape();
-        if (!aShape2.get() || aShape2->isNull() || aShape2->shapeType() != GeomAPI_Shape::EDGE)
-          return false;
-        GeomAPI_Edge aEdge2(aShape2);
-
-        if (aEdge1.isLine() && aEdge2.isArc())
-          return true;
-        else if (aEdge1.isArc() && aEdge2.isLine())
-          return true;
-        else
-          return false;
-      } else
-        return true;
+    if (aList.size() == 2) {
+      // Check second selection
+      aPrs = aList.last();
+      const GeomShapePtr& aShape2 = aPrs->shape();
+      if (!aShape2.get() || aShape2->isNull() || aShape2->shapeType() != GeomAPI_Shape::EDGE)
+        return false;
+      GeomAPI_Edge aEdge2(aShape2);
+
+      if (aEdge1.isLine() && aEdge2.isLine())
+        return false;
     }
-    return false;
   }
+  return true;
 }
 
 bool PartSet_AngleSelection::isValid(const ModuleBase_ISelection* theSelection,
@@ -335,12 +328,12 @@ bool PartSet_EqualSelection::isValid(const ModuleBase_ISelection* theSelection,
             aType = 1;
           else if (aType != 1)
             return false;
-        } else if (aEdge.isCircle()) {
+        } else if (aEdge.isCircle() || aEdge.isArc()) {
           if (aCount == 1)
             aType = 2;
           else if (aType != 2)
             return false;
-        } else if (aEdge.isArc()) {
+        } else if (aEdge.isEllipse()) {
           if (aCount == 1)
             aType = 3;
           else if (aType != 3)