]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
set mesh to filter in all methods creating filters
authoreap <eap@opencascade.com>
Thu, 14 Oct 2010 12:34:18 +0000 (12:34 +0000)
committereap <eap@opencascade.com>
Thu, 14 Oct 2010 12:34:18 +0000 (12:34 +0000)
src/SMESH_SWIG/smeshDC.py

index 14fa2b714ca0bdd020b0a06eec85a1d2a26df75b..4d53fa8d7a461ad86a528d7d88919dcb04929d26 100644 (file)
@@ -851,6 +851,7 @@ class smeshDC(SMESH._objref_SMESH_Gen):
         aCriterion = self.GetCriterion(elementType, CritType, Compare, Treshold, UnaryOp, FT_Undefined)
         aFilterMgr = self.CreateFilterManager()
         aFilter = aFilterMgr.CreateFilter()
+        aFilter.SetMesh( self.mesh )
         aCriteria = []
         aCriteria.append(aCriterion)
         aFilter.SetCriteria(aCriteria)
@@ -1632,6 +1633,7 @@ class Mesh:
     def MakeGroupByCriterion(self, groupName, Criterion):
         aFilterMgr = self.smeshpyD.CreateFilterManager()
         aFilter = aFilterMgr.CreateFilter()
+        aFilter.SetMesh( self.mesh )
         aCriteria = []
         aCriteria.append(Criterion)
         aFilter.SetCriteria(aCriteria)
@@ -1646,6 +1648,7 @@ class Mesh:
     def MakeGroupByCriteria(self, groupName, theCriteria):
         aFilterMgr = self.smeshpyD.CreateFilterManager()
         aFilter = aFilterMgr.CreateFilter()
+        aFilter.SetMesh( self.mesh )
         aFilter.SetCriteria(theCriteria)
         group = self.MakeGroupByFilter(groupName, aFilter)
         return group
@@ -1656,9 +1659,8 @@ class Mesh:
     #  @return SMESH_Group
     #  @ingroup l2_grps_create
     def MakeGroupByFilter(self, groupName, theFilter):
-        anIds = theFilter.GetElementsId(self.mesh)
-        anElemType = theFilter.GetElementType()
-        group = self.MakeGroupByIds(groupName, anElemType, anIds)
+        group = self.CreateEmptyGroup(theFilter.GetElementType(), groupName)
+        group.AddFrom( theFilter )
         return group
 
     ## Passes mesh elements through the given filter and return IDs of fitting elements
@@ -1666,7 +1668,7 @@ class Mesh:
     #  @return a list of ids
     #  @ingroup l1_controls
     def GetIdsFromFilter(self, theFilter):
-        return theFilter.GetElementsId(self.mesh)
+        return theFilter.GetIDs()
 
     ## Verifies whether a 2D mesh element has free edges (edges connected to one face only)\n
     #  Returns a list of special structures (borders).