X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FParametersAPI%2FParametersAPI_Parameter.cpp;h=2af3eec68d1bd59e38dd6436496423c4f77fb9c5;hb=02018d26c9d5f1f36661ac3c8b40182ab9f98d98;hp=7bc88521a282950f9fc61c375c0796507140e4ca;hpb=2532fb2df83ee1ddd9ff3e8b381d3788eaa15b69;p=modules%2Fshaper.git diff --git a/src/ParametersAPI/ParametersAPI_Parameter.cpp b/src/ParametersAPI/ParametersAPI_Parameter.cpp index 7bc88521a..2af3eec68 100644 --- a/src/ParametersAPI/ParametersAPI_Parameter.cpp +++ b/src/ParametersAPI/ParametersAPI_Parameter.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,9 +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 "ParametersAPI_Parameter.h" @@ -22,6 +22,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------- ParametersAPI_Parameter::ParametersAPI_Parameter( const std::shared_ptr & theFeature) @@ -91,3 +92,14 @@ ParameterPtr addParameter(const std::shared_ptr & thePart, std::shared_ptr aFeature = thePart->addFeature(ParametersAPI_Parameter::ID()); return ParameterPtr(new ParametersAPI_Parameter(aFeature, theName, theExpression, theComment)); } + +//-------------------------------------------------------------------------------------- +void removeParameter(const std::shared_ptr & thePart, + const ParameterPtr & theParameter) +{ + FeaturePtr aParam = theParameter->feature(); + if (aParam) { + ModelAPI_ReplaceParameterMessage::send(aParam, 0); + thePart->removeFeature(aParam); + } +}