#include "SMESH_subMesh.hxx"#include "SMESH_Algo.hxx"#include "SMESH_Gen.hxx"#include "SMESH_HypoFilter.hxx"#include "SMESH_Hypothesis.hxx"#include "SMESH_Mesh.hxx"#include "SMESH_MesherHelper.hxx"#include "SMESH_subMeshEventListener.hxx"#include "SMESH_Comment.hxx"#include "SMDS_SetIterator.hxx"#include "SMDSAbs_ElementType.hxx"#include "utilities.h"#include "OpUtil.hxx"#include "Basics_Utils.hxx"#include <BRep_Builder.hxx>#include <BRep_Tool.hxx>#include <TopExp.hxx>#include <TopTools_IndexedMapOfShape.hxx>#include <TopTools_ListIteratorOfListOfShape.hxx>#include <TopoDS.hxx>#include <TopoDS_Compound.hxx>#include <gp_Pnt.hxx>#include <TopExp_Explorer.hxx>#include <TopoDS_Iterator.hxx>#include <Standard_OutOfMemory.hxx>#include <Standard_ErrorHandler.hxx>#include <numeric>
Go to the source code of this file.
Data Structures | |
| struct | MemoryReserve |
| Allocate some memory at construction and release it at destruction. More... | |
Functions | |
| static void | cleanSubMesh (SMESH_subMesh *subMesh) |
| Remove nodes and elements bound to submesh. | |
| static void cleanSubMesh | ( | SMESH_subMesh * | subMesh | ) | [static] |
Remove nodes and elements bound to submesh.
| subMesh | - submesh containing nodes and elements |
Definition at line 1204 of file SMESH_subMesh.cxx.
References SMDS_MeshNode.NbInverseElements(), ex29_refine.node(), SMESHDS_Mesh.RemoveFreeElement(), SMESHDS_Mesh.RemoveFreeNode(), and SMESHDS_Mesh.RemoveNode().
Referenced by SMESH_subMesh.ComputeStateEngine(), and SMESH_subMesh.RemoveSubMeshElementsAndNodes().
{
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());
if ( node->NbInverseElements() == 0 )
meshDS->RemoveFreeNode(node, subMeshDS);
else // for StdMeshers_CompositeSegment_1D: node in one submesh, edge in another
meshDS->RemoveNode(node);
}
}
}
}