+ // if imprinting, the original mesh faces are modified
+ // => we clear all the faces to retrieve them from Hybrid output mesh.
+ std::vector<int> facesWithImprinting;
+ if (theAlgo->getHyp())
+ facesWithImprinting = theAlgo->getHyp()->GetFacesWithImprinting();
+
+ if ( ! facesWithImprinting.empty() ) {
+#ifdef _DEBUG_
+ std::cout << "Imprinting => Clear original mesh" << std::endl;
+#endif
+ SMESH_subMesh* smOfSolid =
+ theHelper->GetMesh()->GetSubMesh( theHelper->GetSubShape() );
+ SMESH_subMeshIteratorPtr smIt =
+ smOfSolid->getDependsOnIterator(/*includeSelf=*/false, /*complexShapeFirst=*/true);
+ while ( smIt->more() )
+ {
+ SMESH_subMesh* sm = smIt->next();
+ if ( SMESHDS_SubMesh * smDS = sm->GetSubMeshDS() )
+ {
+ SMDS_ElemIteratorPtr eIt = smDS->GetElements();
+ while( eIt->more() )
+ {
+ theMeshDS->RemoveFreeElement( eIt->next(), smDS );
+ }
+ SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
+ while ( nIt->more() )
+ {
+ const SMDS_MeshNode* n = nIt->next();
+ if ( n->NbInverseElements() == 0 )
+ theMeshDS->RemoveFreeNode( n, smDS );
+ }
+ }
+ }
+ theNodeByHybridId.clear();
+ theFaceByHybridId.clear();
+ }
+