From: eap Date: Mon, 14 Dec 2009 09:23:56 +0000 (+0000) Subject: 0020427: EDF 868 SMESH : Be able to define the submeshing order X-Git-Tag: V6_0_0~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e7952c1e1e71b5c309d28768d04a63fdedd8bebe;p=modules%2Fsmesh.git 0020427: EDF 868 SMESH : Be able to define the submeshing order fix SortByMeshOrder(), forgot to increment iterator --- diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 4992d6f8c..58c6a227b 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1630,7 +1630,7 @@ bool SMESH_Mesh::SortByMeshOrder(list& theListToSort) const // iterates on ordered submeshes and insert them in detected positions map< int, TPosInList >::iterator i_pos = sortedPos.begin(); - for ( ; onlyBIt != onlyEIt; ++onlyBIt ) + for ( ; onlyBIt != onlyEIt; ++onlyBIt, ++i_pos ) *(i_pos->second) = *onlyBIt; return res; @@ -1649,12 +1649,9 @@ list SMESH_Mesh::getAncestorsSubMeshes { list listOfSubMesh; TopTools_ListIteratorOfListOfShape it( GetAncestors( theSubShape )); - for (; it.More(); it.Next() ) { - int index = _myMeshDS->ShapeToIndex(it.Value()); - map ::const_iterator i_sm = _mapSubMesh.find(index); - if (i_sm != _mapSubMesh.end()) - listOfSubMesh.push_back(i_sm->second); - } + for (; it.More(); it.Next() ) + if ( SMESH_subMesh* sm = GetSubMeshContaining( it.Value() )) + listOfSubMesh.push_back(sm); // sort submeshes according to stored mesh order SortByMeshOrder( listOfSubMesh );