-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ModelHighAPI_Folder.h"
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_Document.h>
+#include <ModelAPI_Events.h>
//--------------------------------------------------------------------------------------
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();
}
AttributeReferencePtr aLastFeatAttr = aFolder->reference(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<ModelHighAPI_Folder>(new ModelHighAPI_Folder(aFolder));
}
+
+void removeFolder(std::shared_ptr<ModelHighAPI_Folder>& theFolder)
+{
+ theFolder->folder()->document()->removeFolder(theFolder->folder());
+}