From dd3915d96dcc45f2699d2bf8c76560c15645b1a4 Mon Sep 17 00:00:00 2001 From: El Hadi Moussi Date: Wed, 7 Aug 2024 18:40:48 +0200 Subject: [PATCH] Add Torus test --- resources/CMakeLists.txt | 1 + resources/ShapeRecognTorus.med | Bin 0 -> 43247 bytes src/ShapeRecogn/Test/CMakeLists.txt | 1 + src/ShapeRecogn/Test/TestShapeRecogn.cxx | 2 + src/ShapeRecogn/Test/TorusTest.cxx | 38 ++++++++++++++++++ src/ShapeRecogn/Test/TorusTest.hxx | 49 +++++++++++++++++++++++ 6 files changed, 91 insertions(+) create mode 100755 resources/ShapeRecognTorus.med create mode 100644 src/ShapeRecogn/Test/TorusTest.cxx create mode 100644 src/ShapeRecogn/Test/TorusTest.hxx diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 9d5f66c98..cf6ec2481 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -98,6 +98,7 @@ SET(MED_other_FILES ShapeRecognCylinder.med ShapeRecognCone.med ShapeRecognSphere.med + ShapeRecognTorus.med ) SET(MED_RESOURCES_FILES ${MED_test_fig_files}) diff --git a/resources/ShapeRecognTorus.med b/resources/ShapeRecognTorus.med new file mode 100755 index 0000000000000000000000000000000000000000..7623db578bc12a32a74e0d6041f51ee64ad00ead GIT binary patch literal 43247 zcmeI*2Urxzx;O9v6p)xh#4~&F#rZA5fh3z zM^wzH2xdjTM*i=fb=2Lx=k7W8JNGirbIxzy>guklx2k()x`*AF?k;ZH8WtML>gpnT zmE!ekb9sq9HrQ>{U*+rW(m`2bIcN8P-~Vs4vO!rL+L6>y7Ac8Dsum&vT@N2OU;m)C zu0F0ET6?+rAHhLYg*}x-YOX&1LEf!f#|rh!UaC4}r7CW%{a31%mx#W#fPemt$P1t6!ETRqy^ILxSpCmvyo1)ux>P=KsHS+Ft8hm!!X+>9T+B zqV(svU7%9ld^O}u)uF7XHS5^_@T&i_vRSkm3;vs<_z&AXL7rRU*1_HH+p<#@>HVYo z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ists.txt +++ b/src/ShapeRecogn/Test/CMakeLists.txt @@ -36,6 +36,7 @@ SET(TestShapeRecogn_SOURCES CylinderTest.cxx ConeTest.cxx SphereTest.cxx + TorusTest.cxx ) SALOME_ACCUMULATE_ENVIRONMENT(MEDCOUPLING_RESOURCE_DIR "${CMAKE_BINARY_DIR}/resources") diff --git a/src/ShapeRecogn/Test/TestShapeRecogn.cxx b/src/ShapeRecogn/Test/TestShapeRecogn.cxx index 6c09cba82..b7cd2af14 100644 --- a/src/ShapeRecogn/Test/TestShapeRecogn.cxx +++ b/src/ShapeRecogn/Test/TestShapeRecogn.cxx @@ -22,11 +22,13 @@ #include "CylinderTest.hxx" #include "ConeTest.hxx" #include "SphereTest.hxx" +#include "TorusTest.hxx" CPPUNIT_TEST_SUITE_REGISTRATION(MEDCoupling::MathOpsTest); CPPUNIT_TEST_SUITE_REGISTRATION(MEDCoupling::PlaneTest); CPPUNIT_TEST_SUITE_REGISTRATION(MEDCoupling::CylinderTest); CPPUNIT_TEST_SUITE_REGISTRATION(MEDCoupling::ConeTest); CPPUNIT_TEST_SUITE_REGISTRATION(MEDCoupling::SphereTest); +CPPUNIT_TEST_SUITE_REGISTRATION(MEDCoupling::TorusTest); #include "BasicMainTest.hxx" diff --git a/src/ShapeRecogn/Test/TorusTest.cxx b/src/ShapeRecogn/Test/TorusTest.cxx new file mode 100644 index 000000000..612913881 --- /dev/null +++ b/src/ShapeRecogn/Test/TorusTest.cxx @@ -0,0 +1,38 @@ +#include "TorusTest.hxx" + +#include "ShapeRecognMesh.hxx" +#include "Areas.hxx" +#include "MathOps.hxx" +#include "TestInterpKernelUtils.hxx" // getResourceFile() + +using namespace MEDCoupling; + +void TorusTest::setUp() +{ + std::string file = INTERP_TEST::getResourceFile("ShapeRecognTorus.med", 3); + srMesh = new ShapeRecognMesh(file); + srMesh->recognize(); + areas = srMesh->getAreas(); +} + +void TorusTest::tearDown() +{ + if (srMesh != 0) + delete srMesh; + areas = 0; +} + +void TorusTest::testArea() +{ + CPPUNIT_ASSERT_EQUAL(275, (int)srMesh->getNodes()->getNbNodes()); + CPPUNIT_ASSERT_EQUAL(1, (int)areas->getNumberOfAreas()); + CPPUNIT_ASSERT_EQUAL(PrimitiveType::Torus, areas->getPrimitiveType(0)); + // Some nodes are unknown + CPPUNIT_ASSERT_EQUAL(272, (int)areas->getNumberOfNodes(0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.843297, areas->getMinorRadius(0), 1E-2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1.156428, areas->getRadius(0), 1E-1); + std::array centerRef = {7.687022, -3.726887, -9.02}; + std::array center = areas->getCenter(0); + for (size_t j = 0; j < 3; ++j) + CPPUNIT_ASSERT_DOUBLES_EQUAL(centerRef[j], center[j], 1E-2); +} diff --git a/src/ShapeRecogn/Test/TorusTest.hxx b/src/ShapeRecogn/Test/TorusTest.hxx new file mode 100644 index 000000000..4999f579b --- /dev/null +++ b/src/ShapeRecogn/Test/TorusTest.hxx @@ -0,0 +1,49 @@ +// Copyright (C) 2007-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 +// + +#ifndef __TORUSTEST_HXX__ +#define __TORUSTEST_HXX__ + +#include +#include + +namespace MEDCoupling +{ + class ShapeRecognMesh; + class Areas; + + class TorusTest : public CppUnit::TestFixture + { + CPPUNIT_TEST_SUITE(TorusTest); + CPPUNIT_TEST(testArea); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp() override; + void tearDown() override; + + void testArea(); + + private: + ShapeRecognMesh *srMesh = 0; + const Areas *areas; + }; +}; + +#endif // __TORUSTEST_HXX__ -- 2.39.2