X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=51c78a1306a1511d8cd03b14a7dbfc5e226d2996;hb=bb1e4b11d8f1c4b90fe7b2c9c59a65c1d30c37f4;hp=09ea4c2fe85042e88438fff295d779bd485527a8;hpb=1732ea91c4da718529e7ec10455934ed8d164c82;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 09ea4c2fe..51c78a130 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -3109,6 +3109,11 @@ namespace // utils for CopyMeshWithGeom() { findNewIDs( oldIndices[i], newIndices ); } + if ( newIndices.size() < oldIndices->length() ) // issue #17096 + { + newIndices.clear(); + newShape = getInPlace( oldShape ); + } if ( !newIndices.empty() ) { try @@ -3292,6 +3297,27 @@ namespace // utils for CopyMeshWithGeom() } } + //================================================================================ + /*! + * \brief Get new sub-shape by calling GetInPlace() + */ + GEOM::GEOM_Object_ptr getInPlace( GEOM::GEOM_Object_ptr oldShape ) + { + GEOM::GEOM_Object_var newShape; + + GEOM::GEOM_Object_var mainShapeNew = myNewMesh_i->GetShapeToMesh(); + GEOM::GEOM_Gen_var geomGen = myGen_i->GetGeomEngine(); + GEOM::GEOM_IShapesOperations_wrap op = geomGen->GetIShapesOperations(); + try + { + newShape = op->GetInPlace( mainShapeNew, oldShape ); + } + catch( ... ) + { + } + return newShape._retn(); + } + //================================================================================ /*! * \brief Find a new sub-shape indices by an old one in myGIPMap. Return