From b22070beb1078d4b4e3c92ace635ef59bd7fbd61 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 8 May 2007 10:34:01 +0000 Subject: [PATCH] NPAL15894 (Projection 2D doesn't work) protect form SIGSEGV if not all mathcing nodes found --- src/StdMeshers/StdMeshers_RadialPrism_3D.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx index c83bff525..89946a7aa 100644 --- a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx +++ b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx @@ -222,12 +222,18 @@ bool StdMeshers_RadialPrism_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& a vector< const TNodeColumn* > columns( nbNodes ); for ( int i = 0; i < nbNodes; ++i ) { - const SMDS_MeshNode* n = face->GetNode( i ); - TNode2ColumnMap::iterator n_col = node2columnMap.find( n ); - if ( n_col != node2columnMap.end() ) + const SMDS_MeshNode* nIn = face->GetNode( i ); + TNode2ColumnMap::iterator n_col = node2columnMap.find( nIn ); + if ( n_col != node2columnMap.end() ) { columns[ i ] = & n_col->second; - else - columns[ i ] = makeNodeColumn( node2columnMap, n, nodeIn2OutMap[ n ] ); + } + else { + TNodeNodeMap::iterator nInOut = nodeIn2OutMap.find( nIn ); + if ( nInOut == nodeIn2OutMap.end() ) + RETURN_BAD_RESULT("No matching node for "<< nIn->GetID() << + " in face "<< face->GetID()); + columns[ i ] = makeNodeColumn( node2columnMap, nIn, nInOut->second ); + } } StdMeshers_Prism_3D::AddPrisms( columns, myHelper ); -- 2.39.2