Salome HOME
Issue #1730: do not hide sketch objects if sketch editing is active
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_Tools.cpp
index c55689ed4bdac24a5c86d6971818ca605984b2d9..a7ec0d9bf1a92efa0fb0981e9ce795b5cee241bd 100644 (file)
@@ -1,9 +1,8 @@
-/*
- * ExchangePlugin_Tools.cpp
- *
- *  Created on: May 15, 2015
- *      Author: spo
- */
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:    ExchangePlugin_Tools.cpp
+// Created: May 15, 2015
+// Author:  Sergey POKHODENKO
 
 #include <ExchangePlugin_Tools.h>
 
@@ -18,3 +17,32 @@ std::list<std::string> ExchangePlugin_Tools::split(const std::string& theString,
     theResult.push_back(aSection);
   return theResult;
 }
+
+std::string ExchangePlugin_Tools::selectionType2xaoDimension(const std::string& theType)
+{
+  if (theType == "Vertices" || theType == "vertex")
+    return "vertex";
+  else if (theType == "Edges" || theType == "edge")
+    return "edge";
+  else if (theType == "Faces" || theType == "face")
+    return "face";
+  else if (theType == "Solids" || theType == "solid")
+    return "solid";
+
+  return std::string();
+}
+
+std::string ExchangePlugin_Tools::xaoDimension2selectionType(const std::string& theDimension)
+{
+  if (theDimension == "vertex")
+    return "vertex";
+  else if (theDimension == "edge")
+    return "edge";
+  else if (theDimension == "face")
+    return "face";
+  else if (theDimension == "solid")
+    return "solid";
+
+  return std::string();
+}
+