]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0022195: EDF SMESH: Mesh using existing elements.
authoreap <eap@opencascade.com>
Thu, 16 May 2013 17:02:10 +0000 (17:02 +0000)
committereap <eap@opencascade.com>
Thu, 16 May 2013 17:02:10 +0000 (17:02 +0000)
To load the mesh owning source groups

-  const std::vector<SMESH_Group*>& GetGroups() const;
+  const std::vector<SMESH_Group*>& GetGroups(bool loaded=false) const;

src/StdMeshers/StdMeshers_ImportSource.cxx
src/StdMeshers/StdMeshers_ImportSource.hxx

index a9d8a8124a391e96ed01a033a9ff0f97c5dfd695..4bcebe2fa4037e4907817cb2fc39b277d6fde240 100644 (file)
@@ -121,7 +121,8 @@ namespace
   //================================================================================
 
   vector<SMESH_Group*> getValidGroups(const vector<SMESH_Group*>& groups,
-                                      StudyContextStruct*         studyContext)
+                                      StudyContextStruct*         studyContext,
+                                      bool                        loaded=false)
   {
     vector<SMESH_Group*> 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<SMESH_Group*>&  StdMeshers_ImportSource1D::GetGroups() const
+const std::vector<SMESH_Group*>&  StdMeshers_ImportSource1D::GetGroups(bool loaded) const
 {
   // filter off deleted groups
   vector<SMESH_Group*> okGroups = getValidGroups( _groups,
-                                                  _gen->GetStudyContext(_studyId) );
+                                                  _gen->GetStudyContext(_studyId),
+                                                  loaded);
   if ( okGroups.size() != _groups.size() )
     ((StdMeshers_ImportSource1D*)this)->_groups = okGroups;
 
index 1b0ffbe517457048507fb40482a9c508a8320e12..2066dff4b50b8ca8e24ebd4984957b1fb89fb9f9 100644 (file)
@@ -52,7 +52,7 @@ class STDMESHERS_EXPORT StdMeshers_ImportSource1D : public SMESH_Hypothesis
   virtual ~ StdMeshers_ImportSource1D();
 
   void SetGroups(const std::vector<SMESH_Group*>& groups);
-  const std::vector<SMESH_Group*>& GetGroups() const;
+  const std::vector<SMESH_Group*>& GetGroups(bool loaded=false) const;
 
   void SetCopySourceMesh(bool toCopyMesh, bool toCopyGroups);
   void GetCopySourceMesh(bool& toCopyMesh, bool& toCopyGroups) const;