- //--------------------------------------------------------------------------------
- /*!
- * \brief Remember an imported mesh and groups
- * \param smDS - submesh DS holding the imported mesh
- * \param sm - submesh computed by Import algo
- * \param srcMeshDS - source mesh
- * \param srcHyp - ImportSource hypothesis
- */
- static _ImportData* storeImportSubmesh(SMESH_subMesh* importSub,
- const SMESH_Mesh* srcMesh,
- const StdMeshers_ImportSource1D* srcHyp)
- {
- // set listener to hear events of the submesh computed by "Import" algo
- importSub->SetEventListener( get(), new _ListenerData(srcHyp), importSub );
-
- // set a listener to hear events of the source mesh
- SMESH_subMesh* smToNotify = importSub;
- SMESH_subMesh* smToListen = srcMesh->GetSubMeshContaining(1);
- importSub->SetEventListener
- ( new SMESH_subMeshEventListener(/*isDeletable=*/true),
- SMESH_subMeshEventListenerData::MakeData( smToNotify ),
- smToListen );
-
- // remeber the submesh
- _ImportData* iData = _Listener::getImportData( srcMesh, importSub->GetFather());
- iData->_subM.insert( importSub );
- iData->trackHypParams( importSub, srcHyp );
- if ( !importSub->IsEmpty() )
- iData->_computedSubM.insert( importSub );
- if ( !iData->_copyMeshSubM.empty() && iData->_importMeshSubID < 1 )
- {
- SMESH_Mesh* tgtMesh = importSub->GetFather();
- iData->_importMeshSubID = getSubmeshIDForCopiedMesh( srcMesh->GetMeshDS(),tgtMesh);
- iData->_importMeshSubDS = tgtMesh->GetMeshDS()->NewSubMesh( iData->_importMeshSubID );
- }
- if ( !importSub->IsEmpty() )
- iData->_computedSubM.insert( importSub );