From: mzn Date: Fri, 24 Aug 2018 10:15:19 +0000 (+0300) Subject: Fix according to new naming. X-Git-Tag: SHAPER_V9_1_0RC1~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cb136a53b0545b0ee39cd1e94cfb836e53a0a030;p=modules%2Fshaper.git Fix according to new naming. --- diff --git a/src/ConnectorAPI/Test/TestExportToGEOM.py b/src/ConnectorAPI/Test/TestExportToGEOM.py index fd363f3c7..98d9680b1 100644 --- a/src/ConnectorAPI/Test/TestExportToGEOM.py +++ b/src/ConnectorAPI/Test/TestExportToGEOM.py @@ -86,7 +86,7 @@ def testSeveralExportsToGEOM(): Box_2 = model.addBox(Part_1_doc, 20, 20, 20) Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OX"), -10) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Box_2_1")]) - Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Partition_1_1_1/Modified_Face_2_2"), model.selection("FACE", "Box_2_1/Top")]) + Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Partition_1_1_1/Modified_Face_1_2"), model.selection("FACE", "Box_2_1/Top")]) model.do() model.end() diff --git a/src/ConnectorAPI/Test/TestExportToGEOMAllGroupsAndFields.py b/src/ConnectorAPI/Test/TestExportToGEOMAllGroupsAndFields.py index 130fb7090..a93cabaea 100644 --- a/src/ConnectorAPI/Test/TestExportToGEOMAllGroupsAndFields.py +++ b/src/ConnectorAPI/Test/TestExportToGEOMAllGroupsAndFields.py @@ -88,24 +88,31 @@ def testGroupsAndFieldsExportToGEOM(): Box_3 = model.addBox(Part_1_doc, 10, 10, 10) Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_3_1")], model.selection("EDGE", "PartSet/OX"), 20) Translation_2.result().setName("Translation_2_1") - Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Translation_1_1/Translated_Face_1"), model.selection("FACE", "Box_2_1/Top"), model.selection("FACE", "Translation_2_1/Translated_Face_1")]) + Group_1_objects = [model.selection("FACE", "Translation_1_1/Translated_Face_1"), model.selection("FACE", "Box_2_1/Top"), model.selection("FACE", "Translation_2_1/Translated_Face_1")] + Group_1 = model.addGroup(Part_1_doc, Group_1_objects) Group_1.result().setName("faces_top") - Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Partition_1_1_1/Modified_Face_2_2&Partition_1_1_1/Modified_Face_2_3"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_2&Partition_1_1_2/Modified_Face_2_1"), model.selection("EDGE", "Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2")]) + Group_2_objects = [model.selection("EDGE", "Partition_1_1_1/Modified_Face_1_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_2&Partition_1_1_2/Modified_Face_2_1"), model.selection("EDGE", "Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2")] + Group_2 = model.addGroup(Part_1_doc, Group_2_objects) Group_2.result().setName("edges_x") - Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_2_3&Partition_1_1_1/Modified_Face_2_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_2_2"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_1divided_f_1&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Partition_1_1_1/Modified_Face_2_1&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_2_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_6&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2")]) + Group_3_objects = [model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_6&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_divided_1_1&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Partition_1_1_1/Modified_Face_1_1&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_1_3&Partition_1_1_1/Modified_Face_1_2")] + Group_3 = model.addGroup(Part_1_doc, Group_3_objects) Group_3.result().setName("vertices_bottom") Group_4 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Translation_2_1")]) Group_4.result().setName("solids_small") - Field_1 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_2"), model.selection("SOLID", "Translation_2_1")]) + Field_1_objects = [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_2"), model.selection("SOLID", "Translation_2_1")] + Field_1 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_1_objects) Field_1.result().setName("Field_solids") Field_1.addStep(0, 0, [[0], [1], [2], [3]]) - Field_2 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], [model.selection("FACE", "Partition_1_1_1/Modified_Face_2_2"), model.selection("FACE", "Partition_1_1_2/Modified_Face_2_1"), model.selection("FACE", "Translation_2_1/Translated_Face_2"), model.selection("FACE", "Translation_1_1/Translated_Face_1"), model.selection("FACE", "Box_2_1/Top"), model.selection("FACE", "Translation_2_1/Translated_Face_1")]) + Field_2_objects = [model.selection("FACE", "Partition_1_1_1/Modified_Face_1_2"), model.selection("FACE", "Partition_1_1_2/Modified_Face_2_1"), model.selection("FACE", "Translation_2_1/Translated_Face_2"), model.selection("FACE", "Translation_1_1/Translated_Face_1"), model.selection("FACE", "Box_2_1/Top"), model.selection("FACE", "Translation_2_1/Translated_Face_1")] + Field_2 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_2_objects) Field_2.result().setName("Field_faces") Field_2.addStep(0, 0, [[0], [1], [1], [1], [2], [2], [2]]) - Field_3 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], [model.selection("EDGE", "Partition_1_1_1/Modified_Face_2_3&Partition_1_1_1/Modified_Face_2_2"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_2&Partition_1_1_2/Modified_Face_2_1"), model.selection("EDGE", "Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("EDGE", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_2_2"), model.selection("EDGE", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_2"), model.selection("EDGE", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_1"), model.selection("EDGE", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_1"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_1divided_f_1&Box_2_1/Top"), model.selection("EDGE", "Box_2_1/Front&Box_2_1/Top"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_2&Box_2_1/Top"), model.selection("EDGE", "Box_2_1/Top&Box_2_1/Right")]) + Field_3_objects = [model.selection("EDGE", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4"), model.selection("EDGE", "Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_2&Partition_1_1_2/Modified_Face_2_1"), model.selection("EDGE", "Partition_1_1_1/Modified_Face_1_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("EDGE", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_1_3"), model.selection("EDGE", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3"), model.selection("EDGE", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3"), model.selection("EDGE", "Box_2_1/Front&Box_2_1/Right"), model.selection("EDGE", "Box_2_1/Right&Box_2_1/Top"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_divided_1_1&Box_2_1/Right"), model.selection("EDGE", "Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1")] + Field_3 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_3_objects) Field_3.result().setName("Field_edges") Field_3.addStep(0, 0, [[0], [1], [1], [1], [2], [2], [2], [2], [3], [3], [3], [3]]) - Field_4 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], [model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Translation_1_1/Translated_Face_1"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_2_3&Translation_1_1/Translated_Face_1"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_2_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_2_3&Partition_1_1_1/Modified_Face_2_2"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_1divided_f_1&Partition_1_1_2/Modified_Face_2_2&Box_2_1/Top"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_1divided_f_1&Box_2_1/Right&Box_2_1/Top"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_1divided_f_1&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Box_2_1/Front&Partition_1_1_2/Modified_Face_2_2&Box_2_1/Top"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Box_2_1/Top"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_1"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_1"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Partition_1_1_1/Modified_Face_2_1&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_2_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_6&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2")]) + Field_4_objects = [model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_1_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Partition_1_1_1/Modified_Face_1_1&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_divided_1_1&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Translation_2_1/Translated_Face_6&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_1_3&Translation_1_1/Translated_Face_1"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Translation_1_1/Translated_Face_1"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_divided_1_1&Partition_1_1_2/Modified_Face_2_2&Box_2_1/Top"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_divided_1_1&Box_2_1/Right&Box_2_1/Top"), model.selection("VERTEX", "Box_2_1/Front&Partition_1_1_2/Modified_Face_2_2&Box_2_1/Top"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Box_2_1/Top"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_1"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_1")] + Field_4 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_4_objects) Field_4.result().setName("Field_vertices") Field_4.addStep(0, 0, [[0], [1], [1], [1], [1], [1], [1], [1], [1], [2], [2], [2], [2], [3], [3], [3], [3]]) model.exportToGEOM(Part_1_doc) @@ -165,11 +172,11 @@ def checkResultInGEOM(): field_3_GEOM = getSubObject(geomObject_1, 7) assert field_3_GEOM.GetName() == 'Field_edges' - assert field_3_GEOM.GetStep(0).GetValues() == [0.0, 2.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 1.0, 3.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 2.0, 1.0, 0.0, 0.0, 0.0] + assert field_3_GEOM.GetStep(0).GetValues() == [2.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 1.0, 0.0, 3.0, 3.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 1.0, 0.0, 0.0, 0.0] field_4_GEOM = getSubObject(geomObject_1, 8) assert field_4_GEOM.GetName() == 'Field_vertices' - assert field_4_GEOM.GetStep(0).GetValues() == [1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 3.0, 1.0, 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0, 3.0, 2.0, 3.0, 2.0, 3.0] + assert field_4_GEOM.GetStep(0).GetValues() == [2.0, 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, 1.0, 2.0, 2.0, 1.0, 3.0, 0.0, 3.0, 1.0, 0.0, 0.0, 0.0, 1.0, 3.0, 1.0, 3.0, 1.0] pass