From: eap Date: Wed, 25 Feb 2009 15:43:14 +0000 (+0000) Subject: 0020182: EDF SMESH 965 : SIGSEV at study opening with SMESH X-Git-Tag: V4_1_5rc1~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=efb752bab02bb583c44aca149ed099356bd314c5;p=modules%2Fsmesh.git 0020182: EDF SMESH 965 : SIGSEV at study opening with SMESH be patient to studies with invalid node positions data --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 168c3a57d..9a5345253 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -3495,8 +3495,13 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, while ( nIt->more() ) elemSet.insert( nIt->next() ); else while ( eIt->more() ) elemSet.insert( eIt->next() ); - ASSERT( elemSet.size() == nbElems ); - + //ASSERT( elemSet.size() == nbElems ); -- issue 20182 + // -- Most probably a bad study was saved when there were + // not fixed bugs in SMDS_MeshInfo + if ( elemSet.size() < nbElems ) { + cout << "SMESH_Gen_i::Load(), warning: Node position data is invalid" << endl; + nbElems = elemSet.size(); + } // add elements to submeshes TIDSortedElemSet::iterator iE = elemSet.begin(); for ( int i = 0; i < nbElems; ++i, ++iE ) @@ -3613,17 +3618,23 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, SMDS_PositionPtr aPos = node->GetPosition(); ASSERT( aPos ) if ( onFace ) { - ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_FACE ); - SMDS_FacePosition* fPos = const_cast - ( static_cast( aPos.get() )); - fPos->SetUParameter( aUPos[ iNode ]); - fPos->SetVParameter( aVPos[ iNode ]); + // ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_FACE );-- issue 20182 + // -- Most probably a bad study was saved when there were + // not fixed bugs in SMDS_MeshInfo + if ( aPos->GetTypeOfPosition() == SMDS_TOP_FACE ) { + SMDS_FacePosition* fPos = const_cast + ( static_cast( aPos.get() )); + fPos->SetUParameter( aUPos[ iNode ]); + fPos->SetVParameter( aVPos[ iNode ]); + } } else { - ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ); - SMDS_EdgePosition* fPos = const_cast - ( static_cast( aPos.get() )); - fPos->SetUParameter( aUPos[ iNode ]); + // ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE );-- issue 20182 + if ( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ) { + SMDS_EdgePosition* fPos = const_cast + ( static_cast( aPos.get() )); + fPos->SetUParameter( aUPos[ iNode ]); + } } } }