From 02628964286dac2bee1200be74b5bc7d23b4604a Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 12 Nov 2007 09:57:27 +0000 Subject: [PATCH] PAL16842 (Genertion of groups when a mesh is transformed) + typedef boost::shared_ptr< SMDS_Iterator > GroupIteratorPtr; + GroupIteratorPtr GetGroups() const; --- src/SMESH/SMESH_Mesh.cxx | 19 ++++++++++++++++--- src/SMESH/SMESH_Mesh.hxx | 9 ++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 8570263b5..8b77005d3 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -37,6 +37,7 @@ #include "SMESHDS_GroupOnGeom.hxx" #include "SMESHDS_Document.hxx" #include "SMDS_MeshVolume.hxx" +#include "SMDS_SetIterator.hxx" #include "utilities.h" @@ -1210,9 +1211,21 @@ SMESH_Group* SMESH_Mesh::AddGroup (const SMDSAbs_ElementType theType, return aGroup; } +//================================================================================ +/*! + * \brief Return iterator on all existing groups + */ +//================================================================================ + +SMESH_Mesh::GroupIteratorPtr SMESH_Mesh::GetGroups() const +{ + typedef map TMap; + return GroupIteratorPtr( new SMDS_mapIterator( _mapGroup )); +} + //============================================================================= /*! - * + * \brief Return a group by ID */ //============================================================================= @@ -1226,11 +1239,11 @@ SMESH_Group* SMESH_Mesh::GetGroup (const int theGroupID) //============================================================================= /*! - * + * \brief Return IDs of all groups */ //============================================================================= -list SMESH_Mesh::GetGroupIds() +list SMESH_Mesh::GetGroupIds() const { list anIds; for ( map::const_iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index 2f57bcd70..3b4881a49 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -210,13 +210,16 @@ public: int& theId, const TopoDS_Shape& theShape=TopoDS_Shape()); - SMESH_Group* GetGroup (const int theGroupID); + typedef boost::shared_ptr< SMDS_Iterator > GroupIteratorPtr; + GroupIteratorPtr GetGroups() const; - std::list GetGroupIds(); + std::list GetGroupIds() const; + SMESH_Group* GetGroup (const int theGroupID); + void RemoveGroup (const int theGroupID); - + SMDSAbs_ElementType GetElementType( const int id, const bool iselem ); // -- 2.39.2