Version: 9.16.0
SMDS_ElementHolder.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
6// This library is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 2.1 of the License, or (at your option) any later version.
10//
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public
17// License along with this library; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22// File : SMDS_ElementHolder.hxx
23// Module : SMESH
24//
25#ifndef _SMDS_ElementHolder_HeaderFile
26#define _SMDS_ElementHolder_HeaderFile
27
28#include "SMESH_SMDS.hxx"
29
30#include "SMDS_ElemIterator.hxx"
31
32#include <smIdType.hxx>
33#include <vtkType.h>
34
35#include <vector>
36#include <set>
37
38class SMDS_Mesh;
40
41//------------------------------------------------------------------------------------
48{
49 public:
50
52 SMDS_ElementHolder( const SMDS_Mesh* mesh );
53
55 virtual ~SMDS_ElementHolder();
56
57
58 protected:
59
62
64 virtual void tmpClear() = 0;
65
67 virtual void add( const SMDS_MeshElement* element ) = 0;
68
70 virtual void compact() = 0;
71
73 virtual void clear() {}
74
76
77
78 private: // methods called by SMDS_Mesh
79
80 friend class SMDS_Mesh;
81
83 void beforeCompacting();
84
86 void restoreElements( const std::vector<smIdType>& idNodessOldToNew,
87 const std::vector<smIdType>& idCellsOldToNew );
88
89
90 std::vector<const SMDS_MeshElement*> myExternalElems;
91 std::vector< vtkIdType > myVtkIDs;
92 std::vector< bool > myIsNode;
93 std::set< SMDS_ElementHolder* >::iterator myPtrInMesh;
94};
95
96#endif
boost::shared_ptr< SMDS_Iterator< const SMDS_MeshElement * > > SMDS_ElemIteratorPtr
Definition: SMDS_ElemIterator.hxx:43
#define SMDS_EXPORT
Definition: SMESH_SMDS.hxx:37
Base class of object holding SMDS_MeshElement pointers.
Definition: SMDS_ElementHolder.hxx:48
virtual void compact()=0
allow the descendant treat its elements before mesh clearing
std::vector< vtkIdType > myVtkIDs
vtk IDs of elements
Definition: SMDS_ElementHolder.hxx:91
std::vector< const SMDS_MeshElement * > myExternalElems
elements not contained in the mesh
Definition: SMDS_ElementHolder.hxx:90
virtual void add(const SMDS_MeshElement *element)=0
the descendant squeeze its element storage after re-adding elements
virtual SMDS_ElemIteratorPtr getElements()=0
< the descendant object return its elements just before the mesh compacting
std::vector< bool > myIsNode
Definition: SMDS_ElementHolder.hxx:92
virtual void clear()
Definition: SMDS_ElementHolder.hxx:73
virtual void tmpClear()=0
the descendant object re-add its elements after the mesh compacting
SMDS_Mesh * myMesh
Definition: SMDS_ElementHolder.hxx:75
std::set< SMDS_ElementHolder * >::iterator myPtrInMesh
Definition: SMDS_ElementHolder.hxx:93
Base class for elements.
Definition: SMDS_MeshElement.hxx:56
Definition: SMDS_Mesh.hxx:53