]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Adjust arc intersection validator (issue #2120)
authorazv <azv@opencascade.com>
Wed, 12 Apr 2017 08:31:07 +0000 (11:31 +0300)
committerazv <azv@opencascade.com>
Wed, 12 Apr 2017 08:31:25 +0000 (11:31 +0300)
src/SketchPlugin/SketchPlugin_Validators.cpp

index e5b194c900346ad1130a81e1fad46ad338f9fe8f..96b01f6d59868bce8aad3c3bfc4f89524fa978ea 100755 (executable)
@@ -1442,7 +1442,10 @@ bool SketchPlugin_ArcEndPointIntersectionValidator::isValid(
 
   ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
   if(aResult.get()) {
-    GeomShapePtr aShape = toInfiniteEdge(aResult->shape());
+    GeomShapePtr aShape = aResult->shape();
+    if (!aShape->isEdge())
+      return true;
+    aShape = toInfiniteEdge(aShape);
     if(aShape.get() && !aShape->isNull()) {
       if(anArcShape->isIntersect(aShape)) {
         return true;
@@ -1457,7 +1460,10 @@ bool SketchPlugin_ArcEndPointIntersectionValidator::isValid(
         anIt != aResults.cend();
         ++anIt)
     {
-      GeomShapePtr aShape = toInfiniteEdge((*anIt)->shape());
+      GeomShapePtr aShape = (*anIt)->shape();
+      if (!aShape->isEdge())
+        return true;
+      aShape = toInfiniteEdge(aShape);
       if(aShape.get() && !aShape->isNull()) {
         if(anArcShape->isIntersect(aShape)) {
           return true;