Version: 9.12.0
SMDS_ElementHolder Class Referenceabstract

Base class of object holding SMDS_MeshElement pointers. More...

#include <SMDS_ElementHolder.hxx>

Inheritance diagram for SMDS_ElementHolder:

Public Member Functions

 SMDS_ElementHolder (const SMDS_Mesh *mesh)
 register self in the mesh More...
 
virtual ~SMDS_ElementHolder ()
 un-register self from the mesh More...
 

Protected Member Functions

virtual SMDS_ElemIteratorPtr getElements ()=0
 < the descendant object return its elements just before the mesh compacting More...
 
virtual void tmpClear ()=0
 the descendant object re-add its elements after the mesh compacting More...
 
virtual void add (const SMDS_MeshElement *element)=0
 the descendant squeeze its element storage after re-adding elements More...
 
virtual void compact ()=0
 allow the descendant treat its elements before mesh clearing More...
 
virtual void clear ()
 

Protected Attributes

SMDS_MeshmyMesh
 

Private Member Functions

void beforeCompacting ()
 store vtkIDs of elements More...
 
void restoreElements (const std::vector< smIdType > &idNodessOldToNew, const std::vector< smIdType > &idCellsOldToNew)
 restore pointers to elements More...
 

Private Attributes

std::vector< const SMDS_MeshElement * > myExternalElems
 elements not contained in the mesh More...
 
std::vector< vtkIdType > myVtkIDs
 vtk IDs of elements More...
 
std::vector< bool > myIsNode
 
std::set< SMDS_ElementHolder * >::iterator myPtrInMesh
 

Friends

class SMDS_Mesh
 

Detailed Description

Base class of object holding SMDS_MeshElement pointers.

Registering such an object in SMDS_Mesh assures that the pointers remain valid after compacting the mesh

Constructor & Destructor Documentation

◆ SMDS_ElementHolder()

SMDS_ElementHolder::SMDS_ElementHolder ( const SMDS_Mesh mesh)

register self in the mesh

References SMDS_Mesh::myElemHolders, myMesh, and myPtrInMesh.

◆ ~SMDS_ElementHolder()

SMDS_ElementHolder::~SMDS_ElementHolder ( )
virtual

un-register self from the mesh

References SMDS_Mesh::myElemHolders, myMesh, and myPtrInMesh.

Member Function Documentation

◆ add()

virtual void SMDS_ElementHolder::add ( const SMDS_MeshElement element)
protectedpure virtual

the descendant squeeze its element storage after re-adding elements

Implemented in SMESH_BadInputElements, SMESHDS_SubMesh, SMESHDS_GroupOnFilter, SMDS_MeshGroup, and SMESH_ProxyMesh::SubMesh.

Referenced by restoreElements().

◆ beforeCompacting()

void SMDS_ElementHolder::beforeCompacting ( )
private

◆ clear()

virtual void SMDS_ElementHolder::clear ( )
protectedvirtual

◆ compact()

virtual void SMDS_ElementHolder::compact ( )
protectedpure virtual

allow the descendant treat its elements before mesh clearing

Implemented in SMESH_BadInputElements, SMESHDS_SubMesh, SMESHDS_GroupOnFilter, SMESH_ProxyMesh::SubMesh, and SMDS_MeshGroup.

Referenced by restoreElements().

◆ getElements()

virtual SMDS_ElemIteratorPtr SMDS_ElementHolder::getElements ( )
protectedpure virtual

< the descendant object return its elements just before the mesh compacting

the descendant object temporary remove its elements

Implemented in SMESH_BadInputElements, SMESHDS_SubMesh, SMESHDS_GroupOnFilter, SMESH_ProxyMesh::SubMesh, and SMDS_MeshGroup.

Referenced by beforeCompacting().

◆ restoreElements()

void SMDS_ElementHolder::restoreElements ( const std::vector< smIdType > &  idNodessOldToNew,
const std::vector< smIdType > &  idCellsOldToNew 
)
private

◆ tmpClear()

virtual void SMDS_ElementHolder::tmpClear ( )
protectedpure virtual

the descendant object re-add its elements after the mesh compacting

Implemented in SMESH_BadInputElements, SMESHDS_SubMesh, SMESHDS_GroupOnFilter, SMESH_ProxyMesh::SubMesh, and SMDS_MeshGroup.

Referenced by restoreElements().

Friends And Related Function Documentation

◆ SMDS_Mesh

friend class SMDS_Mesh
friend

Field Documentation

◆ myExternalElems

std::vector<const SMDS_MeshElement*> SMDS_ElementHolder::myExternalElems
private

elements not contained in the mesh

Referenced by beforeCompacting(), and restoreElements().

◆ myIsNode

std::vector< bool > SMDS_ElementHolder::myIsNode
private

◆ myMesh

◆ myPtrInMesh

std::set< SMDS_ElementHolder* >::iterator SMDS_ElementHolder::myPtrInMesh
private

◆ myVtkIDs

std::vector< vtkIdType > SMDS_ElementHolder::myVtkIDs
private

vtk IDs of elements

Referenced by beforeCompacting(), and restoreElements().