- SMESH_subMesh* smToListen = srcMesh->GetSubMeshContaining(1);
- SMESH_subMeshEventListenerData* data = new _ListenerData(srcHyp, LISTEN_SRC_MESH);
- data->mySubMeshes.push_back( smToNotify );
- importSub->SetEventListener( get(), data, smToListen );
-
- // remeber the submesh importSub and its sub-submeshes
+ vector<SMESH_subMesh*> smToListen = srcHyp->GetSourceSubMeshes( srcMesh );
+ for ( size_t i = 0; i < smToListen.size(); ++i )
+ {
+ SMESH_subMeshEventListenerData* data = new _ListenerData(srcHyp, LISTEN_SRC_MESH);
+ data->mySubMeshes.push_back( smToNotify );
+ importSub->SetEventListener( get(), data, smToListen[i] );
+ }
+ // remember the submesh importSub and its sub-submeshes