X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=eb49db1b9b532448aa3528a8e8d02aacebaf6f70;hb=8a18d05e3b1e9ee1c072d1ae04ad87bf7d52c5d2;hp=c38eb14193fa4fea6332c58c4219beac106615bb;hpb=dd496074b4f26ad0e2dbe52aaaa5a016fd4d4f2c;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index c38eb1419..eb49db1b9 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -577,13 +577,17 @@ void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy ) // Let meshes update their data depending on GEOM groups that could change if ( curStudyId != studyId ) { - SALOMEDS::SComponent_var me = PublishComponent( myCurrentStudy ); - SALOMEDS::ChildIterator_var anIter = myCurrentStudy->NewChildIterator( me ); - for ( ; anIter->More(); anIter->Next() ) { - SALOMEDS::SObject_var so = anIter->Value(); - CORBA::Object_var ior = SObjectToObject( so ); - if ( SMESH_Mesh_i* mesh = SMESH::DownCast( ior )) - mesh->CheckGeomGroupModif(); + //SALOMEDS::SComponent_var me = PublishComponent( myCurrentStudy ); + SALOMEDS::SComponent_var me = SALOMEDS::SComponent::_narrow + ( myCurrentStudy->FindComponent( ComponentDataType() ) ); + if ( !me->_is_nil() ) { + SALOMEDS::ChildIterator_var anIter = myCurrentStudy->NewChildIterator( me ); + for ( ; anIter->More(); anIter->Next() ) { + SALOMEDS::SObject_var so = anIter->Value(); + CORBA::Object_var ior = SObjectToObject( so ); + if ( SMESH_Mesh_i* mesh = SMESH::DownCast( ior )) + mesh->CheckGeomGroupModif(); + } } } } @@ -1391,6 +1395,8 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, SMESH_Mesh_i* meshServant = dynamic_cast( GetServant( theMesh ).in() ); ASSERT( meshServant ); if ( meshServant ) { + // NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation" + meshServant->CheckGeomGroupModif(); // get local TopoDS_Shape TopoDS_Shape myLocShape; if(theMesh->HasShapeToMesh()) @@ -3746,8 +3752,13 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, { int smID = smIDs[ i ]; if ( smID == 0 ) continue; - ASSERT( smID <= maxID ); const SMDS_MeshElement* elem = *iE; + if( smID >= maxID ) { + // corresponding subshape no longer exists: maybe geom group has been edited + if ( myNewMeshImpl->HasShapeToMesh() ) + mySMESHDSMesh->RemoveElement( elem ); + continue; + } // get or create submesh SMESHDS_SubMesh* & sm = subMeshes[ smID ]; if ( ! sm ) { @@ -3852,28 +3863,28 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, for ( int iNode = 0; iNode < nbNodes; iNode++ ) { const SMDS_MeshNode* node = mySMESHDSMesh->FindNode( aNodeIDs[ iNode ]); - ASSERT( node ); + if ( !node ) continue; // maybe removed while Loading() if geometry changed SMDS_PositionPtr aPos = node->GetPosition(); - ASSERT( aPos ) - if ( onFace ) { - // 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 ]); - } + ASSERT( aPos ); + if ( onFace ) { + // 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 );-- issue 20182 - if ( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ) { - SMDS_EdgePosition* fPos = const_cast - ( static_cast( aPos.get() )); - fPos->SetUParameter( aUPos[ iNode ]); - } + } + else { + // 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 ]); } + } } } if ( aEids ) delete [] aEids;