Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MacroArc.cpp
index 54c2f64b7ac2d928a5c48d28dcdc1a542eb71bab..5760531b1efa4b4be6b4ffc6f0d825f0ee21395b 100644 (file)
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        SketchPlugin_MacroArc.cpp
-// Created:     26 Apr 2014
-// Author:      Artem ZHIDKOV
+// Copyright (C) 2014-2017  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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 #include "SketchPlugin_MacroArc.h"
 
@@ -113,7 +126,9 @@ static void intersectShapeAndCircle(const GeomShapePtr& theShape,
       }
     }
   }
-  theIntersection->setValue(anInterPnt);
+  if(anInterPnt.get()) {
+    theIntersection->setValue(anInterPnt);
+  }
 }
 
 
@@ -616,6 +631,8 @@ void SketchPlugin_MacroArc::fillByTangentEdge()
   aCircBuilder.addTangentCurve(aTangentShape);
 
   std::shared_ptr<GeomAPI_Circ2d> aCircle = aCircBuilder.circle();
+  if (!aCircle)
+    return;
   myCenter = aCircle->center();
 
   // rebuild circle to set start point equal to zero parameter