Salome HOME
rnc: Added a paragraph about the use of criteria in documentation
authorgdd <gdd>
Fri, 29 Apr 2011 11:44:24 +0000 (11:44 +0000)
committergdd <gdd>
Fri, 29 Apr 2011 11:44:24 +0000 (11:44 +0000)
and links from GetFilter and GetCriterion methods to tui_filters documentation page

doc/salome/gui/SMESH/input/tui_filters.doc
src/SMESH_SWIG/smeshDC.py

index aa3e1eb1cc9cf199186d0e09ec41f6894cc924ef..48c108fe50dc0e9ae971b852dbf6ead5533900b0 100755 (executable)
@@ -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
+
+
 */
index e3743161d238bc9eb8b7d94cccd2486a6403d148..9c2a0e2fbbe7f470b5df7062e15a7011b1df193e 100644 (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,