From 7546982e7861c58cd24c7311947e715db64aae19 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 7 Nov 2007 09:36:09 +0000 Subject: [PATCH] PAL16202 (Propagation 1D on edges group) + SMESHDS_SubMeshIteratorPtr GetSubMeshIterator() const; --- src/SMESHDS/SMESHDS_SubMesh.cxx | 14 ++++++++++++++ src/SMESHDS/SMESHDS_SubMesh.hxx | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index 262649e86..7cc19700d 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -29,6 +29,7 @@ #include "SMESHDS_SubMesh.hxx" #include "utilities.h" +#include "SMDS_SetIterator.hxx" using namespace std; @@ -297,3 +298,16 @@ bool SMESHDS_SubMesh::ContainsSubMesh( const SMESHDS_SubMesh* theSubMesh ) const { return mySubMeshes.find( theSubMesh ) != mySubMeshes.end(); } + +//======================================================================= +//function : GetSubMeshIterator +//purpose : +//======================================================================= + +SMESHDS_SubMeshIteratorPtr SMESHDS_SubMesh::GetSubMeshIterator() const +{ + typedef set::const_iterator TIterator; + return SMESHDS_SubMeshIteratorPtr + ( new SMDS_SetIterator< const SMESHDS_SubMesh*, TIterator >( mySubMeshes.begin(), + mySubMeshes.end())); +} diff --git a/src/SMESHDS/SMESHDS_SubMesh.hxx b/src/SMESHDS/SMESHDS_SubMesh.hxx index 5c65a5859..8165ee429 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.hxx +++ b/src/SMESHDS/SMESHDS_SubMesh.hxx @@ -36,6 +36,10 @@ #define SMESHDS_WNT_EXPORT #endif +class SMESHDS_SubMesh; +typedef SMDS_Iterator SMESHDS_SubMeshIterator; +typedef boost::shared_ptr< SMESHDS_SubMeshIterator > SMESHDS_SubMeshIteratorPtr; + class SMESHDS_WNT_EXPORT SMESHDS_SubMesh { public: @@ -53,6 +57,7 @@ class SMESHDS_WNT_EXPORT SMESHDS_SubMesh bool RemoveSubMesh( const SMESHDS_SubMesh* theSubMesh ); bool ContainsSubMesh( const SMESHDS_SubMesh* theSubMesh ) const; int NbSubMeshes() const { return mySubMeshes.size(); } + SMESHDS_SubMeshIteratorPtr GetSubMeshIterator() const; // for both types int NbElements() const; -- 2.39.2