// 3. Get elements to copy
- SMDS_ElemIteratorPtr srcElemIt;
+ SMDS_ElemIteratorPtr srcElemIt; SMDS_NodeIteratorPtr srcNodeIt;
TIDSortedElemSet srcElems;
SMESH::array_of_ElementType_var srcElemTypes = meshPart->GetTypes();
if ( SMESH::DownCast<SMESH_Mesh_i*>( meshPart ))
{
srcElemIt = srcMeshDS->elementsIterator();
+ srcNodeIt = srcMeshDS->nodesIterator();
}
else
{
}
}
+ // 4(b). Copy free nodes
+
+ if ( srcNodeIt && srcMeshDS->NbNodes() != newMeshDS->NbNodes() )
+ {
+ while ( srcNodeIt->more() )
+ {
+ nSrc = srcNodeIt->next();
+ if ( nSrc->NbInverseElements() == 0 )
+ {
+ if ( toKeepIDs )
+ nTgt = newMeshDS->AddNodeWithID( nSrc->X(), nSrc->Y(), nSrc->Z(), nSrc->GetID());
+ else
+ n2nMap[ nSrc ] = newMeshDS->AddNode( nSrc->X(), nSrc->Y(), nSrc->Z() );
+ }
+ }
+ }
+
// 5. Copy groups
int nbNewGroups = 0;