]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Python Dump: improve checking default name of a feature when there are postponed...
authorazv <azv@opencascade.com>
Thu, 13 Sep 2018 05:50:33 +0000 (08:50 +0300)
committerazv <azv@opencascade.com>
Thu, 13 Sep 2018 05:54:24 +0000 (08:54 +0300)
src/ModelHighAPI/ModelHighAPI_Dumper.cpp

index 304a95b97e1b0c588d953123ee8f8c8c8414dec2..c60d67e775d12a002b880ec679bdca6b0d82180e 100644 (file)
@@ -164,6 +164,17 @@ const std::string& ModelHighAPI_Dumper::name(const EntityPtr& theEntity,
       if (aNbFeatures.first == anId && aNbFeatures.second < anId) {
         // name is not user-defined
         isDefaultName = true;
+
+        // check there are postponed features of this kind,
+        // dump their names, because the sequence of features may be changed
+        for (std::list<EntityPtr>::const_iterator aPpIt = myPostponed.begin();
+            aPpIt != myPostponed.end(); ++aPpIt) {
+          FeaturePtr aCurFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*aPpIt);
+          if (aCurFeature && aCurFeature->getKind() == aKind) {
+            myNames[*aPpIt].myIsDefault = false;
+            isDefaultName = false;
+          }
+        }
       }
 
       if (anId > aNbFeatures.second)