X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FSMESH%2Finput%2Ftui_grouping_elements.doc;h=763e939d4fa9cea7f510f213119e434d6df4d901;hb=8c1e153907cbcf7cb8e8d316e05e30096d16baa5;hp=8b9f6391cf0ebb605672267459b9a8bedf944051;hpb=79b1ac2b6df9117f16f11d444b1f165d477a1813;p=modules%2Fsmesh.git
diff --git a/doc/salome/gui/SMESH/input/tui_grouping_elements.doc b/doc/salome/gui/SMESH/input/tui_grouping_elements.doc
index 8b9f6391c..763e939d4 100644
--- a/doc/salome/gui/SMESH/input/tui_grouping_elements.doc
+++ b/doc/salome/gui/SMESH/input/tui_grouping_elements.doc
@@ -1,4 +1,4 @@
-/*!
+ /*!
\page tui_grouping_elements_page Grouping Elements
@@ -19,7 +19,11 @@ aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100.)
anIds = mesh.GetIdsFromFilter(aFilter)
# create a group consisting of faces with area > 100
-aGroup = mesh.MakeGroupByIds("Area > 100", smesh.FACE, anIds)
+aGroup1 = mesh.MakeGroupByIds("Area > 100", smesh.FACE, anIds)
+
+# create a group that contains all nodes from the mesh
+aGroup2 = mesh.CreateEmptyGroup(smesh.NODE, "all nodes")
+aGroup2.AddFrom(mesh.mesh)
salome.sg.updateObjBrowser(1)
\endcode
@@ -123,8 +127,8 @@ salome.sg.updateObjBrowser(1)
\image html editing_groups2.png
-\anchor tui_union_of_two_groups
-
Union of two groups
+\anchor tui_union_of_groups
+Union of groups
\code
import SMESH_mechanic
@@ -141,7 +145,7 @@ anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area > 20, Nb = ", len( anIds )
# create a group by adding elements with area > 20
-aGroup1 = mesh.CreateEmptyGroup(SMESH.FACE, "Area > 20")
+aGroup1 = mesh.CreateEmptyGroup(smesh.FACE, "Area > 20")
aGroup1.Add(anIds)
# Criterion : AREA = 20
@@ -157,8 +161,9 @@ aGroup2 = mesh.CreateEmptyGroup( smesh.FACE, "Area = 20" )
aGroup2.Add(anIds)
# create union group : area >= 20
-aGroup3 = mesh.UnionGroups(aGroup1, aGroup2, "Area >= 20")
+aGroup3 = mesh.UnionListOfGroups([aGroup1, aGroup2], "Area >= 20")
print "Criterion: Area >= 20, Nb = ", len(aGroup3.GetListOfID())
+# Please note that also there is UnionGroups() method which works with two groups only
# Criterion : AREA < 20
aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 20.)
@@ -172,7 +177,7 @@ aGroup4 = mesh.CreateEmptyGroup(smesh.FACE, "Area < 20")
aGroup4.Add(anIds)
# create union group : area >= 20 and area < 20
-aGroup5 = mesh.UnionGroups(aGroup3, aGroup4, "Any Area")
+aGroup5 = mesh.UnionListOfGroups([aGroup3, aGroup4], "Any Area")
print "Criterion: Any Area, Nb = ", len(aGroup5.GetListOfID())
salome.sg.updateObjBrowser(1)
@@ -185,8 +190,8 @@ salome.sg.updateObjBrowser(1)
\image html union_groups3.png
-\anchor tui_intersection_of_two_groups
-Intersection of two groups
+\anchor tui_intersection_of_groups
+Intersection of groups
\code
import SMESH_mechanic
@@ -203,7 +208,7 @@ anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area > 20, Nb = ", len(anIds)
# create a group by adding elements with area > 20
-aGroup1 = mesh.CreateEmptyGroup(SMESH.FACE, "Area > 20")
+aGroup1 = mesh.CreateEmptyGroup(smesh.FACE, "Area > 20")
aGroup1.Add(anIds)
# Criterion : AREA < 60
@@ -214,12 +219,13 @@ anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area < 60, Nb = ", len(anIds)
# create a group by adding elements with area < 60
-aGroup2 = mesh.CreateEmptyGroup(SMESH.FACE, "Area < 60")
+aGroup2 = mesh.CreateEmptyGroup(smesh.FACE, "Area < 60")
aGroup2.Add(anIds)
# create an intersection of groups : 20 < area < 60
-aGroup3 = mesh.IntersectGroups(aGroup1, aGroup2, "20 < Area < 60")
+aGroup3 = mesh.IntersectListOfGroups([aGroup1, aGroup2], "20 < Area < 60")
print "Criterion: 20 < Area < 60, Nb = ", len(aGroup3.GetListOfID())
+# Please note that also there is IntersectGroups() method which works with two groups only
salome.sg.updateObjBrowser(1)
\endcode
@@ -231,8 +237,8 @@ salome.sg.updateObjBrowser(1)
\image html intersect_groups3.png
-\anchor tui_cut_of_two_groups
-Cut of two groups
+\anchor tui_cut_of_groups
+Cut of groups
\code
import SMESH_mechanic
@@ -264,6 +270,7 @@ aGroupTool = mesh.MakeGroupByIds("Area < 60", smesh.FACE, anIds)
# create a cut of groups : area >= 60
aGroupRes = mesh.CutGroups(aGroupMain, aGroupTool, "Area >= 60")
print "Criterion: Area >= 60, Nb = ", len(aGroupRes.GetListOfID())
+# Please note that also there is CutListOfGroups() method which works with lists of groups of any lengths
salome.sg.updateObjBrowser(1)
\endcode
@@ -274,4 +281,54 @@ salome.sg.updateObjBrowser(1)
\image html cut_groups3.png
-*/
\ No newline at end of file
+
+\anchor tui_create_dim_group
+Creating groups of entities from existing groups of superior dimensions
+
+\code
+import SMESH_mechanic
+
+smesh = SMESH_mechanic.smesh
+mesh = SMESH_mechanic.mesh
+salome = SMESH_mechanic.salome
+
+# Criterion : AREA > 100
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100.)
+
+anIds = mesh.GetIdsFromFilter(aFilter)
+
+print "Criterion: Area > 100, Nb = ", len(anIds)
+
+# create a group by adding elements with area > 100
+aSrcGroup1 = mesh.MakeGroupByIds("Area > 100", smesh.FACE, anIds)
+
+# Criterion : AREA < 30
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 30.)
+
+anIds = mesh.GetIdsFromFilter(aFilter)
+
+print "Criterion: Area < 30, Nb = ", len(anIds)
+
+# create a group by adding elements with area < 30
+aSrcGroup2 = mesh.MakeGroupByIds("Area < 30", smesh.FACE, anIds)
+
+# Create group of edges using source groups of faces
+aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], smesh.EDGE, "Edges" )
+
+# Create group of nodes using source groups of faces
+aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], smesh.NODE, "Nodes" )
+
+salome.sg.updateObjBrowser(1)
+\endcode
+
+\image html dimgroup_tui1.png
+Source groups of faces
+
+\image html dimgroup_tui2.png
+Result groups of edges and nodes
+
+
+
+
+
+*/