X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Folder.cpp;h=18ac4e6e2eaca285d1b9b053e028d482a02957f7;hb=a13f87935d2a6f52f942790b6abc874f1016c9fc;hp=77d696723bf36619630e0e2e073ce6a2dfdf1436;hpb=9b61e5ee5eafe9d6948d9a78667efa2abec132c3;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Folder.cpp b/src/ModelHighAPI/ModelHighAPI_Folder.cpp index 77d696723..18ac4e6e2 100644 --- a/src/ModelHighAPI/ModelHighAPI_Folder.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Folder.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 "ModelHighAPI_Folder.h" @@ -25,6 +24,7 @@ #include #include +#include //-------------------------------------------------------------------------------------- @@ -59,13 +59,13 @@ bool ModelHighAPI_Folder::initialize() return true; } -void ModelHighAPI_Folder::setName(const std::string& theName) +void ModelHighAPI_Folder::setName(const std::wstring& theName) { if (myFolder && myFolder->data() && myFolder->data()->isValid()) myFolder->data()->setName(theName); } -std::string ModelHighAPI_Folder::name() const +std::wstring ModelHighAPI_Folder::name() const { return myFolder->data()->name(); } @@ -110,5 +110,13 @@ std::shared_ptr addFolder(const std::shared_ptrreference(ModelAPI_Folder::LAST_FEATURE_ID()); fillAttribute(theLastFeature.feature(), aLastFeatAttr); + // to update the folder state in the Object Browser + theDoc->updateHistory(ModelAPI_Feature::group()); + return std::shared_ptr(new ModelHighAPI_Folder(aFolder)); } + +void removeFolder(std::shared_ptr& theFolder) +{ + theFolder->folder()->document()->removeFolder(theFolder->folder()); +}