]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Fix SMESH_Mesh_i::ReplaceShape()
authoreap <eap@opencascade.com>
Wed, 15 Jan 2020 13:13:38 +0000 (16:13 +0300)
committereap <eap@opencascade.com>
Wed, 15 Jan 2020 13:13:38 +0000 (16:13 +0300)
src/SMESH_I/SMESH_Mesh_i.cxx

index cb57e77f450d2134c9fc84c852dfbbf1639194d3..965696f489cc36cb10f2ad9d847459247871f5ea 100644 (file)
@@ -262,14 +262,16 @@ GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh()
 void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom)
   throw (SALOME::SALOME_Exception)
 {
-  TopoDS_Shape S = _impl->GetMeshDS()->ShapeToMesh();
+  TopoDS_Shape S = _impl->GetShapeToMesh();
   GEOM_Client* geomClient = _gen_i->GetShapeReader();
   TCollection_AsciiString aIOR;
   if (geomClient->Find(S, aIOR)) {
     geomClient->RemoveShapeFromBuffer(aIOR);
   }
-  _impl->UndefShapeToMesh();
-  SetShape(theNewGeom);
+
+  // re-assign global hypotheses to the new shape
+  _mainShapeTick = theNewGeom->GetTick() + 1;
+  CheckGeomModif();
 }
 
 //================================================================================