]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Avoid empty names (changes from MPV)
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 13 Oct 2014 07:47:01 +0000 (11:47 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 13 Oct 2014 07:47:01 +0000 (11:47 +0400)
src/Model/Model_ResultBody.cpp
src/Model/Model_Session.cpp

index 0409a4cc2da521870d9940c6660e63c93ddf573c..f5c8cb223d1d0438fc78fc0210628e840328add0 100644 (file)
@@ -7,6 +7,7 @@
 #include <TNaming_Builder.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <TopoDS_Shape.hxx>
+#include <TDF_ChildIterator.hxx>
 #include <GeomAPI_Shape.h>
 
 Model_ResultBody::Model_ResultBody()
@@ -20,7 +21,10 @@ void Model_ResultBody::store(const boost::shared_ptr<GeomAPI_Shape>& theShape)
     TDF_Label& aShapeLab = aData->shapeLab();
     // remove the previous history
     clean();
-    aShapeLab.ForgetAllAttributes();
+    aShapeLab.ForgetAttribute(TNaming_NamedShape::GetID());
+    for(TDF_ChildIterator anIter(aShapeLab); anIter.More(); anIter.Next()) {
+      anIter.Value().ForgetAllAttributes();
+    }
     // store the new shape as primitive
     TNaming_Builder aBuilder(aShapeLab);
     if (!theShape)
index e63c97cabb2a1cb06744d8f8d8b5307a0be294c7..6a3cf53cc0718af4ba104f2e7d19a3bfededcb95 100644 (file)
@@ -99,7 +99,7 @@ FeaturePtr Model_Session::createFeature(string theFeatureID)
     std::pair<std::string, std::string>& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind
     if (!aPlugin.second.empty() && aPlugin.second != activeDocument()->kind()) {
       Events_Error::send(
-          string("Feature '") + theFeatureID + "' can not be created in document '"
+          string("Feature '") + theFeatureID + "' can be created only in document '"
               + aPlugin.second + "' by the XML definition");
       return FeaturePtr();
     }