From: mpv Date: Thu, 12 Mar 2020 15:02:51 +0000 (+0300) Subject: Fix the problem on break link and creation of a mesh on the same geometry: X-Git-Tag: V9_5_0a2~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d07d6a9662e9d6f3f54e1bc070a5f550598e474f;p=modules%2Fsmesh.git Fix the problem on break link and creation of a mesh on the same geometry: - In SHAPER, create a part - Create a sketch with a rectangle - Extrude it - Create a group of face with the TOP face - Create a group of face with the BOTTOM face - In SMESH, create a mesh with Netgen 1D2D - Compute the mesh => The mesh groups TOP and BOTTOM are created (if "Create all Groups on geometry" is ticked in Create mesh dialog box) - Call Break link on Extrusion_1_1 under Mesh_1. - Compute Mesh_1 again (it has been cleared by break link). - In SHAPER, edit the sketch and add a fillet in a corner - In SMESH, create another mesh with Netgen 1D2D - Compute Mesh_2 => The mesh groups TOP and BOTTOM are created, but they are void and have a warning sign. --- diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 0f4dd5407..882a932ff 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -270,6 +270,16 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) if (geomClient->Find(S, aIOR)) { geomClient->RemoveShapeFromBuffer(aIOR); } + // clear buffer also for sub-groups + const std::set& groups = _impl->GetMeshDS()->GetGroups(); + std::set::const_iterator g = groups.begin(); + for (; g != groups.end(); ++g) + if (const SMESHDS_GroupOnGeom* group = dynamic_cast(*g)) + { + const TopoDS_Shape& s = group->GetShape(); + if (geomClient->Find(s, aIOR)) + geomClient->RemoveShapeFromBuffer(aIOR); + } // update the reference to theNewGeom (needed for correct execution of a dumped python script) SMESH::SMESH_Mesh_var me = _this();