SMESHDS_SubMesh* GMSHPlugin_Mesher::HasSubMesh( const TopoDS_Shape& s )
{
- SMESHDS_SubMesh* sm = _mesh->GetMeshDS()->MeshElements( s );
- return ( sm && sm->NbElements() > 0 ) ? sm : nullptr;
+ if ( SMESHDS_SubMesh* sm = _mesh->GetMeshDS()->MeshElements( s ))
+ {
+ if ( s.ShapeType() == TopAbs_VERTEX )
+ return ( sm->NbNodes() > 0 ) ? sm : nullptr;
+ else
+ return ( sm->NbElements() > 0 ) ? sm : nullptr;
+ }
+ return nullptr;
}
//================================================================================
sm->SetIsAlwaysComputed(true); // prevent from displaying errors
continue;
}
+ if ( HasSubMesh( topoVertex ))
+ continue; // a meshed sub-mesh
// FILL SMESH FOR topoVertex
//nodes
sm->SetIsAlwaysComputed(true); // prevent from displaying errors
continue;
}
+ if ( HasSubMesh( topoFace ))
+ continue; // a meshed sub-mesh
}
bool isCompound = getBoundsOfShapes( gFace, topoFaces );
else
topoFace = *((TopoDS_Face*)gFace->getNativePtr());
+ if ( HasSubMesh( topoFace ))
+ continue; // a meshed sub-mesh
+
// check if there is a meshed sub-mesh on FACE boundary
bool hasSubMesh = false;
for ( TopExp_Explorer edgeIt( topoFace, TopAbs_EDGE ); edgeIt.More(); edgeIt.Next() )
{
if (( hasSubMesh = HasSubMesh( edgeIt.Current() )))
break;
- }
+ }
//elements
std::vector<MVertex*> verts;