Salome HOME
Change icons for chamfer
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MacroArc.cpp
index b6a09bde6af0dcd820b36d2ff88b344ef7856607..3e6327e08ef04fc5a9bc844f1018048a0014266d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_MacroArc.h"
@@ -373,6 +372,7 @@ void SketchPlugin_MacroArc::execute()
   Events_Loop::loop()->send(aMessage);
 }
 
+// LCOV_EXCL_START
 std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
   std::string aFilledAttributeName;
@@ -450,6 +450,7 @@ std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptr<Events_Mes
   }
   return aFilledAttributeName;
 }
+// LCOV_EXCL_STOP
 
 FeaturePtr SketchPlugin_MacroArc::createArcFeature()
 {
@@ -491,6 +492,9 @@ void SketchPlugin_MacroArc::fillByCenterAndTwoPassed()
     return;
 
   GeomAPI_Circ2d aCircleForArc(myCenter, myStart);
+  // avoid degerated arc, when the center and the start points are equal
+  if (!aCircleForArc.implPtr<void*>())
+    return;
 
   bool aWasBlocked = data()->blockSendAttributeUpdated(true);
   // check the end point is referred to another feature