From: Anthony Geay Date: Fri, 30 Aug 2024 08:56:08 +0000 (+0200) Subject: [EDF30834] : WIP X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7da9b363dc63f89958a0b3a1534e73c91bb888d9;p=tools%2Fmedcoupling.git [EDF30834] : WIP --- diff --git a/src/ShapeRecogn/CMakeLists.txt b/src/ShapeRecogn/CMakeLists.txt index 331c5bde6..b312932e1 100644 --- a/src/ShapeRecogn/CMakeLists.txt +++ b/src/ShapeRecogn/CMakeLists.txt @@ -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 index 000000000..28038fe35 --- /dev/null +++ b/src/ShapeRecogn/PrimitiveType.cxx @@ -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 +#include + +std::vector MEDCoupling::allManagedPrimitivesStr() +{ + std::vector ret; + //std::copy(); + return ret; +} diff --git a/src/ShapeRecogn/PrimitiveType.hxx b/src/ShapeRecogn/PrimitiveType.hxx index 0cec9f095..8341c8af6 100644 --- a/src/ShapeRecogn/PrimitiveType.hxx +++ b/src/ShapeRecogn/PrimitiveType.hxx @@ -19,7 +19,9 @@ #pragma once +#include #include + namespace MEDCoupling { enum PrimitiveType @@ -32,6 +34,13 @@ namespace MEDCoupling Unknown = 5 }; + inline std::vector allManagedPrimitives() + { + return {Plane,Sphere,Cylinder,Cone,Torus,Unknown}; + } + + std::vector allManagedPrimitivesStr(); + inline std::string convertPrimitiveToString(PrimitiveType type) { std::string typeName = ""; diff --git a/src/ShapeRecogn/Test/TestShapeRecogn.py b/src/ShapeRecogn/Test/TestShapeRecogn.py index a4be8758c..508fc4387 100644 --- a/src/ShapeRecogn/Test/TestShapeRecogn.py +++ b/src/ShapeRecogn/Test/TestShapeRecogn.py @@ -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):