X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Scale.cpp;h=776ef1960107ce9eee389b6e3510f1fa84a2ff2f;hb=f1fdc6c4b73b4f4c80c83c5a795e370ab0d7fc26;hp=bde61cc26e94a1f596d93eae37f6dbc30c1c001c;hpb=c45761be52fed120c7e9a90eb2095cdc6cfb4334;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Scale.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Scale.cpp index bde61cc26..776ef1960 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Scale.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Scale.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2021 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 @@ -28,6 +28,10 @@ GeomAlgoAPI_Scale::GeomAlgoAPI_Scale(std::shared_ptr theSourceSha std::shared_ptr theCenterPoint, double theScaleFactor) { + if (!theCenterPoint) { + myError = "Scale builder :: center point is not valid."; + return; + } if (fabs(theScaleFactor) < Precision::Confusion()) { myError = "Scale builder :: the scale factor is null."; return; @@ -46,6 +50,10 @@ GeomAlgoAPI_Scale::GeomAlgoAPI_Scale(std::shared_ptr theSourceSha double theScaleFactorY, double theScaleFactorZ) { + if (!theCenterPoint) { + myError = "Scale builder :: center point is not valid."; + return; + } if (fabs(theScaleFactorX) < Precision::Confusion()) { myError = "Scale builder :: the scale factor in X is null."; return; @@ -70,6 +78,11 @@ void GeomAlgoAPI_Scale::buildByDimensions(std::shared_ptr theSour double theScaleFactorY, double theScaleFactorZ) { + if (!theSourceShape) { + myError = "Scale builder :: source shape is not valid."; + return; + } + const gp_Pnt& aCenterPoint = theCenterPoint->impl(); // Perform the rotation matrix