From 117656acc5e5df7c585e245b3b9cb742e48a5d7f Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 12 Nov 2007 09:57:41 +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 9a236a186..0b361a52b 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" @@ -1228,9 +1229,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 */ //============================================================================= @@ -1244,11 +1257,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 e8ccaf7a0..3005f678e 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -217,13 +217,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