rnc: Added a paragraph about the use of criteria in documentation

and links from GetFilter and GetCriterion methods to tui_filters documentation page
This commit is contained in:
gdd 2011-04-29 11:44:24 +00:00
parent 7e60e718da
commit f1fdcd1571
2 changed files with 26 additions and 0 deletions

View File

@ -689,4 +689,25 @@ print "Number of tetrahedrons:", len(ids_tet)
print "Number of pyramids:", len(ids_pyr)
\endcode
\section combining_filters How to combine filters with Criterion structures?
Filters can be combined by making use of "criteria".
Example :
\code
# create mesh
from SMESH_mechanic import *
# get all the quadrangle faces ...
criterion1 = smesh.GetCriterion(smesh.FACE, smesh.FT_ElemGeomType, smesh.Geom_QUADRANGLE, smesh.FT_LogicalAND)
# ... AND do NOT get those from sub_face3
criterion2 = smesh.GetCriterion(smesh.FACE, smesh.FT_BelongToGeom, sub_face3, smesh.FT_LogicalNOT)
filter = smesh.CreateFilterManager().CreateFilter()
filter.SetCriteria([criterion1,criterion2])
ids = mesh.GetIdsFromFilter(filter)
myGroup = mesh.MakeGroupByIds("Quads_on_cylindrical_faces",smesh.FACE,ids)
\endcode
*/

View File

@ -745,6 +745,7 @@ class smeshDC(SMESH._objref_SMESH_Gen):
UnaryOp, BinaryOp, Tolerance, TypeOfElement, Precision)
## Creates a criterion by the given parameters
# \n Criterion structures allow to define complex filters by combining them with logical operations (AND / OR) (see example below)
# @param elementType the type of elements(NODE, EDGE, FACE, VOLUME)
# @param CritType the type of criterion (FT_Taper, FT_Area, FT_RangeOfIds, FT_LyingOnGeom etc.)
# @param Compare belongs to {FT_LessThan, FT_MoreThan, FT_EqualTo}
@ -755,6 +756,8 @@ class smeshDC(SMESH._objref_SMESH_Gen):
# @param Tolerance the tolerance used by FT_BelongToGeom, FT_BelongToSurface,
# FT_LyingOnGeom, FT_CoplanarFaces criteria
# @return SMESH.Filter.Criterion
#
# <a href="../tui_filters_page.html#combining_filters">Example of Criteria usage</a>
# @ingroup l1_controls
def GetCriterion(self,elementType,
CritType,
@ -875,6 +878,8 @@ class smeshDC(SMESH._objref_SMESH_Gen):
# @param Tolerance the tolerance used by FT_BelongToGeom, FT_BelongToSurface,
# FT_LyingOnGeom, FT_CoplanarFaces criteria
# @return SMESH_Filter
#
# <a href="../tui_filters_page.html#tui_filters">Example of Filters usage</a>
# @ingroup l1_controls
def GetFilter(self,elementType,
CritType=FT_Undefined,