+//================================================================================
+/*!
+ * \brief Remove nodes and elements bound to submesh
+ * \param subMesh - submesh containing nodes and elements
+ */
+//================================================================================
+
+static void cleanSubMesh( SMESH_subMesh * subMesh )
+{
+ if (subMesh) {
+ if (SMESHDS_SubMesh * subMeshDS = subMesh->GetSubMeshDS()) {
+ SMESHDS_Mesh * meshDS = subMesh->GetFather()->GetMeshDS();
+ SMDS_ElemIteratorPtr ite = subMeshDS->GetElements();
+ while (ite->more()) {
+ const SMDS_MeshElement * elt = ite->next();
+ //MESSAGE( " RM elt: "<<elt->GetID()<<" ( "<<elt->NbNodes()<<" )" );
+ //meshDS->RemoveElement(elt);
+ meshDS->RemoveFreeElement(elt, subMeshDS);
+ }
+
+ SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes();
+ while (itn->more()) {
+ const SMDS_MeshNode * node = itn->next();
+ //MESSAGE( " RM node: "<<node->GetID());
+ //meshDS->RemoveNode(node);
+ meshDS->RemoveFreeNode(node, subMeshDS);
+ }
+ }
+ }
+}
+