From: eap Date: Fri, 16 Dec 2011 09:30:53 +0000 (+0000) Subject: 0021347: [CEA 497] Visualisation into SMESH and VISU of hexagonal prism cells (MED_OC... X-Git-Tag: V6_5_0a1~222 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=32a63e97eee19c36fbdb5f2da9648bd6fe074e77;p=modules%2Fsmesh.git 0021347: [CEA 497] Visualisation into SMESH and VISU of hexagonal prism cells (MED_OCTA12) 0021380: EDF 1937 SMESH: Take into account QUAD9 and HEXA27 In CopyMesh(), copy free nodes as well --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index fe51eac07..7112663e5 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2436,12 +2436,13 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, // 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( meshPart )) { srcElemIt = srcMeshDS->elementsIterator(); + srcNodeIt = srcMeshDS->nodesIterator(); } else { @@ -2515,6 +2516,23 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, } } + // 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;