]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
[EDF30834] : WIP
authorAnthony Geay <anthony.geay@edf.fr>
Fri, 30 Aug 2024 08:56:08 +0000 (10:56 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Fri, 30 Aug 2024 08:56:08 +0000 (10:56 +0200)
src/ShapeRecogn/CMakeLists.txt
src/ShapeRecogn/PrimitiveType.cxx [new file with mode: 0644]
src/ShapeRecogn/PrimitiveType.hxx
src/ShapeRecogn/Test/TestShapeRecogn.py

index 331c5bde643339ec459512d6d88cd874116a88f0..b312932e1aa9b267543316158df3f69b6c7b5369 100644 (file)
@@ -48,6 +48,7 @@ SET(shaperecogn_SOURCES
   AreasBuilder.cxx
   ShapeRecognMeshBuilder.cxx
   ShapeRecognMesh.cxx
+  PrimitiveType.cxx
 )
 
 ADD_LIBRARY(shaperecogn ${shaperecogn_SOURCES})
diff --git a/src/ShapeRecogn/PrimitiveType.cxx b/src/ShapeRecogn/PrimitiveType.cxx
new file mode 100644 (file)
index 0000000..28038fe
--- /dev/null
@@ -0,0 +1,30 @@
+// Copyright (C) 2024  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "PrimitiveType.hxx"
+
+#include <iterator>
+#include <algorithm>
+
+std::vector<std::string> MEDCoupling::allManagedPrimitivesStr()
+{
+  std::vector<std::string> ret;
+  //std::copy();
+  return ret;
+}
index 0cec9f0957baf4e22fdb6f3f84dd74133502c3e2..8341c8af6364ad264b2f386c40c697d53389cc3c 100644 (file)
@@ -19,7 +19,9 @@
 
 #pragma once
 
+#include <vector>
 #include <string>
+
 namespace MEDCoupling
 {
     enum PrimitiveType
@@ -32,6 +34,13 @@ namespace MEDCoupling
         Unknown = 5
     };
 
+    inline std::vector<PrimitiveType> allManagedPrimitives()
+    {
+        return {Plane,Sphere,Cylinder,Cone,Torus,Unknown};
+    }
+
+    std::vector<std::string> allManagedPrimitivesStr();
+
     inline std::string convertPrimitiveToString(PrimitiveType type)
     {
         std::string typeName = "";
index a4be8758c8e76261e0fa64083bf910425340ee31..508fc43874d419ffcd521d72332a135e623bdaea 100644 (file)
@@ -43,7 +43,7 @@ def getResourceFile(filename, levelUp = 2):
   resourceFile = p / "resources" / filename
   if not resourceFile.exists():
      raise RuntimeError( f"getResourceFile: could not open resource test file {filename}" )
-  pass
+  return f"{resourceFile}"
 
 class MEDCouplingIterativeStatisticsTest(unittest.TestCase):
   def testPlane(self):