From df4a29d3c73f341a0714b1766660ea114d8f1d3d Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 23 Aug 2021 22:00:53 +0300 Subject: [PATCH] bos #24731 Changing 3D algorithm leads to inconsistent dumped python script. fix invalid dump of empty list of enforced meshes --- src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index 5a90eb0..b378244 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -1086,6 +1086,9 @@ void BLSURFPlugin_Hypothesis_i::SetEnforcedMeshes(const BLSURFPlugin::EnforcedMe enforcedMeshes.push_back({ meshID, partID, partType, inEM.groupName.in() }); } + if ( GetImpl()->GetEnforcedMeshes() == enforcedMeshes ) + return; + this->GetImpl()->SetEnforcedMeshes( enforcedMeshes ); // dump @@ -1102,8 +1105,9 @@ void BLSURFPlugin_Hypothesis_i::SetEnforcedMeshes(const BLSURFPlugin::EnforcedMe pyDump << "'" << inEM.groupName.in() << "'"; else pyDump << "''"; - pyDump << ")" << ( i + 1 < theMeshes.length() ? ", " : "])"); + pyDump << ")" << ( i + 1 < theMeshes.length() ? ", " : ""); } + pyDump << "])"; } //============================================================================= @@ -3566,7 +3570,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, if (string(theGroupName).empty()) SMESH::TPythonDump() << _this() << ".AddEnforcedVertex(" << x << ", " << y << ", " << z << ")"; else - SMESH::TPythonDump() << _this() << ".AddEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")"; + SMESH::TPythonDump() << _this() << ".AddEnforcedVertexWithGroup(" << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")"; } else { if (string(theGroupName).empty()) -- 2.39.2