+list<SMESH_subMesh*>
+SMESH_Mesh::GetGroupSubMeshesContaining(const TopoDS_Shape & aSubShape) const
+ throw(SALOME_Exception)
+{
+ Unexpect aCatch(SalomeException);
+ list<SMESH_subMesh*> found;
+
+ SMESH_subMesh * subMesh = GetSubMeshContaining(aSubShape);
+ if ( !subMesh )
+ return found;
+
+ // submeshes of groups have max IDs, so search from the map end
+ map<int, SMESH_subMesh *>::const_reverse_iterator i_sm;
+ for ( i_sm = _mapSubMesh.rbegin(); i_sm != _mapSubMesh.rend(); ++i_sm) {
+ SMESHDS_SubMesh * ds = i_sm->second->GetSubMeshDS();
+ if ( ds && ds->IsComplexSubmesh() ) {
+ TopExp_Explorer exp( i_sm->second->GetSubShape(), aSubShape.ShapeType() );
+ for ( ; exp.More(); exp.Next() ) {
+ if ( aSubShape.IsSame( exp.Current() )) {
+ found.push_back( i_sm->second );
+ break;
+ }
+ }
+ } else {
+ break;
+ }
+ }
+ return found;
+}