From: eap Date: Wed, 7 Nov 2007 09:35:51 +0000 (+0000) Subject: PAL16202 (Propagation 1D on edges group) X-Git-Tag: V4_1_0rc2~61 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=04c27b0ed75bb4ed7f8d1440d2dd6123342b307a;p=modules%2Fsmesh.git PAL16202 (Propagation 1D on edges group) + SMESHDS_SubMeshIteratorPtr GetSubMeshIterator() const; --- 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 fa885cefd..bc0ccce2a 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.hxx +++ b/src/SMESHDS/SMESHDS_SubMesh.hxx @@ -32,6 +32,10 @@ #include "SMDS_Mesh.hxx" #include +class SMESHDS_SubMesh; +typedef SMDS_Iterator SMESHDS_SubMeshIterator; +typedef boost::shared_ptr< SMESHDS_SubMeshIterator > SMESHDS_SubMeshIteratorPtr; + class SMESHDS_EXPORT SMESHDS_SubMesh { public: @@ -49,6 +53,7 @@ class SMESHDS_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;