]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #3181: Improve Python dump
authorvsv <vsv@opencascade.com>
Tue, 21 Apr 2020 18:25:25 +0000 (21:25 +0300)
committervsv <vsv@opencascade.com>
Tue, 21 Apr 2020 18:25:25 +0000 (21:25 +0300)
src/ModelHighAPI/ModelHighAPI_Dumper.cpp
src/SketchAPI/SketchAPI_ConstraintAngle.cpp

index 478e4803ae1c7c2e9f92de078a372fb5e29c710a..8be7dd3cd08911c576788f37b57dad4fe57ba704 100644 (file)
@@ -572,10 +572,13 @@ const std::string& ModelHighAPI_Dumper::name(const EntityPtr& theEntity,
                                              bool theUseEntityName,
                                              bool theSetIsDumped)
 {
-  EntityNameMap::const_iterator aFound = myNames.find(theEntity);
-  if (aFound != myNames.end())
+  EntityNameMap::iterator aFound = myNames.find(theEntity);
+  if (aFound != myNames.end()) {
+    // Set dumped flag for postponed constraints which are without names
+    if (!aFound->second.myIsDumped)
+      aFound->second.myIsDumped = theSetIsDumped;
     return aFound->second.myCurrentName;
-
+  }
   // entity is not found, store it
   std::string aName, aKind;
   bool isDefaultName = false;
index 4f5eedf235d63b2a44b9977a4256a1ce68f90d09..e84634aaf453395094588f03b4e2ac2710749dba 100644 (file)
@@ -129,7 +129,9 @@ void SketchAPI_ConstraintAngle::dump(ModelHighAPI_Dumper& theDumper) const
   FeaturePtr aBase = feature();
 
   const std::string& aSketchName = theDumper.parentName(aBase);
-  theDumper << aBase << " = " << aSketchName << "." << "setAngle(";
+  //theDumper << aBase << " = " << aSketchName << "." << "setAngle(";
+  theDumper.name(aBase, false, true, true);
+  theDumper << aSketchName << "." << "setAngle(";
 
   bool isFirstAttr = true;
   for (int i = 0; i < CONSTRAINT_ATTR_SIZE; ++i) {