From: mpv Date: Mon, 24 Aug 2020 13:38:41 +0000 (+0300) Subject: #19919 [CEA] Group of Edges reported as empty X-Git-Tag: V9_6_0a1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=338d12a959f4872ad89c95884aa4999e262718ea #19919 [CEA] Group of Edges reported as empty Clear shapes-cash in GEOMClient also for sub-meshes objects. --- diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 0f827b054..4c2ca27c3 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -2058,12 +2058,12 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) TopoDS_Shape S = _impl->GetShapeToMesh(); GEOM_Client* geomClient = _gen_i->GetShapeReader(); TCollection_AsciiString aIOR; - CORBA::String_var ior; if ( geomClient->Find( S, aIOR )) geomClient->RemoveShapeFromBuffer( aIOR ); // clear buffer also for sub-groups - const std::set& groups = _impl->GetMeshDS()->GetGroups(); + SMESHDS_Mesh* meshDS = _impl->GetMeshDS(); + const std::set& groups = meshDS->GetGroups(); std::set::const_iterator g = groups.begin(); for (; g != groups.end(); ++g) if (const SMESHDS_GroupOnGeom* group = dynamic_cast(*g)) @@ -2073,12 +2073,21 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) geomClient->RemoveShapeFromBuffer( aIOR ); } + // clear buffer also for sub-meshes + std::map::const_iterator aSubMeshIter = _mapSubMesh_i.cbegin(); + for(; aSubMeshIter != _mapSubMesh_i.cend(); aSubMeshIter++) { + int aShapeID = aSubMeshIter->first; + const TopoDS_Shape& aSubShape = meshDS->IndexToShape(aShapeID); + TCollection_AsciiString aShapeIOR; + if ( geomClient->Find( aSubShape, aShapeIOR )) + geomClient->RemoveShapeFromBuffer( aShapeIOR ); + } + typedef struct { int shapeID, fromID, toID; // indices of elements of a sub-mesh } TRange; std::vector< TRange > elemRanges, nodeRanges; // elements of sub-meshes std::vector< SMDS_PositionPtr > positions; // node positions - SMESHDS_Mesh* meshDS = _impl->GetMeshDS(); if ( !geomChanged ) { // store positions of elements on geometry