Salome HOME
Fix the python dump of whole-results groups for specific test-case.
authormpv <mpv@opencascade.com>
Mon, 16 Sep 2019 08:34:31 +0000 (11:34 +0300)
committermpv <mpv@opencascade.com>
Mon, 16 Sep 2019 08:34:48 +0000 (11:34 +0300)
src/CollectionAPI/CollectionAPI_Group.cpp
src/ModelAPI/Test/TestSelectorShell.py

index 98b6409d62221ad258780a2ce29d5950a86f0738..fae2ae36a7e5be5b549c6d08706a0ebe16897111 100644 (file)
@@ -64,7 +64,7 @@ void CollectionAPI_Group::dump(ModelHighAPI_Dumper& theDumper) const
   AttributeSelectionListPtr anAttrList = aBase->selectionList(CollectionPlugin_Group::LIST_ID());
 
   theDumper << aBase << " = model.addGroup(" << aDocName << ", ";
-  if (anAttrList->isWholeResultAllowed())
+  if (anAttrList->isWholeResultAllowed() && !anAttrList->selectionType().empty())
     theDumper<<"\""<<anAttrList->selectionType()<<"\", ";
   theDumper << anAttrList;
   if (anAttrList->isGeometricalSelection())
index a699cbdb34eee43e5f8e384821bef95be919b43c..6d8f1c8e26dd22b315a84c971df4ba89d4afe47f 100644 (file)
@@ -31,6 +31,7 @@ aBoxResult = Box_1.feature().results()[0]
 aShell = GeomAPI_ShapeExplorer(aBoxResult.shape(), GeomAPI_Shape.SHELL)
 aGroup = Part_1_doc.addFeature("Group")
 aGroup.selectionList("group_list").append(aBoxResult, aShell.current())
+aGroup.selectionList("group_list").setSelectionType("SHELL") # to compute the shape for the whole result selection correctly
 model.end()
 
 # check that the resulting group is correct