X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_MeshEditor.cxx;h=f9d0348c79d4fa19f71d878b98a8bbe20bbd3f1a;hb=e1969210a97c4c790d0147cdaddd22116c05838e;hp=8c5de25a4ecc0d718a90975f45c77294fb8d6a39;hpb=25c9e04a6124e27fe14819df0af79cfbfd338e93;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 8c5de25a4..f9d0348c7 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -12878,19 +12878,23 @@ namespace // utils for MakePolyLine void Path::Remove( std::vector< Path > & paths, size_t& i ) { - size_t j = paths.size() - 1; // last item to be removed - if ( i < j ) + if ( paths.size() > 1 ) { - paths[ i ].myPoints.swap( paths[ j ].myPoints ); - paths[ i ].myFace = paths[ j ].myFace; - paths[ i ].myNodeInd1 = paths[ j ].myNodeInd1; - paths[ i ].myNodeInd2 = paths[ j ].myNodeInd2; - paths[ i ].myNode1 = paths[ j ].myNode1; - paths[ i ].myNode2 = paths[ j ].myNode2; - paths[ i ].myLength = paths[ j ].myLength; + size_t j = paths.size() - 1; // last item to be removed + if ( i < j ) + { + paths[ i ].myPoints.swap( paths[ j ].myPoints ); + paths[ i ].myFace = paths[ j ].myFace; + paths[ i ].myNodeInd1 = paths[ j ].myNodeInd1; + paths[ i ].myNodeInd2 = paths[ j ].myNodeInd2; + paths[ i ].myNode1 = paths[ j ].myNode1; + paths[ i ].myNode2 = paths[ j ].myNode2; + paths[ i ].myLength = paths[ j ].myLength; + } } paths.pop_back(); - --i; + if ( i > 0 ) + --i; } //================================================================================ @@ -13183,7 +13187,7 @@ void SMESH_MeshEditor::MakePolyLine( TListOfPolySegments& theSegments, SMESHUtils::Deleter delSearcher; if ( !searcher ) { - searcher = SMESH_MeshAlgos::GetElementSearcher( *myMesh->GetMeshDS() ); + searcher = SMESH_MeshAlgos::GetElementSearcher( *GetMeshDS() ); delSearcher._obj = searcher; } @@ -13217,6 +13221,9 @@ void SMESH_MeshEditor::MakePolyLine( TListOfPolySegments& theSegments, } } + // assure that inverse elements are constructed, avoid their concurrent building in threads + GetMeshDS()->nodesIterator()->next()->NbInverseElements(); + // find paths PolyPathCompute algo( theSegments, segPaths, myMesh );