]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Objects.cpp
Salome HOME
Update the internal persistence mechanism of documents identification: on load/save...
[modules/shaper.git] / src / Model / Model_Objects.cpp
index aa8e2751c0980532839c2fbb18ea9c247aa4ee42..63131d43ec89922ad406a64f3e9785e0ddc7da19 100644 (file)
@@ -568,12 +568,6 @@ void Model_Objects::setUniqueName(FeaturePtr theFeature)
         isSameName = (*aRIter)->data()->name() == aName;
       }
     }
-    // for new Parts create names that are not in the Postponed list
-    if (!isSameName && (theFeature->getKind() == "Part" || theFeature->getKind() == "Duplicate")) {
-      std::shared_ptr<Model_Session> aSession = 
-        std::dynamic_pointer_cast<Model_Session>(Model_Session::get());
-      isSameName = aSession->isLoadByDemand(aName) || aSession->hasDocument(aName);
-    }
 
     if (isSameName) {
       aNumObjects++;
@@ -602,6 +596,15 @@ void Model_Objects::initData(ObjectPtr theObj, TDF_Label theLab, const int theTa
   theObj->initAttributes();
 }
 
+std::shared_ptr<ModelAPI_Feature> Model_Objects::featureById(const int theId)
+{
+  if (theId > 0) {
+    TDF_Label aLab = featuresLabel().FindChild(theId, Standard_False);
+    return feature(aLab);
+  }
+  return std::shared_ptr<ModelAPI_Feature>(); // not found
+}
+
 void Model_Objects::synchronizeFeatures(
   const TDF_LabelList& theUpdated, const bool theUpdateReferences, const bool theFlush)
 {