Back to index

salome-smesh  6.5.0
Classes | Functions
SMESH_subMesh.cxx File Reference
#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 <Basics_OCCTVersion.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.

Classes

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.

Function Documentation

static void cleanSubMesh ( SMESH_subMesh *  subMesh) [static]

Remove nodes and elements bound to submesh.

Parameters:
subMesh- submesh containing nodes and elements

Definition at line 1223 of file SMESH_subMesh.cxx.

{
  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);
      }
    }
  }
}

Here is the call graph for this function: