+ int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0;
+
+ // volumes may be bound to shell instead of solid
+ list< SMESHDS_SubMesh* > smList;
+ if ( nbElems == 0 && aSubMesh->GetSubShape().ShapeType() <= TopAbs_SOLID )
+ {
+ SMESHDS_Mesh* aMeshDS = aSubMesh->GetFather()->GetMeshDS();
+ TopExp_Explorer exp( aSubMesh->GetSubShape(), TopAbs_SHELL );
+ for ( ; exp.More(); exp.Next() )
+ {
+ aSubMeshDS = aMeshDS->MeshElements( exp.Current() );
+ if ( !aSubMeshDS ) continue;
+ if ( theElemType == SMESH::NODE )
+ {
+ SMDS_ElemIteratorPtr eIt = aSubMeshDS->GetElements();
+ while ( eIt->more() ) {
+ const SMDS_MeshElement* anElem = eIt->next();
+ SMDS_ElemIteratorPtr nIt = anElem->nodesIterator();
+ while ( nIt->more() )
+ nodeIds.insert( nIt->next()->GetID() );
+ }
+ }
+ else
+ {
+ smList.push_back( aSubMeshDS );
+ nbElems += aSubMeshDS->NbElements();
+ }
+ }
+ aSubMeshDS = 0;
+ }
+ else
+ {
+ if ( nbElems )
+ smList.push_back( aSubMeshDS );
+ }
+
+ if ( theElemType == SMESH::NODE && aSubMeshDS )
+ {