0020210: EDF SMESH 976: Update of a smesh group after modification of the associated geom group

call mesh->CheckGeomGroupModif() when current study changes
This commit is contained in:
eap 2009-04-03 14:28:20 +00:00
parent 3c24068111
commit dd496074b4

View File

@ -559,12 +559,10 @@ CORBA::Boolean SMESH_Gen_i::IsEmbeddedMode()
void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy ) void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
{ {
//if(MYDEBUG) int curStudyId = GetCurrentStudyID();
//MESSAGE( "SMESH_Gen_i::SetCurrentStudy" );
myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy ); myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy );
// create study context, if it doesn't exist and set current study // create study context, if it doesn't exist and set current study
int studyId = GetCurrentStudyID(); int studyId = GetCurrentStudyID();
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::SetCurrentStudy: study Id = " << studyId );
if ( myStudyContextMap.find( studyId ) == myStudyContextMap.end() ) { if ( myStudyContextMap.find( studyId ) == myStudyContextMap.end() ) {
myStudyContextMap[ studyId ] = new StudyContext; myStudyContextMap[ studyId ] = new StudyContext;
} }
@ -575,9 +573,19 @@ void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() ) if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() )
aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() ); aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() );
// set current study for geom engine // NPAL16168, issue 0020210
//if ( !CORBA::is_nil( GetGeomEngine() ) ) // Let meshes update their data depending on GEOM groups that could change
// GetGeomEngine()->GetCurrentStudy( myCurrentStudy->StudyId() ); 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<SMESH_Mesh_i*>( ior ))
mesh->CheckGeomGroupModif();
}
}
} }
} }
@ -1383,8 +1391,6 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh,
SMESH_Mesh_i* meshServant = dynamic_cast<SMESH_Mesh_i*>( GetServant( theMesh ).in() ); SMESH_Mesh_i* meshServant = dynamic_cast<SMESH_Mesh_i*>( GetServant( theMesh ).in() );
ASSERT( meshServant ); ASSERT( meshServant );
if ( meshServant ) { if ( meshServant ) {
// NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"
meshServant->CheckGeomGroupModif();
// get local TopoDS_Shape // get local TopoDS_Shape
TopoDS_Shape myLocShape; TopoDS_Shape myLocShape;
if(theMesh->HasShapeToMesh()) if(theMesh->HasShapeToMesh())