X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHDS%2FSMESHDS_Group.cxx;h=e6df602ff343532c4a4bda2185c1ee3ed681d323;hb=refs%2Ftags%2FV9_1_0;hp=6e30e008bbed413e832c4a03e955b62f00ab1a10;hpb=bb40f7c1d3542da1ff59b6c3bface0574789dded;p=modules%2Fsmesh.git diff --git a/src/SMESHDS/SMESHDS_Group.cxx b/src/SMESHDS/SMESHDS_Group.cxx index 6e30e008b..e6df602ff 100644 --- a/src/SMESHDS/SMESHDS_Group.cxx +++ b/src/SMESHDS/SMESHDS_Group.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -19,17 +19,13 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - -// SMESH SMESHDS : idl implementation based on 'SMESH' unit's classes // File : SMESHDS_Group.cxx // Module : SMESH -// $Header$ // + #include "SMESHDS_Group.hxx" #include "SMESHDS_Mesh.hxx" -using namespace std; - //============================================================================= /*! * @@ -39,8 +35,8 @@ using namespace std; SMESHDS_Group::SMESHDS_Group (const int theID, const SMESHDS_Mesh* theMesh, const SMDSAbs_ElementType theType) - : SMESHDS_GroupBase(theID,theMesh,theType), - myGroup(theMesh,theType) + : SMESHDS_GroupBase(theID,theMesh,theType), + myGroup(theMesh,theType) { } @@ -147,20 +143,7 @@ void SMESHDS_Group::Clear() myGroup.Clear(); resetIterator(); } - -// ===================== -// class MyGroupIterator -// ===================== - -class MyGroupIterator: public SMDS_ElemIterator -{ - const SMDS_MeshGroup& myGroup; - public: - MyGroupIterator(const SMDS_MeshGroup& group): myGroup(group) { myGroup.InitIterator(); } - bool more() { return myGroup.More(); } - const SMDS_MeshElement* next() { return myGroup.Next(); } -}; - + //======================================================================= //function : GetElements //purpose : @@ -168,7 +151,7 @@ class MyGroupIterator: public SMDS_ElemIterator SMDS_ElemIteratorPtr SMESHDS_Group::GetElements() const { - return SMDS_ElemIteratorPtr( new MyGroupIterator ( myGroup )); + return myGroup.GetElements(); } //================================================================================ @@ -189,11 +172,14 @@ int SMESHDS_Group::GetTic() const void SMESHDS_Group::SetType(SMDSAbs_ElementType theType) { - if ( myGroup.IsEmpty() || GetType() == SMDSAbs_All ) { + if ( myGroup.IsEmpty() || GetType() == SMDSAbs_All ) + { SMESHDS_GroupBase::SetType( theType ); myGroup.SetType ( theType ); } else + { SMESHDS_GroupBase::SetType( myGroup.GetType() ); + } }