X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Prism_3D.cxx;h=151926415fb5de5b57d312af62301607b0c192f0;hp=af0185cded7c2390acc70d67ec65745deaeb4338;hb=3b5470266af557acb0db5e05c674e386361ce55c;hpb=efd5d0e9d1be513b774706d96055e4c674bc19a3 diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index af0185cde..151926415 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -1689,16 +1689,17 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector & trsf) co for ( int iE = 0; iE < nbEdgesInWires.front(); ++iE, ++edgeIt ) { if ( BRep_Tool::Degenerated( *edgeIt )) continue; - const TParam2ColumnMap& u2colMap = + const TParam2ColumnMap* u2colMap = GetParam2ColumnMap( myHelper->GetMeshDS()->ShapeToIndex( *edgeIt ), isReverse ); + if ( !u2colMap ) return false; isReverse = ( edgeIt->Orientation() == TopAbs_REVERSED ); - double f = u2colMap.begin()->first, l = u2colMap.rbegin()->first; + double f = u2colMap->begin()->first, l = u2colMap->rbegin()->first; if ( isReverse ) swap ( f, l ); const int nbCol = 5; for ( int i = 0; i < nbCol; ++i ) { double u = f + i/double(nbCol) * ( l - f ); - const TNodeColumn* col = & getColumn( & u2colMap, u )->second; + const TNodeColumn* col = & getColumn( u2colMap, u )->second; if ( columns.empty() || col != columns.back() ) columns.push_back( col ); } @@ -2201,16 +2202,9 @@ TopoDS_Edge StdMeshers_PrismAsBlock::TSideFace::GetEdge(const int iEdge) const TopoDS_Shape V2 = myHelper->GetSubShapeByNode( node, meshDS ); if ( V2.ShapeType() == TopAbs_VERTEX && !V2.IsSame( V1 )) { - TopTools_ListIteratorOfListOfShape ancestIt = - myHelper->GetMesh()->GetAncestors( V1 ); - for ( ; ancestIt.More(); ancestIt.Next() ) - { - const TopoDS_Shape & ancestor = ancestIt.Value(); - if ( ancestor.ShapeType() == TopAbs_EDGE ) - for ( TopExp_Explorer e( ancestor, TopAbs_VERTEX ); e.More(); e.Next() ) - if ( V2.IsSame( e.Current() )) - return TopoDS::Edge( ancestor ); - } + TopoDS_Shape ancestor = myHelper->GetCommonAncestor( V1, V2, *myHelper->GetMesh(), TopAbs_EDGE); + if ( !ancestor.IsNull() ) + return TopoDS::Edge( ancestor ); } return TopoDS_Edge(); }