]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Debug of groups movement to the end for fillet feature unit-tests.
authormpv <mpv@opencascade.com>
Fri, 1 Feb 2019 17:09:52 +0000 (20:09 +0300)
committermpv <mpv@opencascade.com>
Fri, 1 Feb 2019 17:09:52 +0000 (20:09 +0300)
doc/gui/conf.py.in
src/CollectionPlugin/Test/TestGroupMove10.py
src/CollectionPlugin/Test/TestGroupMove8.py
src/Model/Model_AttributeSelection.cpp

index 8d222a1d755a8e16d3a5aa5aab1f008d7d65e9c6..fc9b77f6cea818fb2926fca3874b214c7adef699 100644 (file)
@@ -61,9 +61,9 @@ html_show_copyright = False
 # built documents.
 #
 # The short X.Y version.
-version = u'3.0.0'
+version = u'9.2.0'
 # The full version, including alpha/beta/rc tags.
-release = u'3.0.0'
+release = u'9.2.0'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index 55b4774393f29fab5ca9ce51f12eb6adae46bf4e..72d235d22ecd08982c08ce9d8aa95a0453eb8f13 100644 (file)
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 
 from salome.shaper import model
+from ModelAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
@@ -24,41 +25,29 @@ model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
 Group_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_3")]
 Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
