set mesh to filter in all methods creating filters

This commit is contained in:
eap 2010-10-14 12:34:18 +00:00
parent aaea280a53
commit 5d0bbd1e42

View File

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