]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
ExchangePlugin uses selectionType() like face, solid instead of Faces, Solids...
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 22 Jun 2016 11:31:53 +0000 (14:31 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Wed, 22 Jun 2016 11:43:56 +0000 (14:43 +0300)
src/ExchangePlugin/ExchangePlugin_Tools.cpp
src/ExchangePlugin/Test/TestExport.py

index 5a65fc1dabe8cd3b01adebced56f97ab49d88d7e..a7ec0d9bf1a92efa0fb0981e9ce795b5cee241bd 100644 (file)
@@ -20,13 +20,13 @@ std::list<std::string> ExchangePlugin_Tools::split(const std::string& theString,
 
 std::string ExchangePlugin_Tools::selectionType2xaoDimension(const std::string& theType)
 {
-  if (theType == "Vertices")
+  if (theType == "Vertices" || theType == "vertex")
     return "vertex";
-  else if (theType == "Edges")
+  else if (theType == "Edges" || theType == "edge")
     return "edge";
-  else if (theType == "Faces")
+  else if (theType == "Faces" || theType == "face")
     return "face";
-  else if (theType == "Solids")
+  else if (theType == "Solids" || theType == "solid")
     return "solid";
 
   return std::string();
@@ -34,16 +34,14 @@ std::string ExchangePlugin_Tools::selectionType2xaoDimension(const std::string&
 
 std::string ExchangePlugin_Tools::xaoDimension2selectionType(const std::string& theDimension)
 {
-//  return theDimension;
-
   if (theDimension == "vertex")
-    return "Vertices";
+    return "vertex";
   else if (theDimension == "edge")
-    return "Edges";
+    return "edge";
   else if (theDimension == "face")
-    return "Faces";
+    return "face";
   else if (theDimension == "solid")
-    return "Solids";
+    return "solid";
 
   return std::string();
 }
index f295039ce57f120c11703b8ab7cfbbebf805e0ea..26fb3c90dc43ea8060811252b777e3cae696c24b 100644 (file)
@@ -92,7 +92,7 @@ def testExportXAO():
     aGroupFeature = aSession.activeDocument().addFeature("Group")
     aGroupFeature.data().setName("boite_1")
     aSelectionListAttr = aGroupFeature.selectionList("group_list")
-    aSelectionListAttr.setSelectionType("Solids")
+    aSelectionListAttr.setSelectionType("solid")
     aSelectionListAttr.append(anImportFeature.lastResult(), None)
     aGroupFeature.execute()
     aSession.finishOperation()
@@ -101,18 +101,18 @@ def testExportXAO():
     aGroupFeature = aSession.activeDocument().addFeature("Group")
     aGroupFeature.data().setName("")
     aSelectionListAttr = aGroupFeature.selectionList("group_list")
-    aSelectionListAttr.setSelectionType("Faces")
-    aSelectionListAttr.append("Box_1_1/Shape1_1", "face")
-    aSelectionListAttr.append("Box_1_1/Shape2_1", "face")
+    aSelectionListAttr.setSelectionType("face")
+    aSelectionListAttr.append("Box_1_1/Shape1_1")
+    aSelectionListAttr.append("Box_1_1/Shape2_1")
     aGroupFeature.execute()
     aSession.finishOperation()
 
     # Export
     aSession.startOperation("Export")
     anExportFeature = aPart.addFeature("Export")
-    anExportFeature.string("ExportType").setValue("XAO")
+    anExportFeature.string("ExportType").setValue("XAO")
     anExportFeature.string("file_path").setValue("Data/export.xao")
-    anExportFeature.string("file_format").setValue("XAO")
+    anExportFeature.string("file_format").setValue("XAO")
     anExportFeature.string("xao_author").setValue("me")
     anExportFeature.string("xao_geometry_name").setValue("mygeom")
     anExportFeature.execute()