+#include <utilities.h>
+
+namespace
+{
+ typedef const SMDS_MeshElement* PElem;
+ typedef const SMDS_MeshNode* PNode;
+
+ typedef SMDS_SetIterator< PElem, PElem const *,
+ SMDS::SimpleAccessor< PElem, PElem const * >,
+ SMDS::NonNullFilter< PElem > > EArrayIterator;
+
+ typedef SMDS_SetIterator< PNode, PNode const *,
+ SMDS::SimpleAccessor< PNode, PNode const * >,
+ SMDS::NonNullFilter< PNode > > NArrayIterator;
+
+ int ind1st( SMDSAbs_ElementType t )
+ {
+ return t == SMDSAbs_Node;
+ }
+
+ //=======================================================================
+ //class : _MyElemIteratorFromNodeIterator
+ //=======================================================================
+ class _MyElemIteratorFromNodeIterator : public SMDS_ElemIterator
+ {
+ SMDS_NodeIteratorPtr myItr;
+ public:
+ _MyElemIteratorFromNodeIterator(SMDS_NodeIteratorPtr nodeItr): myItr( nodeItr ) {}
+ bool more() { return myItr->more(); }
+ const SMDS_MeshElement* next() { return myItr->next(); }
+ };
+}
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+
+SMESHDS_SubMesh::SMESHDS_SubMesh(SMESHDS_Mesh *parent, int index)
+ : SMDS_ElementHolder( parent )
+{
+ myParent = parent;
+ myIndex = index;
+ myNbElements = 0;
+ myNbNodes = 0;
+ my1stElemNode[0] = my1stElemNode[1] = 0;
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
+
+SMESHDS_SubMesh::~SMESHDS_SubMesh()