From 3010de27c3c73551c4a31b0fcec3885068be7b34 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 16 May 2013 17:02:10 +0000 Subject: [PATCH] 0022195: EDF SMESH: Mesh using existing elements. To load the mesh owning source groups - const std::vector& GetGroups() const; + const std::vector& GetGroups(bool loaded=false) const; --- src/StdMeshers/StdMeshers_ImportSource.cxx | 13 ++++++++++--- src/StdMeshers/StdMeshers_ImportSource.hxx | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/StdMeshers/StdMeshers_ImportSource.cxx b/src/StdMeshers/StdMeshers_ImportSource.cxx index a9d8a8124..4bcebe2fa 100644 --- a/src/StdMeshers/StdMeshers_ImportSource.cxx +++ b/src/StdMeshers/StdMeshers_ImportSource.cxx @@ -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; diff --git a/src/StdMeshers/StdMeshers_ImportSource.hxx b/src/StdMeshers/StdMeshers_ImportSource.hxx index 1b0ffbe51..2066dff4b 100644 --- a/src/StdMeshers/StdMeshers_ImportSource.hxx +++ b/src/StdMeshers/StdMeshers_ImportSource.hxx @@ -52,7 +52,7 @@ class STDMESHERS_EXPORT StdMeshers_ImportSource1D : public SMESH_Hypothesis virtual ~ StdMeshers_ImportSource1D(); void SetGroups(const std::vector& groups); - const std::vector& GetGroups() const; + const std::vector& GetGroups(bool loaded=false) const; void SetCopySourceMesh(bool toCopyMesh, bool toCopyGroups); void GetCopySourceMesh(bool& toCopyMesh, bool& toCopyGroups) const; -- 2.39.2