From c484895a0f9fb64623948e6f83e04847362cb9e7 Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 12 Oct 2009 13:16:41 +0000 Subject: [PATCH] IPAL21363 Compute hangs up on Hypothesis Distribution of Layers. --- .../StdMeshers_RadialQuadrangle_1D2D.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index 303d68ab0..fdb026293 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -221,20 +221,23 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, bool ok = _gen->Compute( aMesh, CircEdge, false, MeshDim_1D ); if( !ok ) return false; std::map< double, const SMDS_MeshNode* > theNodes; - GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes); + ok = GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes); + if( !ok ) return false; CNodes.clear(); std::map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin(); const SMDS_MeshNode* NF = (*itn).second; CNodes.push_back( (*itn).second ); double fang = (*itn).first; - itn++; - for(; itn != theNodes.end(); itn++ ) { - CNodes.push_back( (*itn).second ); - double ang = (*itn).first - fang; - if( ang>PI ) ang = ang - 2*PI; - if( ang<-PI ) ang = ang + 2*PI; - Angles.Append( ang ); + if ( itn != theNodes.end() ) { + itn++; + for(; itn != theNodes.end(); itn++ ) { + CNodes.push_back( (*itn).second ); + double ang = (*itn).first - fang; + if( ang>PI ) ang = ang - 2*PI; + if( ang<-PI ) ang = ang + 2*PI; + Angles.Append( ang ); + } } P1 = gp_Pnt( NF->X(), NF->Y(), NF->Z() ); P0 = aCirc->Location(); -- 2.39.2