From: gdd Date: Fri, 29 Apr 2011 11:44:24 +0000 (+0000) Subject: rnc: Added a paragraph about the use of criteria in documentation X-Git-Tag: V6_3_0b1~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f1fdcd157135cc4414f18a54f74060d0db2e246f;p=modules%2Fsmesh.git rnc: Added a paragraph about the use of criteria in documentation and links from GetFilter and GetCriterion methods to tui_filters documentation page --- diff --git a/doc/salome/gui/SMESH/input/tui_filters.doc b/doc/salome/gui/SMESH/input/tui_filters.doc index aa3e1eb1c..48c108fe5 100755 --- a/doc/salome/gui/SMESH/input/tui_filters.doc +++ b/doc/salome/gui/SMESH/input/tui_filters.doc @@ -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 + + */ diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index e3743161d..9c2a0e2fb 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -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 + # + # Example of Criteria usage # @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 + # + # Example of Filters usage # @ingroup l1_controls def GetFilter(self,elementType, CritType=FT_Undefined,