From: vsv Date: Tue, 21 Apr 2020 18:25:25 +0000 (+0300) Subject: Issue #3181: Improve Python dump X-Git-Tag: V9_6_0a1~60^2~75 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5f63a4735eb9add9e045182b1f8e972bc704d85f;p=modules%2Fshaper.git Issue #3181: Improve Python dump --- diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index 478e4803a..8be7dd3cd 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -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; diff --git a/src/SketchAPI/SketchAPI_ConstraintAngle.cpp b/src/SketchAPI/SketchAPI_ConstraintAngle.cpp index 4f5eedf23..e84634aaf 100644 --- a/src/SketchAPI/SketchAPI_ConstraintAngle.cpp +++ b/src/SketchAPI/SketchAPI_ConstraintAngle.cpp @@ -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) {