+ if ( tgtSM->IsMeshComputed() &&
+ tgtSM->GetSubMeshDS()->NbNodes() != srcSM->GetSubMeshDS()->NbNodes() )
+ {
+ // the top EDGE is computed differently than the bottom one,
+ // try to clear a wrong mesh
+ bool isAdjFaceMeshed = false;
+ PShapeIteratorPtr fIt = myHelper->GetAncestors( tgtSM->GetSubShape(),
+ *mesh, TopAbs_FACE );
+ while ( const TopoDS_Shape* f = fIt->next() )
+ if (( isAdjFaceMeshed = mesh->GetSubMesh( *f )->IsMeshComputed() ))
+ break;
+ if ( isAdjFaceMeshed )
+ return toSM( error( TCom("Different nb of segment on logically horizontal edges #")
+ << shapeID( botE ) << " and #"
+ << shapeID( topE ) << ": "
+ << tgtSM->GetSubMeshDS()->NbElements() << " != "
+ << srcSM->GetSubMeshDS()->NbElements() ));
+ tgtSM->ComputeStateEngine( SMESH_subMesh::CLEAN );
+ }