- int curStudyId = GetCurrentStudyID();
- MESSAGE("curStudyId " << curStudyId);
- myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy );
- // create study context, if it doesn't exist and set current study
- int studyId = GetCurrentStudyID();
- MESSAGE("studyId " << studyId);
- if ( myStudyContextMap.find( studyId ) == myStudyContextMap.end() )
- myStudyContextMap[ studyId ] = new StudyContext;
-
- // myCurrentStudy may be nil
- if ( !theStudyIsBeingClosed && !CORBA::is_nil( myCurrentStudy ) ) {
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
- SALOMEDS::SComponent_wrap GEOM_var = myCurrentStudy->FindComponent( "GEOM" );
- if( !GEOM_var->_is_nil() )
- aStudyBuilder->LoadWith( GEOM_var, GetGeomEngine() );
- // NPAL16168, issue 0020210
- // Let meshes update their data depending on GEOM groups that could change
- if ( curStudyId != studyId )
- {
- MESSAGE("curStudyId " << curStudyId << " studyId " << studyId);
- CORBA::String_var compDataType = ComponentDataType();
- SALOMEDS::SComponent_wrap me = myCurrentStudy->FindComponent( compDataType.in() );
- if ( !me->_is_nil() ) {
- SALOMEDS::ChildIterator_wrap anIter = myCurrentStudy->NewChildIterator( me );
- for ( ; anIter->More(); anIter->Next() ) {
- SALOMEDS::SObject_wrap so = anIter->Value();
- CORBA::Object_var ior = SObjectToObject( so );
- if ( SMESH_Mesh_i* mesh = SMESH::DownCast<SMESH_Mesh_i*>( ior ))
- mesh->CheckGeomModif();
- }
- }
- }
- }