X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNELTest%2FThreeDSurfProjectionTest.cxx;h=2a84b503a2fdf86aa70e1dd308c36ea55c2e9b06;hb=a843e859241baea9b4942877174422d2891206ef;hp=f052edbb4c67d8278024ae78886c4e18bf1de3fc;hpb=72f740f3390fe173ddd3af29380b54dd7acd8174;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNELTest/ThreeDSurfProjectionTest.cxx b/src/INTERP_KERNELTest/ThreeDSurfProjectionTest.cxx index f052edbb4..2a84b503a 100644 --- a/src/INTERP_KERNELTest/ThreeDSurfProjectionTest.cxx +++ b/src/INTERP_KERNELTest/ThreeDSurfProjectionTest.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,8 @@ class MyMeshType { public: static const int MY_SPACEDIM=3; + static const int MY_MESHDIM=3; + static const INTERP_KERNEL::NumberingPolicy My_numPol=INTERP_KERNEL::ALL_C_MODE; typedef int MyConnType; }; @@ -48,7 +50,7 @@ void INTERP_TEST::ThreeDSurfProjectionTest::test1() // here the max 3D distance is 1e-5 > 1e-6 so 1 is expected std::copy(coo,coo+9,tmp0); std::copy(coo2,coo2+9,tmp1); - ret=INTERP_KERNEL::PlanarIntersector::projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.5,true); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,-1.,0.5,true); CPPUNIT_ASSERT_EQUAL(1,ret); const double expected0[9]={0.,0.,0.,1.,0.,0.,0.,1.,0.}; for(int i=0;i<9;i++) @@ -59,12 +61,12 @@ void INTERP_TEST::ThreeDSurfProjectionTest::test1() // here the max 3D distance is 1e-8 < 1e-6 so 0 is expected std::copy(coo,coo+9,tmp0); std::copy(coo2,coo2+9,tmp1); - ret=INTERP_KERNEL::PlanarIntersector::projection(tmp0,tmp1,3,3,1e-2,1e-8/* <- */,0.5,true); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-8/* <- */,-1.,0.5,true); CPPUNIT_ASSERT_EQUAL(0,ret); // here testing when max 3D distance is 1e-5 > 1e-6 with inverted cells std::copy(coo,coo+9,tmp0); std::copy(coo2,coo2+3,tmp1+6); std::copy(coo2+3,coo2+6,tmp1+3); std::copy(coo2+6,coo2+9,tmp1); - ret=INTERP_KERNEL::PlanarIntersector::projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.5,true); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,-1.,0.5,true); CPPUNIT_ASSERT_EQUAL(-1,ret); const double expected1[9]={-0.7071067811865476,-0.7071067811865476,0.,0.,-1.4142135623730951,0.,-1.4142135623730951,-1.4142135623730951,0.}; const double expected2[9]={-1.4142135623730951,-1.4142135623730951,0.,0.,-1.4142135623730951,0.,-0.7071067811865476,-0.7071067811865476,0.}; @@ -93,12 +95,32 @@ void INTERP_TEST::ThreeDSurfProjectionTest::test2() // here the max 3D distance is 1e-5 > 1e-6 so 1 is expected std::copy(coo,coo+9,tmp0); std::copy(coo2,coo2+9,tmp1); - ret=INTERP_KERNEL::PlanarIntersector::projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.5,true); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,-1.,0.5,true); CPPUNIT_ASSERT_EQUAL(1,ret); // here the max 3D distance is 1e-8 < 1e-6 so 0 is expected std::copy(coo,coo+9,tmp0); std::copy(coo2,coo2+9,tmp1); - ret=INTERP_KERNEL::PlanarIntersector::projection(tmp0,tmp1,3,3,1e-2,1e-8/* <- */,0.5,true); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-8/* <- */,-1.,0.5,true); + CPPUNIT_ASSERT_EQUAL(0,ret); + // again max 3D distance is 1e-5 > 1e-6 so 1 is expected + std::copy(coo,coo+9,tmp0); + std::copy(coo2,coo2+9,tmp1); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,-1.,0.5,true); + CPPUNIT_ASSERT_EQUAL(1,ret); + // again max 3D distance is 1e-5 > 1e-6 but minDot set to 0.8. 0 expected. because the angle is pi/4 so cos(pi/3) > 0.8 + std::copy(coo,coo+9,tmp0); + std::copy(coo2,coo2+9,tmp1); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.8/* <- */,0.5,true); + CPPUNIT_ASSERT_EQUAL(0,ret); + // again max 3D distance is 1e-5 > 1e-6 but minDot set to 0.7. 1 expected. because the angle is pi/4 so cos(pi/3) < 0.49 + std::copy(coo,coo+9,tmp0); + std::copy(coo2,coo2+9,tmp1); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.49/* <- */,0.5,true); + CPPUNIT_ASSERT_EQUAL(1,ret); + // again max 3D distance is 1e-5 > 1e-6 but minDot set to 0.7. 0 expected. because the angle is pi/4 so cos(pi/3) > 0.51 + std::copy(coo,coo+9,tmp0); + std::copy(coo2,coo2+9,tmp1); + ret=INTERP_KERNEL::PlanarIntersector::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.51/* <- */,0.5,true); CPPUNIT_ASSERT_EQUAL(0,ret); // delete [] tmp0;