- // Clear mesh from already meshed edges if possible else
- // remember that merge is needed
- TSubMeshSet::iterator smIt = edgeSubmeshes.begin();
- for ( ; smIt != edgeSubmeshes.end(); ++smIt ) // loop on already meshed EDGEs
- {
- SMESHDS_SubMesh* smDS = *smIt;
- if ( !smDS ) continue;
- SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
- if ( nIt->more() )
- {
- const SMDS_MeshNode* n = nIt->next();
- if ( n->NbInverseElements( SMDSAbs_Face ) > 0 )
- {
- needMerge = true; // to correctly sew with viscous mesh
- // add existing medium nodes to helper
- if ( aMesh.NbEdges( ORDER_QUADRATIC ) > 0 )
- {
- SMDS_ElemIteratorPtr edgeIt = smDS->GetElements();
- while ( edgeIt->more() )
- helper.AddTLinks( static_cast<const SMDS_MeshEdge*>(edgeIt->next()));
- }
- continue;
- }
- }
- if ( allowSubMeshClearing )
- {
- SMDS_ElemIteratorPtr eIt = smDS->GetElements();
- while ( eIt->more() ) meshDS->RemoveFreeElement( eIt->next(), 0 );
- SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
- while ( nIt->more() ) meshDS->RemoveFreeNode( nIt->next(), 0 );
- smDS->Clear();
- }
- else
- {
- needMerge = true;
- }
- }
-