X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_ImportSource.cxx;h=aea04659506f929498b36809838e4442662737fc;hb=5d68554076bbca0e1e95fb0db215a6c2b84b6c54;hp=e93b83a61e3a218d64972d1c99103413aa14b3da;hpb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_ImportSource.cxx b/src/StdMeshers/StdMeshers_ImportSource.cxx index e93b83a61..aea046595 100644 --- a/src/StdMeshers/StdMeshers_ImportSource.cxx +++ b/src/StdMeshers/StdMeshers_ImportSource.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2014 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 @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -121,7 +121,8 @@ namespace //================================================================================ vector getValidGroups(const vector& groups, - StudyContextStruct* studyContext) + StudyContextStruct* studyContext, + bool loaded=false) { vector okGroups; for ( int i = 0; i < groups.size(); ++i ) @@ -137,7 +138,11 @@ namespace SMESH_Mesh::GroupIteratorPtr gIt = itm->second->GetGroups(); while ( gIt->more() && !okGroup ) if ( gIt->next() == groups[i] ) + { okGroup = groups[i]; + if ( loaded ) + itm->second->Load(); + } } if ( okGroup ) okGroups.push_back( okGroup ); @@ -193,14 +198,16 @@ namespace //============================================================================= /*! * Returns groups to import elements from + * \param [in] loaded - if \c true, meshes holding the groups are loaded */ //============================================================================= -const std::vector& StdMeshers_ImportSource1D::GetGroups() const +const std::vector& StdMeshers_ImportSource1D::GetGroups(bool loaded) const { // filter off deleted groups vector okGroups = getValidGroups( _groups, - _gen->GetStudyContext(_studyId) ); + _gen->GetStudyContext(_studyId), + loaded); if ( okGroups.size() != _groups.size() ) ((StdMeshers_ImportSource1D*)this)->_groups = okGroups;