-Group_2_objects = [model.selection("FACE", "Extrusion_1_1_2/To_Face"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2"), model.selection("FACE", "Extrusion_1_1_2/From_Face"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2"), model.selection("FACE", "Extrusion_1_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2"), model.selection("FACE", "(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2"), model.selection("FACE", "Extrusion_1_1_3/To_Face"), model.selection("FACE", "Extrusion_1_1_3/From_Face"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4")]
-Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
-Group_3_objects = [model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2][(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2][Extrusion_1_1_3/To_Face]"), model.selection("EDGE", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2][Extrusion_1_1_3/From_Face]"), model.selection("EDGE", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2][(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2]"), model.selection("EDGE", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_3/To_Face]"), model.selection("EDGE", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_3/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1][(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_3/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_3/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1]")]
-Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
-Group_4_objects = [model.selection("VERTEX", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_2/To_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_1/To_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_1/To_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2][(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_3/To_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2][(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2][Extrusion_1_1_1/To_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_1/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_2/From_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_3/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_1/From_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2][(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2][Extrusion_1_1_1/From_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)2][(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_3/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_3/From_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1][(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_3/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"), model.selection("VERTEX", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_1/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1][(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1_3/From_Face)(Extrusion_1_1_3/To_Face)(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_3/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_1/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]")]
-Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+# to create groups of faces, edges and vertices
+model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc)
+model.do()
 Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Extrusion_1_1"))
 Remove_SubShapes_1.setSubShapesToRemove([model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3")])
 model.do()
 # move groups to the end
-Part_1_doc.moveFeature(Group_1.feature(), Remove_SubShapes_1.feature())
-Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
-Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
-Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature())
+LastFeature = Remove_SubShapes_1.feature()
+for i in range(Part_1_doc.size("Groups")):
+  GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", 0))) # move always the very first group
+  Part_1_doc.moveFeature(GroupFeature, LastFeature)
+  LastFeature = GroupFeature
 model.end()
 
-from ModelAPI import *
-
 aFactory = ModelAPI_Session.get().validators()
 
-# groups should exclude removed sub-shapes
-selectionList = Group_1.feature().selectionList("group_list")
-assert(selectionList.size() == 1)
-assert(aFactory.validate(Group_1.feature()))
-
-selectionList = Group_2.feature().selectionList("group_list")
-assert(selectionList.size() == 12)
-assert(aFactory.validate(Group_2.feature()))
-
-selectionList = Group_3.feature().selectionList("group_list")
-assert(selectionList.size() == 30)
-assert(aFactory.validate(Group_3.feature()))
-
-selectionList = Group_4.feature().selectionList("group_list")
-assert(selectionList.size() == 20)
-assert(aFactory.validate(Group_4.feature()))
+# Check groups
+a = 0
+num_in_groups = [1, 10, 15, 7]
+for i in range(Part_1_doc.size("Groups")):
+  GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", i)))
+  assert(aFactory.validate(GroupFeature))
+  assert(GroupFeature.selectionList("group_list").size() == num_in_groups[a])
+  a = a + 1
 
 assert(model.checkPythonDump())
index 7c0451e5717ad05659b1294ef91c6b0fbe3b7a5c..91fbcc3844cb91aff26841d2b204ecb7edb8cedb 100644 (file)
@@ -84,7 +84,7 @@ assert(selectionList.size() == 3)
 assert(aFactory.validate(Group_5.feature()))
 
 selectionList = Group_6.feature().selectionList("group_list")
-assert(selectionList.size() == 3)
+assert(selectionList.size() == 2) # edge selected for the fillet become removed
 assert(aFactory.validate(Group_6.feature()))
 
 model.begin()
index 81354431248e90fdb47ccbaba47d12c5e013b2f1..91bfa060887062c90c225a7b707a901b633d8146 100644 (file)
@@ -1086,9 +1086,10 @@ void Model_AttributeSelection::computeValues(
   if (aWasWholeContext) {
     theValShape = theOldContext->shape()->impl<TopoDS_Shape>();
   }
+  TopAbs_ShapeEnum aValType = theValShape.ShapeType();
   TopoDS_Shape aNewContShape = theNewContext->shape()->impl<TopoDS_Shape>();
   // if a new value is unchanged in the new context, do nothing: value is correct
-  TopExp_Explorer aSubExp(aNewContShape, theValShape.ShapeType());
+  TopExp_Explorer aSubExp(aNewContShape, aValType);
   for(; aSubExp.More(); aSubExp.Next()) {
     if (aSubExp.Current().IsSame(theValShape)) {
       theShapes.Append(theValShape);
@@ -1133,17 +1134,15 @@ void Model_AttributeSelection::computeValues(
                 return;
               }
               // don't add edges generated from faces
-              if (aPairIter.NewShape().ShapeType() <= theValShape.ShapeType())
+              if (aPairIter.NewShape().ShapeType() <= aValType)
                 theShapes.Append(aPairIter.NewShape());
             }
           } else if (!aPairIter.OldShape().IsNull()) { // search shape that contains this sub
-            TopExp_Explorer anExp(aPairIter.OldShape(), theValShape.ShapeType());
+            TopExp_Explorer anExp(aPairIter.OldShape(), aValType);
             for(; anExp.More(); anExp.Next()) {
               if (anExp.Current().IsSame(theValShape)) { // found a new container
-                if (aPairIter.NewShape().IsNull()) {// value was removed
-                  theShapes.Clear();
-                  return;
-                }
+                if (aPairIter.NewShape().IsNull()) // skip removed high-level shape
+                  continue;
                 aNewToOld.Bind(aPairIter.NewShape(), aPairIter.OldShape());
                 anOlds.Add(aPairIter.OldShape());
                 break;
@@ -1160,7 +1159,7 @@ void Model_AttributeSelection::computeValues(
     NCollection_Map<TopAbs_ShapeEnum> aNewTypes; // types of shapes to iterate
     TopTools_DataMapOfShapeShape::Iterator aNewTypeIter(aNewToOld);
     for(; aNewTypeIter.More(); aNewTypeIter.Next()) {
-      if (aNewTypeIter.Key().ShapeType() != theValShape.ShapeType())
+      if (aNewTypeIter.Key().ShapeType() != aValType)
         aNewTypes.Add(aNewTypeIter.Key().ShapeType());
     }
     NCollection_Map<TopAbs_ShapeEnum>::Iterator aTypeIter(aNewTypes);
@@ -1169,7 +1168,7 @@ void Model_AttributeSelection::computeValues(
         TopoDS_Shape anOld = anExp.Current();
         if (aNewToOld.IsBound(anOld) || anOlds.Contains(anOld)) // this was modified
           continue;
-        TopExp_Explorer aValExp(anOld, theValShape.ShapeType());
+        TopExp_Explorer aValExp(anOld, aValType);
         for(; aValExp.More(); aValExp.Next()) {
           const TopoDS_Shape& anUnchanged = aValExp.Current();
           if (anUnchanged.IsSame(theValShape)) {
@@ -1185,7 +1184,7 @@ void Model_AttributeSelection::computeValues(
     NCollection_DataMap<TopoDS_Shape, TopTools_MapOfShape, TopTools_ShapeMapHasher> aSubs;
     TopTools_DataMapOfShapeShape::Iterator aContIter(aNewToOld);
     for(; aContIter.More(); aContIter.Next()) {
-      TopExp_Explorer aSubExp(aContIter.Key(), theValShape.ShapeType());
+      TopExp_Explorer aSubExp(aContIter.Key(), aValType);
       for(; aSubExp.More(); aSubExp.Next()) {
         if (!aSubs.IsBound(aSubExp.Current())) {
           aSubs.Bind(aSubExp.Current(), TopTools_MapOfShape());
@@ -1216,13 +1215,35 @@ void Model_AttributeSelection::computeValues(
     if (aWasWholeContext)
       theShapes.Append(TopoDS_Shape());
     else { // if theValShape exists in new context, add it without changes, otherwise - nothing
-      for (TopExp_Explorer aNew(aNewContShape, theValShape.ShapeType()); aNew.More(); aNew.Next()){
+      for (TopExp_Explorer aNew(aNewContShape, aValType); aNew.More(); aNew.Next()){
         if (aNew.Current().IsSame(theValShape)) {
           theShapes.Append(theValShape);
           break;
         }
       }
     }
+  } else if (theShapes.Size() > 1) {
+    // check it is possible to remove extra sub-shapes:
+    // keep only shapes with the same number of containers if possible
+    TopAbs_ShapeEnum anAncType = TopAbs_FACE;
+    if (aValType == TopAbs_VERTEX)
+      anAncType = TopAbs_EDGE;
+    TopoDS_Shape anOldContext = theOldContext->shape()->impl<TopoDS_Shape>();
+    TopTools_IndexedDataMapOfShapeListOfShape anOldMap;
+    TopExp::MapShapesAndUniqueAncestors(anOldContext, aValType,  anAncType, anOldMap);
+    if (anOldMap.Contains(theValShape)) {
+      int aNumInOld = anOldMap.FindFromKey(theValShape).Extent();
+      TopTools_IndexedDataMapOfShapeListOfShape aNewMap;
+      TopExp::MapShapesAndUniqueAncestors(aNewContShape, aValType,  anAncType, aNewMap);
+      TopTools_ListOfShape aNewResults;
+      for(TopTools_ListOfShape::Iterator aNewSubs(theShapes); aNewSubs.More(); aNewSubs.Next()) {
+        TopoDS_Shape aCand = aNewSubs.Value();
+        if (aNewMap.Contains(aCand) && aNewMap.FindFromKey(aCand).Extent() == aNumInOld)
+          aNewResults.Append(aCand);
+      }
+      if (!aNewResults.IsEmpty() && aNewResults.Size() < theShapes.Size())
+        theShapes = aNewResults;
+    }
   }
 }