From: mpv Date: Mon, 19 Nov 2018 11:53:32 +0000 (+0300) Subject: Debug of Selector and correction of unit-tests X-Git-Tag: End2018~168 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b3ded1f96149594b5f75bfd81f762802713704b4;p=modules%2Fshaper.git Debug of Selector and correction of unit-tests --- diff --git a/src/FeaturesPlugin/Test/Test2197_3.py b/src/FeaturesPlugin/Test/Test2197_3.py index 0320902f0..cf01ec2dc 100644 --- a/src/FeaturesPlugin/Test/Test2197_3.py +++ b/src/FeaturesPlugin/Test/Test2197_3.py @@ -37,7 +37,7 @@ SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint()) model.do() Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/SketchLine_4"), 360, 0) -Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]")] +Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2197_4.py b/src/FeaturesPlugin/Test/Test2197_4.py index 967b9beef..cdcd04e6e 100644 --- a/src/FeaturesPlugin/Test/Test2197_4.py +++ b/src/FeaturesPlugin/Test/Test2197_4.py @@ -52,7 +52,7 @@ SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7") model.do() Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5r-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/SketchLine_4"), 360, 0) -Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][weak_name_3]")] +Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][weak_name_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2375.py b/src/FeaturesPlugin/Test/Test2375.py index 550886555..b468d2fce 100644 --- a/src/FeaturesPlugin/Test/Test2375.py +++ b/src/FeaturesPlugin/Test/Test2375.py @@ -210,13 +210,8 @@ Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Ske Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_13_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_14_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0) Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_3_1")], [model.selection("SOLID", "Common_1_1"), model.selection("SOLID", "Common_1_2")]) -Group_1_objects = [model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_4_2]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_3_1/Generated_Face&Sketch_2/SketchCircle_15_2]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_3_2]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_16_2]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_17_2]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_2_2]"), model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2][(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2)]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_4_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2)]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Generated_Face&Sketch_2/SketchCircle_15_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2)]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2)]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_3_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_16_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_17_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_2_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_2/Modified_Face&Sketch_2/SketchCircle_13_2]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_1/Modified_Face&Sketch_2/SketchCircle_14_2]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2]"), model.selection("VERTEX", "[(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2)][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2]"), model.selection("VERTEX", "[(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2)][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2]"), model.selection("VERTEX", "[(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2)][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("VERTEX", "[(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2)][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2]"), model.selection("VERTEX", "Common_1_2/Generated_Vertex&Sketch_3/SketchLine_25"), model.selection("VERTEX", "Common_1_1/Generated_Vertex&Sketch_3/SketchLine_25")] -Group_1 = model.addGroup(Part_1_doc, Group_1_objects) -Group_2_objects = [model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][weak_name_3]"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2)]"), model.selection("EDGE", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_3_2]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_3_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "Common_1_2/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_13_2"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_2/Modified_Face&Sketch_2/SketchCircle_13_2]"), model.selection("EDGE", "(Common_1_2/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_13_2)(Common_1_2/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_13_2)"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_4_2]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_3_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2)]"), model.selection("EDGE", "[(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2)][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("EDGE", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_3_1/Generated_Face&Sketch_2/SketchCircle_15_2]"), model.selection("EDGE", "(Common_1_1/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_14_2)(Common_1_1/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_14_2)"), model.selection("EDGE", "Common_1_1/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_14_2"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_1/Modified_Face&Sketch_2/SketchCircle_14_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2)]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_4_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_4_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_3_1/Generated_Face&Sketch_2/SketchCircle_15_2][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_3_1/Generated_Face&Sketch_2/SketchCircle_15_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_16_2]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_17_2]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_17_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_16_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_16_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_17_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][weak_name_3]"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2][(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2)]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2][weak_name_5]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4][ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_2_2]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_2_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_2_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][weak_name_3]"), model.selection("EDGE", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2][weak_name_3]")] -Group_2 = model.addGroup(Part_1_doc, Group_2_objects) -Group_3_objects = [model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2"), model.selection("FACE", "(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2)"), model.selection("FACE", "ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_3_2"), model.selection("FACE", "Common_1_2/Modified_Face&Sketch_3/SketchLine_25"), model.selection("FACE", "ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_4_2"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2"), model.selection("FACE", "(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2)"), model.selection("FACE", "Common_1_1/Modified_Face&Sketch_3/SketchLine_25"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2"), model.selection("FACE", "Cut_1_1/Modified_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2"), model.selection("FACE", "(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2)"), model.selection("FACE", "Common_1_1/Modified_Face&Sketch_2/SketchCircle_14_2"), model.selection("FACE", "ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2"), model.selection("FACE", "Common_1_2/Modified_Face&Sketch_2/SketchCircle_13_2"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "ExtrusionCut_3_1/Generated_Face&Sketch_2/SketchCircle_15_2"), model.selection("FACE", "ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_16_2"), model.selection("FACE", "ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_17_2"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2"), model.selection("FACE", "(ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2)(ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2)"), model.selection("FACE", "ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_2_2")] -Group_3 = model.addGroup(Part_1_doc, Group_3_objects) model.do() +model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.end() assert(model.checkPythonDump()) diff --git a/src/ModelAPI/Test/Test2391.py b/src/ModelAPI/Test/Test2391.py index e0c97f8d4..caea5a405 100644 --- a/src/ModelAPI/Test/Test2391.py +++ b/src/ModelAPI/Test/Test2391.py @@ -202,7 +202,7 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OY"), mode Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchPoint_2"), False) SketchPoint_3 = SketchProjection_3.createdFeature() -SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][weak_name_2]"), False) +SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8])"), False) SketchLine_36 = SketchProjection_4.createdFeature() SketchCircle_1 = Sketch_2.addCircle(14.5, 0, 2.25) SketchConstraintCoincidence_38 = Sketch_2.setCoincident(SketchPoint_3.result(), SketchCircle_1.center()) diff --git a/src/ModelAPI/Test/TestCustomName_MultiTranslation.py b/src/ModelAPI/Test/TestCustomName_MultiTranslation.py index ab19886dd..a7e817cde 100644 --- a/src/ModelAPI/Test/TestCustomName_MultiTranslation.py +++ b/src/ModelAPI/Test/TestCustomName_MultiTranslation.py @@ -31,7 +31,7 @@ Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10) Cylinder_1.result().setName("cylinder") -LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("EDGE", "[cylinder/Face_1][weak_name_3]"), 10, NB_COPIES) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("EDGE", "([cylinder/Face_1][cylinder/Face_2])([cylinder/Face_1][cylinder/Face_3])"), 10, NB_COPIES) model.do() TransResult = LinearCopy_1.result() diff --git a/src/ModelAPI/Test/TestCustomName_Translation.py b/src/ModelAPI/Test/TestCustomName_Translation.py index 383df810b..3a8cb09d7 100644 --- a/src/ModelAPI/Test/TestCustomName_Translation.py +++ b/src/ModelAPI/Test/TestCustomName_Translation.py @@ -28,7 +28,7 @@ Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10) Cylinder_1.result().setName("cylinder") -Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("EDGE", "[cylinder/Face_1][weak_name_3]"), 20) +Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("EDGE", "([cylinder/Face_1][cylinder/Face_2])([cylinder/Face_1][cylinder/Face_3])"), 20) model.do() assert(Translation_1.result().name() == Cylinder_1.result().name()), "Translation name '{}' != '{}'".format(Translation_1.result().name(), Cylinder_1.result().name()) diff --git a/src/Selector/Selector_Algo.cpp b/src/Selector/Selector_Algo.cpp index 0901da33d..ca141637f 100644 --- a/src/Selector/Selector_Algo.cpp +++ b/src/Selector/Selector_Algo.cpp @@ -40,6 +40,8 @@ #include #include #include +#include + /// type of the selection, integer keeps the Selector_Type value static const Standard_GUID kSEL_TYPE("db174d59-c2e3-4a90-955e-55544df090d6"); @@ -122,6 +124,7 @@ Selector_Algo* Selector_Algo::select(const TopoDS_Shape theContext, const TopoDS delete aContainer; return NULL; } + Selector_Intersect* anIntersect = new Selector_Intersect; SET_ALGO_FLAGS(anIntersect); bool aGoodIntersector = anIntersect->select(theContext, theValue); @@ -415,4 +418,6 @@ Selector_Algo* Selector_Algo::restoreByName(TDF_Label theLab, TDF_Label theBaseD void Selector_Algo::storeType(const Selector_Type theType) { TDataStd_Integer::Set(myLab, kSEL_TYPE, (int)(theType)); + if (myGeometricalNaming) + TDataStd_UAttribute::Set(myLab, kGEOMETRICAL_NAMING); } diff --git a/src/Selector/Selector_Algo.h b/src/Selector/Selector_Algo.h index f2149fe5e..97eb30a49 100644 --- a/src/Selector/Selector_Algo.h +++ b/src/Selector/Selector_Algo.h @@ -108,6 +108,9 @@ public: /// Creates a new selection algorithm for selection of all topology based on the same geometry SELECTOR_EXPORT static Selector_Algo* relesectWithAllGeometry( Selector_Algo* theOldAlgo, const TopoDS_Shape theContext); + /// Sets geometrical naming flag to true + void setGeometricalNaming() + {myGeometricalNaming = true;} protected: /// Returns label where this algorithm is attached to, or just an access label to the document diff --git a/src/Selector/Selector_FilterByNeighbors.cpp b/src/Selector/Selector_FilterByNeighbors.cpp index 440e65b33..4d71686db 100644 --- a/src/Selector/Selector_FilterByNeighbors.cpp +++ b/src/Selector/Selector_FilterByNeighbors.cpp @@ -189,8 +189,9 @@ bool Selector_FilterByNeighbors::select(const TopoDS_Shape theContext, const Top } // iterate by the order in theContext to keep same naming names TopExp_Explorer anOrder(theContext, theValue.ShapeType()); + TopTools_MapOfShape alreadyProcessed; for (; anOrder.More(); anOrder.Next()) { - if (aNewNB.Contains(anOrder.Current())) { + if (alreadyProcessed.Add(anOrder.Current()) && aNewNB.Contains(anOrder.Current())) { TopoDS_Shape aNewNBShape = anOrder.Current(); // check which can be named correctly, without "by neighbors" type Selector_Algo* aSubAlgo = Selector_Algo::select(theContext, aNewNBShape, diff --git a/src/Selector/Selector_Intersect.cpp b/src/Selector/Selector_Intersect.cpp index 5d003a2a9..2d0750b37 100644 --- a/src/Selector/Selector_Intersect.cpp +++ b/src/Selector/Selector_Intersect.cpp @@ -63,6 +63,8 @@ static void commonShapes(const TopoDS_ListOfShape& theShapes, TopAbs_ShapeEnum t bool Selector_Intersect::select(const TopoDS_Shape theContext, const TopoDS_Shape theValue) { + if (!useIntersections()) + return false; myShapeType = theValue.ShapeType(); TopAbs_ShapeEnum aSelectionType = myShapeType; // try to find the shape of the higher level type in the context shape @@ -132,7 +134,7 @@ bool Selector_Intersect::select(const TopoDS_Shape theContext, const TopoDS_Shap TopoDS_ListOfShape::Iterator anInt(aLastIntersectors); for (; anInt.More(); anInt.Next()) { Selector_Algo* aSubAlgo = Selector_Algo::select(theContext, anInt.Value(), - newSubLabel(), baseDocument(), geometricalNaming(), useNeighbors(), useIntersections()); + newSubLabel(), baseDocument(), geometricalNaming(), useNeighbors(), false); if (!append(aSubAlgo)) break; // if some selector is failed, stop and search another solution } diff --git a/src/Selector/Selector_Selector.cpp b/src/Selector/Selector_Selector.cpp index c04ceb79a..260d8da9d 100644 --- a/src/Selector/Selector_Selector.cpp +++ b/src/Selector/Selector_Selector.cpp @@ -86,6 +86,8 @@ TDF_Label Selector_Selector::restoreByName( myAlgo = Selector_Algo::restoreByName( myLab, myBaseDocumentLab, theName, theShapeType, theNameGenerator, aResult); if (myAlgo) { + if (theGeometricalNaming) + myAlgo->setGeometricalNaming(); return aResult; } return TDF_Label(); diff --git a/test.models/case24.py b/test.models/case24.py index 2681525fe..d6840ca0d 100644 --- a/test.models/case24.py +++ b/test.models/case24.py @@ -127,14 +127,14 @@ SketchConstraintDistance_3 = Sketch_2.setDistance(SketchLine_10.startPoint(), Sk SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_11.endPoint(), SketchLine_10.result(), 20) model.do() ExtrusionFuse_2 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_13r-SketchArc_2_2f-SketchLine_14f-SketchLine_9f-SketchLine_10f")], model.selection(), 0, 25, [model.selection("SOLID", "ExtrusionFuse_1_1")]) -Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_14)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchArc_2_2)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_13)")) +Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_14)(ExtrusionFuse_2_1/Modified_Face&ExtrusionFuse_1_1/From_Face)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchArc_2_2)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_13)")) SketchLine_15 = Sketch_3.addLine(0, -20, -17.00000002635728, -20) SketchLine_15.setName("SketchLine_19") SketchLine_15.result().setName("SketchLine_19") SketchLine_16 = Sketch_3.addLine(-20, 0, 0, 0) SketchLine_16.setName("SketchLine_15") SketchLine_16.result().setName("SketchLine_15") -SketchPoint_2 = Sketch_3.addPoint(model.selection("VERTEX", "[ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9][(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9)(ExtrusionFuse_1_1/Generated_Face&Sketch_1/SketchLine_8)][(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_14)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchArc_2_2)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_13)][(ExtrusionFuse_1_1/Generated_Face&Sketch_1/SketchLine_8)(ExtrusionFuse_1_1/Generated_Face&Sketch_1/SketchArc_1_2)]")) +SketchPoint_2 = Sketch_3.addPoint(model.selection("VERTEX", "[ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9][(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9)(ExtrusionFuse_1_1/Generated_Face&Sketch_1/SketchLine_8)(ExtrusionFuse_2_1/Modified_Face&ExtrusionFuse_1_1/From_Face)][(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_14)(ExtrusionFuse_2_1/Modified_Face&ExtrusionFuse_1_1/From_Face)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchArc_2_2)(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_13)][ExtrusionFuse_2_1/Modified_Face&ExtrusionFuse_1_1/From_Face]")) SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_16.endPoint(), SketchPoint_2.result()) SketchLine_17 = Sketch_3.addLine(0, 0, 0, -20) SketchLine_17.setName("SketchLine_16") @@ -175,7 +175,7 @@ SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_17.result(), Sketch SketchConstraintDistance_7 = Sketch_3.setDistance(SketchLine_21.startPoint(), SketchLine_18.result(), 3) model.do() RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection("EDGE", "Sketch_3/SketchLine_21"), 71, 0, [model.selection("SOLID", "ExtrusionFuse_2_1")]) -Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "(RevolutionFuse_1_1/Modified_Face&Sketch_1/SketchLine_1)(ExtrusionFuse_1_1/Generated_Face&Sketch_1/SketchLine_8)(ExtrusionFuse_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(RevolutionFuse_1_1/Generated_Face&Sketch_3/SketchLine_16)(RevolutionFuse_1_1/Modified_Face&Sketch_1/SketchLine_7)")) +Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "RevolutionFuse_1_1/Modified_Face&ExtrusionFuse_1_1/From_Face")) SketchLine_22 = Sketch_4.addLine(-3, -20, 17, -20) SketchLine_22.setName("SketchLine_26") SketchLine_22.result().setName("SketchLine_26")