Salome HOME
Merge remote branch 'origin/akl/22379'
[modules/geom.git] / doc / salome / gui / GEOM / input / tui_working_with_groups.doc
index 786e818166a1bf66ca338d933d0de241b4e714e9..e21cb55884a678eb0f970f97232e037472862b39 100644 (file)
 
 \page tui_working_with_groups_page Working with Groups
 
-<br><h2>Creation of a group</h2>
+<br>
+\anchor tui_create_groups_anchor
+<h2>Creation of a group</h2>
+\tui_script{working_with_groups_ex01.py}
 
-\code
-import geompy
-import salome
-gg = salome.ImportComponentGUI("GEOM")
-
-# create two vertices
-p0 = geompy.MakeVertex(0.  , 0.  , 0.  )
-p200 = geompy.MakeVertex(200., 200., 200.)
-
-# create a box from two points
-Box = geompy.MakeBoxTwoPnt(p0, p200)
-
-# create a group from the faces of the box
-group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
-
-# add objects to the group
-SubFaceList = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
-for i in [0, 3, 5] :
-    FaceID = geompy.GetSubShapeID(Box, SubFaceList[i])
-    geompy.AddObject(group, FaceID)
-
-# add all selected shapes from the list to the group
-# (the program doesn't raise error, if some shapes are already included)
-geompy.UnionList(group, [SubFaceList[0], SubFaceList[2], SubFaceList[5]])
-
-# remove an object from the group
-geompy.RemoveObject(group, FaceID)
-
-# remove all selected shapes from the group
-# (the program doesn't raise error, if some shapes are not included)
-geompy.DifferenceList(group, [SubFaceList[2], SubFaceList[3], SubFaceList[4]])
-id_group1 = geompy.addToStudy(group, "Group1")
-
-# display the contents of the group
-gg.createAndDisplayGO(id_group1)
-salome.sg.updateObjBrowser(1)
-\endcode
+\anchor tui_edit_groups_anchor
 
 <br><h2>Adding an object to the group</h2>
-
-\code
-import geompy
-import salome
-gg = salome.ImportComponentGUI("GEOM")
-
-# create two vertices
-p0 = geompy.MakeVertex(0.  , 0.  , 0.  )
-p200 = geompy.MakeVertex(200., 200., 200.)
-
-# create a box from two points
-Box = geompy.MakeBoxTwoPnt(p0, p200)
-
-# create a group from the faces of the box
-group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
-
-# add objects to the group
-SubFaceList = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
-for i in [0, 3, 5] :
-    FaceID = geompy.GetSubShapeID(Box, SubFaceList[i])
-    geompy.AddObject(group, FaceID)
-id_group1 = geompy.addToStudy(group, "Group1")
-
-# display the contents of the group
-gg.createAndDisplayGO(id_group1)
-salome.sg.updateObjBrowser(1) 
-\endcode
+\tui_script{working_with_groups_ex02.py}
 
 <br><h2>Removing an object from the group</h2>
+\tui_script{working_with_groups_ex03.py}
 
-\code
-import geompy
-import salome
-gg = salome.ImportComponentGUI("GEOM")
-
-# create two vertices
-p0 = geompy.MakeVertex(0.  , 0.  , 0.  )
-p200 = geompy.MakeVertex(200., 200., 200.)
-
-# create a box from two points
-Box = geompy.MakeBoxTwoPnt(p0, p200)
-
-# create a group from the faces of the box
-group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
-
-# add objects to the group
-SubFaceList = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
-for i in [0, 3, 5] :
-    FaceID = geompy.GetSubShapeID(Box, SubFaceList[i])
-    geompy.AddObject(group, FaceID)
-
-# add all selected shapes from the list to the group
-# (the program doesn't raise errors, if some shapes are already included)
-geompy.UnionList(group, [SubFaceList[0], SubFaceList[2], SubFaceList[5]])
+<br>
+\anchor tui_union_groups_anchor
+<h2>Union Groups</h2>
+\tui_script{working_with_groups_ex04.py}
 
-# remove an object from the group
-geompy.RemoveObject(group, FaceID)
-id_group1 = geompy.addToStudy(group, "Group1")
+<br>
+\anchor tui_intersect_groups_anchor
+<h2>Intersect Groups</h2>
+\tui_script{working_with_groups_ex05.py}
 
-# display the contents of the group
-gg.createAndDisplayGO(id_group1)
-salome.sg.updateObjBrowser(1) 
-\endcode
+<br>
+\anchor tui_cut_groups_anchor
+<h2>Cut Groups</h2>
+\tui_script{working_with_groups_ex06.py}
 
-*/
\ No newline at end of file
+*/