X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Fillet.cpp;h=e076f47c2454d2b1ba6081c6dc91f7fb6e9b8f43;hb=bb4d0036dd0785056ab21fc237ec7fcc0870ae5f;hp=3373df8c6df0504ea4a39d8531c6cb8e5c534a10;hpb=dc75c390f0aa6108d6983a8618dc4b9a4cd5949e;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Fillet.cpp b/src/SketchPlugin/SketchPlugin_Fillet.cpp index 3373df8c6..e076f47c2 100644 --- a/src/SketchPlugin/SketchPlugin_Fillet.cpp +++ b/src/SketchPlugin/SketchPlugin_Fillet.cpp @@ -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 @@ -12,10 +12,9 @@ // // 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SketchPlugin_Fillet.h" @@ -82,8 +81,9 @@ static std::set findFeaturesToRemove(const FeaturePtr theFeature, const AttributePtr theAttribute); SketchPlugin_Fillet::SketchPlugin_Fillet() -: myFilletCreated(false) +: myFilletCreated(false), myIsReversed(false) { + myIsNotInversed[0] = myIsNotInversed[1] = true; } void SketchPlugin_Fillet::initAttributes() @@ -104,6 +104,10 @@ void SketchPlugin_Fillet::execute() // create feature for fillet arc FeaturePtr aFilletArc = createFilletArc(); + if (!aFilletArc) { + setError("Error: unable to create a fillet arc."); + return; + } // collect features referred to the edges participating in fillet AttributePoint2DPtr aFilletPoints[2]; @@ -308,6 +312,10 @@ FeaturePtr SketchPlugin_Fillet::createFilletArc() if (!myBaseFeatures[0] || !myBaseFeatures[1]) calculateFilletParameters(); + // fix for issue #2810 (sometimes, myCenterXY is NULL, fillet should report an error) + if (!myCenterXY) + return FeaturePtr(); + // Create arc feature. FeaturePtr aFilletArc = sketch()->addFeature(SketchPlugin_Arc::ID());