Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Task #3230: Sketcher: create a curve passing through selected points or vertices...
[modules/shaper.git]
/
src
/
ModelHighAPI
/
ModelHighAPI_Folder.cpp
diff --git
a/src/ModelHighAPI/ModelHighAPI_Folder.cpp
b/src/ModelHighAPI/ModelHighAPI_Folder.cpp
index c6280ffd4e3b2c1481340a9061a0c67a5a5e743a..18ac4e6e2eaca285d1b9b053e028d482a02957f7 100644
(file)
--- a/
src/ModelHighAPI/ModelHighAPI_Folder.cpp
+++ b/
src/ModelHighAPI/ModelHighAPI_Folder.cpp
@@
-1,4
+1,4
@@
-// Copyright (C) 2014-201
7
CEA/DEN, EDF R&D
+// Copyright (C) 2014-201
9
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
//
// 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
//
// 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 "ModelHighAPI_Folder.h"
@@
-25,6
+24,7
@@
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_Document.h>
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_Document.h>
+#include <ModelAPI_Events.h>
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
@@
-59,13
+59,13
@@
bool ModelHighAPI_Folder::initialize()
return true;
}
return true;
}
-void ModelHighAPI_Folder::setName(const std::string& theName)
+void ModelHighAPI_Folder::setName(const std::
w
string& theName)
{
if (myFolder && myFolder->data() && myFolder->data()->isValid())
myFolder->data()->setName(theName);
}
{
if (myFolder && myFolder->data() && myFolder->data()->isValid())
myFolder->data()->setName(theName);
}
-std::string ModelHighAPI_Folder::name() const
+std::
w
string ModelHighAPI_Folder::name() const
{
return myFolder->data()->name();
}
{
return myFolder->data()->name();
}
@@
-74,8
+74,8
@@
void ModelHighAPI_Folder::dump(ModelHighAPI_Dumper& theDumper) const
{
const std::string& aDocName = theDumper.name(myFolder->document());
{
const std::string& aDocName = theDumper.name(myFolder->document());
- AttributeReferencePtr aStartRef =
myFolder->reference(ModelAPI_Folder::FIRST_FEATURE_ID()
);
- AttributeReferencePtr aEndRef =
myFolder->reference(ModelAPI_Folder::LAST_FEATURE_ID()
);
+ AttributeReferencePtr aStartRef =
firstFeature(
);
+ AttributeReferencePtr aEndRef =
lastFeature(
);
// do not dump empty folders
if (!aEndRef->value())
// do not dump empty folders
if (!aEndRef->value())
@@
-110,5
+110,13
@@
std::shared_ptr<ModelHighAPI_Folder> addFolder(const std::shared_ptr<ModelAPI_Do
AttributeReferencePtr aLastFeatAttr = aFolder->reference(ModelAPI_Folder::LAST_FEATURE_ID());
fillAttribute(theLastFeature.feature(), aLastFeatAttr);
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));
}
return std::shared_ptr<ModelHighAPI_Folder>(new ModelHighAPI_Folder(aFolder));
}
+
+void removeFolder(std::shared_ptr<ModelHighAPI_Folder>& theFolder)
+{
+ theFolder->folder()->document()->removeFolder(theFolder->folder());
+}