Back to index

salome-med  6.5.0
QuadraticPlanarInterpTest5.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "QuadraticPlanarInterpTest.hxx"
00021 #include "InterpKernelGeo2DQuadraticPolygon.hxx"
00022 #include "InterpKernelGeo2DElementaryEdge.hxx"
00023 #include "InterpKernelGeo2DEdgeArcCircle.hxx"
00024 #include "InterpKernelGeo2DEdgeLin.hxx"
00025 
00026 #include <cmath>
00027 #include <sstream>
00028 #include <iostream>
00029 #include <iterator>
00030 
00031 using namespace INTERP_KERNEL;
00032 
00033 namespace INTERP_TEST
00034 {
00035 
00036 class DoubleEqual
00037 {
00038 public:
00039   DoubleEqual(double eps):_eps(eps) { }
00040   bool operator()(double x, double y) { return fabs(x-y)<_eps; }
00041 private:
00042   double _eps;
00043 };
00044 
00045 void QuadraticPlanarInterpTest::checkNonRegressionOmar0000()
00046 {
00047   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00048   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00049   double coords[16]={
00050     -0.383022221559489, 0.3213938048432697, -0.5745333323392334, 0.4820907072649046, 0.5745333323392335, 0.4820907072649044, 0.383022221559489, 0.3213938048432696,
00051     -0.4787777769493612, 0.4017422560540872, 4.592273826833915e-17, 0.75, 0.4787777769493612, 0.401742256054087, 3.061515884555943e-17, 0.5 };
00052   
00053   double coords2[16]={
00054     -0.383022221559489, -0.1786061951567303, -0.5745333323392334, -0.01790929273509539, 0.5745333323392335, -0.01790929273509556, 0.383022221559489, -0.1786061951567304,
00055     -0.4787777769493612, -0.0982577439459128, 4.592273826833915e-17, 0.25, 0.4787777769493612, -0.09825774394591297, 3.061515884555943e-17, 0 };
00056 
00057   int tab8[8]={
00058     0, 1, 2, 3, 4, 5, 6, 7 };
00059   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00060   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00061   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00062   delete pol1;
00063   delete pol2;
00064   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00065   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00066   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00067   delete pol1;
00068   delete pol2;
00069 }
00070 
00071 void QuadraticPlanarInterpTest::checkNonRegressionOmar0001()
00072 {
00073   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00074   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00075   double coords[16]={
00076     -0.383022221559489, 0.3213938048432697, -0.5745333323392334, 0.4820907072649046, 0.5745333323392335, 0.4820907072649044, 0.383022221559489, 0.3213938048432696,
00077     -0.4787777769493612, 0.4017422560540872, 4.592273826833915e-17, 0.75, 0.4787777769493612, 0.401742256054087, 3.061515884555943e-17, 0.5 };
00078   
00079   double coords2[16]={
00080     -0.383022221559489, 0.3213938048432697, -0.5745333323392334, 0.4820907072649046, 0.5745333323392335, 0.4820907072649044, 0.383022221559489, 0.3213938048432696,
00081     -0.4787777769493612, 0.4017422560540872, 4.592273826833915e-17, 0.75, 0.4787777769493612, 0.401742256054087, 3.061515884555943e-17, 0.5 };
00082   
00083   int tab8[8]={
00084     0, 1, 2, 3, 4, 5, 6, 7 };
00085   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00086   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00087   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.272708,pol1->intersectWith(*pol2),1.e-6);
00088   delete pol1;
00089   delete pol2;
00090   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00091   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00092   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.272708,pol2->intersectWith(*pol1),1.e-6);
00093   delete pol1;
00094   delete pol2;
00095 }
00096 
00097 void QuadraticPlanarInterpTest::checkNonRegressionOmar0002()
00098 {
00099   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00100   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00101   double coords[16]={
00102     -0.383022221559489, 0.3213938048432697, -0.5745333323392334, 0.4820907072649046, 0.5745333323392335, 0.4820907072649044, 0.383022221559489, 0.3213938048432696,
00103     -0.4787777769493612, 0.4017422560540872, 4.592273826833915e-17, 0.75, 0.4787777769493612, 0.401742256054087, 3.061515884555943e-17, 0.5 };
00104   
00105   double coords2[16]={
00106     -0.4979288880273356, 0.4178119462962507, -0.6128355544951823, 0.5142300877492316, 0.6128355544951825, 0.5142300877492314, 0.4979288880273357, 0.4178119462962505,
00107     -0.555382221261259, 0.4660210170227412, 4.898425415289509e-17, 0.8, 0.5553822212612591, 0.466021017022741, 3.979970649922726e-17, 0.65 };
00108 
00109   int tab8[8]={
00110     0, 1, 2, 3, 4, 5, 6, 7 };
00111   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00112   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00113   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.122173,pol1->intersectWith(*pol2),1.e-6);
00114   delete pol1;
00115   delete pol2;
00116   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00117   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00118   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.122173,pol2->intersectWith(*pol1),1.e-6);
00119   delete pol1;
00120   delete pol2;
00121 }
00122 
00123 void QuadraticPlanarInterpTest::checkNonRegressionOmar0003()
00124 {
00125   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00126   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00127   double coords[16]={
00128     -0.3535533905932737, 0.3535533905932738, -0.5303300858899106, 0.5303300858899107, 0.5303300858899107, 0.5303300858899106, 0.3535533905932738, 0.3535533905932737,
00129     -0.4419417382415922, 0.4419417382415922, 4.592273826833915e-17, 0.75, 0.4419417382415922, 0.4419417382415922, 3.061515884555943e-17, 0.5 };
00130   
00131   double coords2[16]={
00132     -0.4979288880273356, 0.4178119462962507, -0.6128355544951823, 0.5142300877492316, 0.6128355544951825, 0.5142300877492314, 0.4979288880273357, 0.4178119462962505,
00133     -0.555382221261259, 0.4660210170227412, 4.898425415289509e-17, 0.8, 0.5553822212612591, 0.466021017022741, 3.979970649922726e-17, 0.65 };
00134 
00135   int tab8[8]={
00136     0, 1, 2, 3, 4, 5, 6, 7 };
00137   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00138   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00139   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.109956,pol1->intersectWith(*pol2),1.e-6);
00140   delete pol1;
00141   delete pol2;
00142   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00143   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00144   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.109956,pol2->intersectWith(*pol1),1.e-6);
00145   delete pol1;
00146   delete pol2;
00147 }
00148 
00149 void QuadraticPlanarInterpTest::checkNonRegressionOmar0004()
00150 {
00151   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00152   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00153   double coords[16]={
00154     -0.4596194077712559, 0.4596194077712559, -0.5303300858899106, 0.5303300858899107, 0.5303300858899107, 0.5303300858899106, 0.4596194077712559, 0.4596194077712559,
00155     -0.4949747468305832, 0.4949747468305833, 4.592273826833915e-17, 0.75, 0.4949747468305833, 0.4949747468305832, 3.979970649922726e-17, 0.65 };
00156 
00157   double coords2[16]={
00158     -0.383022221559489, 0.3213938048432697, -0.6128355544951823, 0.5142300877492316, 0.6128355544951825, 0.5142300877492314, 0.383022221559489, 0.3213938048432696,
00159     -0.4979288880273356, 0.4178119462962507, 4.898425415289509e-17, 0.8, 0.4979288880273357, 0.4178119462962505, 3.061515884555943e-17, 0.5 };
00160 
00161   int tab8[8]={
00162     0, 1, 2, 3, 4, 5, 6, 7 };
00163   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00164   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00165   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.109956,pol1->intersectWith(*pol2),1.e-6);
00166   delete pol1;
00167   delete pol2;
00168   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00169   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00170   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.109956,pol2->intersectWith(*pol1),1.e-6);
00171   delete pol1;
00172   delete pol2;
00173 }
00174 
00175 void QuadraticPlanarInterpTest::checkNonRegressionOmar0005()
00176 {
00177   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00178   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00179   double coords[16]={
00180     -0.383022221559489, 0.3213938048432697, -0.6128355544951823, 0.5142300877492316, 0.6128355544951825, 0.5142300877492314, 0.383022221559489, 0.3213938048432696,
00181     -0.4979288880273356, 0.4178119462962507, 4.898425415289509e-17, 0.8, 0.4979288880273357, 0.4178119462962505, 3.061515884555943e-17, 0.5 };
00182   
00183   double coords2[16]={
00184     -0.4596194077712559, 0.4596194077712559, -0.5303300858899106, 0.5303300858899107, 0.5303300858899107, 0.5303300858899106, 0.4596194077712559, 0.4596194077712559,
00185     -0.4949747468305832, 0.4949747468305833, 4.592273826833915e-17, 0.75, 0.4949747468305833, 0.4949747468305832, 3.979970649922726e-17, 0.65 };
00186   
00187   int tab8[8]={
00188     0, 1, 2, 3, 4, 5, 6, 7 };
00189   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00190   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00191   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.109956,pol1->intersectWith(*pol2),1.e-6);
00192   delete pol1;
00193   delete pol2;
00194   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00195   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00196   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.109956,pol2->intersectWith(*pol1),1.e-6);
00197   delete pol1;
00198   delete pol2;
00199 }
00200 
00201 void QuadraticPlanarInterpTest::checkNonRegressionOmar0006()
00202 {
00203   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00204   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00205   double coords[16]={
00206     -0.383022221559489, 0.3213938048432697, -0.5362311101832845, 0.4499513267805776, 0.5362311101832846, 0.4499513267805774, 0.383022221559489, 0.3213938048432696,
00207     -0.4596266658713867, 0.3856725658119237, 4.28612223837832e-17, 0.7, 0.4596266658713868, 0.3856725658119236, 3.061515884555943e-17, 0.5 };
00208   
00209   double coords2[16]={
00210     -0.1811733315717646, 0.6761480784023478, -0.2070552360820167, 0.7727406610312547, 0.2070552360820166, 0.7727406610312547, 0.1811733315717645, 0.6761480784023478,
00211     -0.1941142838268906, 0.7244443697168013, 4.898425415289509e-17, 0.8, 0.1941142838268906, 0.7244443697168013, 4.28612223837832e-17, 0.7 };
00212   
00213   int tab8[8]={
00214     0, 1, 2, 3, 4, 5, 6, 7 };
00215   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00216   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00217   std::vector<double> val1,val2;
00218   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00219   double test1_res[4]={0.,0.366519,0.,0.};
00220   double test2_res[4]={0.,0.,0.,0.366519};
00221   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-6)));
00222   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
00223   delete pol1;
00224   delete pol2;
00225 }
00226 
00227 void QuadraticPlanarInterpTest::checkNonRegressionOmar0007()
00228 {
00229   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00230   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00231   double coords[16]={
00232     -0.383022221559489, 0.3213938048432697, -0.5362311101832845, 0.4499513267805776, 0.5362311101832846, 0.4499513267805774, 0.383022221559489, 0.3213938048432696,
00233     -0.4596266658713867, 0.3856725658119237, 4.28612223837832e-17, 0.7, 0.4596266658713868, 0.3856725658119236, 3.061515884555943e-17, 0.5 };
00234   
00235   double coords2[16]={
00236     -0.4499513267805775, 0.5362311101832846, -0.5142300877492315, 0.6128355544951825, -0.1389185421335442, 0.7878462024097664, -0.1215537243668512, 0.6893654271085455,
00237     -0.4820907072649045, 0.5745333323392335, -0.3380946093925595, 0.7250462296293201, -0.1302361332501977, 0.738605814759156, -0.2958327832184895, 0.634415450925655 };
00238   
00239   int tab8[8]={
00240     0, 1, 2, 3, 4, 5, 6, 7 };
00241   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00242   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00243   std::vector<double> val1,val2;
00244   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00245   double test1_res[4]={0.,0.366519,0.,0.};
00246   double test2_res[4]={0.,0.,0.,0.366519};
00247   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-6)));
00248   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
00249   delete pol1;
00250   delete pol2;
00251 }
00252 
00253 void QuadraticPlanarInterpTest::checkNonRegressionOmar0008()
00254 {
00255   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00256   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00257   double coords[16]={
00258     -0.383022221559489, 0.3213938048432697, -0.5362311101832845, 0.4499513267805776, 0.5362311101832846, 0.4499513267805774, 0.383022221559489, 0.3213938048432696,
00259     -0.4596266658713867, 0.3856725658119237, 4.28612223837832e-17, 0.7, 0.4596266658713868, 0.3856725658119236, 3.061515884555943e-17, 0.5 };
00260   
00261   double coords2[16]={
00262     -0.6344154509256549, 0.2958327832184896, -0.72504622962932, 0.3380946093925596, -0.4588611490808367, 0.6553216354311937, -0.401503505445732, 0.5734064310022944,
00263     -0.6797308402774874, 0.3169636963055246, -0.6128355544951823, 0.5142300877492316, -0.4301823272632844, 0.614364033216744, -0.5362311101832845, 0.4499513267805776 };
00264   
00265   int tab8[8]={
00266     0, 1, 2, 3, 4, 5, 6, 7 };
00267   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00268   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00269   std::vector<double> val1,val2;
00270   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00271   double test1_res[4]={0.,0.18326,0.,0.};
00272   double test2_res[4]={0.,0.,0.,0.18326};
00273   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-5)));
00274   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-5)));
00275   delete pol1;
00276   delete pol2;
00277 }
00278 
00279 void QuadraticPlanarInterpTest::checkNonRegressionOmar0009()
00280 {
00281   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00282   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00283   double coords[16]={
00284     -0.3863703305156274, -0.1035276180410081, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512604, 0.3863703305156274, -0.1035276180410083,
00285     -0.4346666218300808, -0.1164685702961342, 1.416374613080751e-16, 0.5, 0.4346666218300808, -0.1164685702961343, 1.133099690464601e-16, 0.4 };
00286   double coords2[16]={
00287     0.5, -1.224606353822377e-16, 0.6, -1.469527624586853e-16, -0.6, 7.347638122934263e-17, -0.5, 6.123031769111886e-17,
00288     0.55, -1.347066989204615e-16, -1.102145718440139e-16, -0.6, -0.55, 6.735334946023075e-17, -9.184547653667829e-17, -0.5 };
00289   
00290   int tab8[8]={
00291     0, 1, 2, 3, 4, 5, 6, 7 };
00292   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00293   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00294   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00295   delete pol1;
00296   delete pol2;
00297   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00298   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00299   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00300   delete pol1;
00301   delete pol2;
00302 }
00303 
00304 void QuadraticPlanarInterpTest::checkNonRegressionOmar0010()
00305 {
00306   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00307   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00308   double coords[16]={
00309     -0.3863703305156274, -0.1035276180410081, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512604, 0.3863703305156274, -0.1035276180410083,
00310 -0.4346666218300808, -0.1164685702961342, 1.416374613080751e-16, 0.5, 0.4346666218300808, -0.1164685702961343, 1.133099690464601e-16, 0.4 };
00311   double coords2[16]={
00312     0.4346666218300808, -0.1164685702961343, 0.579555495773441, -0.1552914270615124, -0.579555495773441, -0.1552914270615122, -0.4346666218300808, -0.1164685702961342,
00313 0.5071110588017609, -0.1358799986788234, -1.102145718440139e-16, -0.6, -0.507111058801761, -0.1358799986788232, -8.266092888301047e-17, -0.45 };
00314   
00315   int tab8[8]={
00316     0, 1, 2, 3, 4, 5, 6, 7 };
00317   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00318   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00319   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00320   delete pol1;
00321   delete pol2;
00322   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00323   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00324   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00325   delete pol1;
00326   delete pol2;
00327 }
00328 
00329 void QuadraticPlanarInterpTest::checkNonRegressionOmar0011()
00330 {
00331   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00332   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00333   double coords[16]={
00334     -0.3863703305156274, -0.1035276180410081, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512604, 0.3863703305156274, -0.1035276180410083,
00335 -0.4346666218300808, -0.1164685702961342, 1.416374613080751e-16, 0.5, 0.4346666218300808, -0.1164685702961343, 1.133099690464601e-16, 0.4 };
00336   double coords2[16]={
00337     0.4829629131445342, -0.1294095225512603, 0.579555495773441, -0.1552914270615124, -0.579555495773441, -0.1552914270615122, -0.4829629131445342, -0.1294095225512602,
00338 0.5312592044589877, -0.1423504748063864, -1.102145718440139e-16, -0.6, -0.5312592044589877, -0.1423504748063862, -9.184547653667829e-17, -0.5 };
00339   
00340   int tab8[8]={
00341     0, 1, 2, 3, 4, 5, 6, 7 };
00342   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00343   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00344   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00345   double val1,val2,val3;
00346   pol1->intersectForPerimeter(*pol2,val1,val2,val3);
00347   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val1,1.e-13);
00348   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val2,1.e-13);
00349   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val3,1.e-13);
00350   std::vector<double> val4,val5;
00351   pol1->intersectForPerimeterAdvanced(*pol2,val4,val5);
00352   double test1_res[4]={0.,0.,0.,0.};
00353   CPPUNIT_ASSERT(std::equal(val4.begin(),val4.end(),test1_res,DoubleEqual(1e-13)));
00354   CPPUNIT_ASSERT(std::equal(val5.begin(),val5.end(),test1_res,DoubleEqual(1e-13)));
00355   delete pol1;
00356   delete pol2;
00357   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00358   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00359   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00360   pol1->intersectForPerimeter(*pol2,val1,val2,val3);
00361   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val1,1.e-13);
00362   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val2,1.e-13);
00363   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val3,1.e-13);
00364   val4.clear(); val5.clear();
00365   pol1->intersectForPerimeterAdvanced(*pol2,val4,val5);
00366   CPPUNIT_ASSERT(std::equal(val4.begin(),val4.end(),test1_res,DoubleEqual(1e-13)));
00367   CPPUNIT_ASSERT(std::equal(val5.begin(),val5.end(),test1_res,DoubleEqual(1e-13)));
00368   delete pol1;
00369   delete pol2;
00370 }
00371 
00372 void QuadraticPlanarInterpTest::checkNonRegressionOmar2511()
00373 {
00374   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00375   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00376   double coords[16]={
00377     -0.3863703305156274, -0.1035276180410081, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512604, 0.3863703305156274, -0.1035276180410083,
00378     -0.4346666218300808, -0.1164685702961342, 1.416374613080751e-16, 0.5, 0.4346666218300808, -0.1164685702961343, 1.133099690464601e-16, 0.4, };
00379   
00380   double coords2[16]={
00381     0.579555495773441, -0.1552914270615124, -0.579555495773441, -0.1552914270615122, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512603,
00382     -1.102145718440139e-16, -0.6, -0.5312592044589877, -0.1423504748063862, -9.184547653667829e-17, -0.5, 0.5312592044589877, -0.1423504748063864, };
00383 
00384   int tab8[8]={
00385     0, 1, 2, 3, 4, 5, 6, 7 };
00386   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00387   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00388   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00389   double val1,val2,val3;
00390   pol1->intersectForPerimeter(*pol2,val1,val2,val3);
00391   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val1,1.e-13);
00392   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val2,1.e-13);
00393   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val3,1.e-13);
00394   std::vector<double> val4,val5;
00395   pol1->intersectForPerimeterAdvanced(*pol2,val4,val5);
00396   double test1_res[4]={0.,0.,0.,0.};
00397   CPPUNIT_ASSERT(std::equal(val4.begin(),val4.end(),test1_res,DoubleEqual(1e-13)));
00398   CPPUNIT_ASSERT(std::equal(val5.begin(),val5.end(),test1_res,DoubleEqual(1e-13)));
00399   delete pol1;
00400   delete pol2;
00401   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00402   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00403   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00404   pol1->intersectForPerimeter(*pol2,val1,val2,val3);
00405   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val1,1.e-13);
00406   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val2,1.e-13);
00407   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val3,1.e-13);
00408   val4.clear(); val5.clear();
00409   pol1->intersectForPerimeterAdvanced(*pol2,val4,val5);
00410   CPPUNIT_ASSERT(std::equal(val4.begin(),val4.end(),test1_res,DoubleEqual(1e-13)));
00411   CPPUNIT_ASSERT(std::equal(val5.begin(),val5.end(),test1_res,DoubleEqual(1e-13)));
00412   delete pol1;
00413   delete pol2;
00414 }
00415 
00416 void QuadraticPlanarInterpTest::checkNonRegressionOmar0012()
00417 {
00418   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00419   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00420   double coords[16]={
00421     -1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
00422     -1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
00423   
00424   double coords2[16]={
00425     6.123031769111886e-18, 1.85, 1.224606353822377e-17, 1.95, 1.224606353822377e-17, 1.55, 6.123031769111886e-18, 1.65,
00426     9.18454765366783e-18, 1.9, 0.2, 1.75, 9.18454765366783e-18, 1.6, 0.1, 1.75 };
00427   
00428   int tab8[8]={
00429     0, 1, 2, 3, 4, 5, 6, 7 };
00430   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00431   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00432   std::vector<double> val1,val2;
00433   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00434   double test1_res[4]={0.,0.,0.05,0.};
00435   double test2_res[4]={0.,0.,0.05,0.};
00436   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-13)));
00437   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
00438   delete pol1;
00439   delete pol2;
00440   std::vector<int> val3;
00441   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00442   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00443   pol1->intersectForPoint(*pol2,val3);
00444   int test3_res[4]={0,0,1,0};
00445   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00446   delete pol1;
00447   delete pol2;
00448 }
00449 
00450 void QuadraticPlanarInterpTest::checkNonRegressionOmar0013()
00451 {
00452   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00453   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00454   double coords[16]={
00455     -1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
00456     -1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
00457   
00458   double coords2[16]={
00459     6.123031769111886e-18, 1.7, 1.224606353822377e-17, 1.8, 1.224606353822377e-17, 1.4, 6.123031769111886e-18, 1.5,
00460     9.18454765366783e-18, 1.75, 0.2, 1.6, 9.18454765366783e-18, 1.45, 0.1, 1.6 };
00461 
00462   int tab8[8]={
00463     0, 1, 2, 3, 4, 5, 6, 7 };
00464   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00465   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00466   std::vector<double> val1,val2;
00467   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00468   double test1_res[4]={0.,0.,0.1,0.};
00469   double test2_res[4]={0.,0.,0.1,0.};
00470   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-13)));
00471   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
00472   delete pol1;
00473   delete pol2;
00474   std::vector<int> val3;
00475   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00476   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00477   pol1->intersectForPoint(*pol2,val3);
00478   int test3_res[4]={0,0,2,0};
00479   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00480   delete pol1;
00481   delete pol2;
00482 }
00483 
00484 void QuadraticPlanarInterpTest::checkNonRegressionOmar0014()
00485 {
00486   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00487   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00488   double coords[16]={
00489     -1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
00490 -1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
00491   double coords2[16]={
00492     6.123031769111886e-18, 1.55, 1.224606353822377e-17, 1.65, 1.224606353822377e-17, 1.25, 6.123031769111886e-18, 1.35,
00493 9.18454765366783e-18, 1.6, 0.2, 1.45, 9.18454765366783e-18, 1.3, 0.1, 1.45 };
00494   
00495   int tab8[8]={
00496     0, 1, 2, 3, 4, 5, 6, 7 };
00497   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00498   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00499   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00500   delete pol1;
00501   delete pol2;
00502   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00503   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00504   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00505   delete pol1;
00506   delete pol2;
00507   //
00508   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00509   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00510   std::vector<double> val1,val2;
00511   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00512   double test1_res[4]={0.,0.,0.15,0.};
00513   double test2_res[4]={0.05,0.,0.1,0.};
00514   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-13)));
00515   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
00516   delete pol1;
00517   delete pol2;
00518   std::vector<int> val3;
00519   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00520   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00521   pol1->intersectForPoint(*pol2,val3);
00522   int test3_res[4]={0,0,3,0};
00523   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00524   delete pol1;
00525   delete pol2;
00526 }
00527 
00528 void QuadraticPlanarInterpTest::checkNonRegressionOmar0015()
00529 {
00530   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00531   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00532   double coords[16]={
00533     -1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
00534 -1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
00535   double coords2[16]={
00536     6.123031769111886e-18, 1.4, 1.224606353822377e-17, 1.5, 1.224606353822377e-17, 1.1, 6.123031769111886e-18, 1.2,
00537 9.18454765366783e-18, 1.45, 0.2, 1.3, 9.18454765366783e-18, 1.15, 0.1, 1.3 };
00538   
00539   int tab8[8]={
00540     0, 1, 2, 3, 4, 5, 6, 7 };
00541   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00542   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00543   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00544   delete pol1;
00545   delete pol2;
00546   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00547   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00548   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00549   delete pol1;
00550   delete pol2;
00551   //
00552   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00553   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00554   std::vector<double> val1,val2;
00555   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00556   double test1_res[4]={0.,0.,0.2,0.};
00557   double test2_res[4]={0.1,0.,0.1,0.};
00558   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-13)));
00559   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
00560   delete pol1;
00561   delete pol2;
00562   std::vector<int> val3;
00563   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00564   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00565   pol1->intersectForPoint(*pol2,val3);
00566   int test3_res[4]={0,0,4,0};
00567   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00568   delete pol1;
00569   delete pol2;
00570 }
00571 
00572 void QuadraticPlanarInterpTest::checkNonRegressionOmar0016()
00573 {
00574   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00575   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00576   double coords[16]={
00577     -1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
00578 -1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
00579   double coords2[16]={
00580     6.123031769111886e-18, 1.25, 1.224606353822377e-17, 1.35, 1.224606353822377e-17, 0.95, 6.123031769111886e-18, 1.05,
00581 9.18454765366783e-18, 1.3, 0.2, 1.15, 9.18454765366783e-18, 0.9999999999999999, 0.1, 1.15 };
00582   
00583   int tab8[8]={
00584     0, 1, 2, 3, 4, 5, 6, 7 };
00585   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00586   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00587   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00588   delete pol1;
00589   delete pol2;
00590   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00591   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00592   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00593   delete pol1;
00594   delete pol2;
00595   //
00596   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00597   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00598   std::vector<double> val1,val2;
00599   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00600   double test1_res[4]={0.,0.,0.15,0.};
00601   double test2_res[4]={0.1,0.,0.05,0.};
00602   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-13)));
00603   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
00604   delete pol1;
00605   delete pol2;
00606   std::vector<int> val3;
00607   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00608   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00609   pol1->intersectForPoint(*pol2,val3);
00610   int test3_res[4]={0,0,3,0};
00611   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00612   delete pol1;
00613   delete pol2;
00614 }
00615 
00616 void QuadraticPlanarInterpTest::checkNonRegressionOmar0017()
00617 {
00618   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00619   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00620   double coords[16]={
00621     -1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
00622     -1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
00623   
00624   double coords2[16]={
00625     6.123031769111886e-18, 1.1, 1.224606353822377e-17, 1.2, 1.224606353822377e-17, 0.8, 6.123031769111886e-18, 0.9,
00626     9.18454765366783e-18, 1.15, 0.2, 1, 9.18454765366783e-18, 0.85, 0.1, 1 };
00627 
00628   int tab8[8]={
00629     0, 1, 2, 3, 4, 5, 6, 7 };
00630   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00631   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00632   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00633   delete pol1;
00634   delete pol2;
00635   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00636   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00637   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00638   delete pol1;
00639   delete pol2;
00640   //
00641   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00642   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00643   std::vector<double> val1,val2;
00644   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00645   double test1_res[4]={0.,0.,0.1,0.};
00646   double test2_res[4]={0.1,0.,0.,0.};
00647   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-13)));
00648   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
00649   delete pol1;
00650   delete pol2;
00651   std::vector<int> val3;
00652   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00653   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00654   pol1->intersectForPoint(*pol2,val3);
00655   int test3_res[4]={0,0,2,0};
00656   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00657   delete pol1;
00658   delete pol2;
00659 }
00660 
00661 void QuadraticPlanarInterpTest::checkNonRegressionOmar0018()
00662 {
00663   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00664   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00665   double coords[16]={
00666     -1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
00667     -1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
00668   
00669   double coords2[16]={
00670     6.123031769111886e-18, 0.95, 1.224606353822377e-17, 1.05, 1.224606353822377e-17, 0.6499999999999999, 6.123031769111886e-18, 0.75,
00671     9.18454765366783e-18, 1, 0.2, 0.85, 9.18454765366783e-18, 0.7, 0.1, 0.85 };
00672 
00673   int tab8[8]={
00674     0, 1, 2, 3, 4, 5, 6, 7 };
00675   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00676   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00677   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00678   delete pol1;
00679   delete pol2;
00680   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00681   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00682   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00683   delete pol1;
00684   delete pol2;
00685   //
00686   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00687   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00688   std::vector<double> val1,val2;
00689   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00690   double test1_res[4]={0.,0.,0.05,0.};
00691   double test2_res[4]={0.05,0.,0.,0.};
00692   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-13)));
00693   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
00694   delete pol1;
00695   delete pol2;
00696   std::vector<int> val3;
00697   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00698   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00699   pol1->intersectForPoint(*pol2,val3);
00700   int test3_res[4]={0,0,1,0};
00701   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00702   delete pol1;
00703   delete pol2;
00704 }
00705 
00706 void QuadraticPlanarInterpTest::checkNonRegressionOmar0019()
00707 {
00708   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00709   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00710   double coords[16]={
00711     -0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
00712     -0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
00713   
00714   double coords2[16]={
00715     0.9500000000000001, 1.836909530733566e-17, 0.8, 3.673819061467131e-17, 1.4, 0, 1.25, 0,
00716     0.8750000000000001, 2.755364296100349e-17, 1.1, 0.3, 1.325, 0, 1.1, 0.15 };
00717 
00718   int tab8[8]={
00719     0, 1, 2, 3, 4, 5, 6, 7 };
00720   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00721   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00722   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00723   delete pol1;
00724   delete pol2;
00725   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00726   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00727   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00728   delete pol1;
00729   delete pol2;
00730 }
00731 
00732 void QuadraticPlanarInterpTest::checkNonRegressionOmar0020()
00733 {
00734   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00735   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00736   double coords[16]={
00737     -0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
00738     -0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
00739   
00740   double coords2[16]={
00741     0.05000000000000002, 1.836909530733566e-17, -0.09999999999999998, 3.673819061467131e-17, 0.5, 0, 0.35, 0,
00742     -0.02499999999999997, 2.755364296100349e-17, 0.2, 0.3, 0.425, 0, 0.2, 0.15 };
00743   
00744   int tab8[8]={
00745     0, 1, 2, 3, 4, 5, 6, 7 };
00746   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00747   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00748   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00749   delete pol1;
00750   delete pol2;
00751   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00752   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00753   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00754   delete pol1;
00755   delete pol2;
00756   //
00757   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00758   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00759   std::vector<double> val1,val2;
00760   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00761   double test1_res[4]={0.,0.,0.,0.};
00762   double test2_res[4]={0.,0.,0.,0.};
00763   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-6)));
00764   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
00765   delete pol1;
00766   delete pol2;
00767   std::vector<int> val3;
00768   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00769   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00770   pol1->intersectForPoint(*pol2,val3);
00771   int test3_res[4]={0,0,0,0};
00772   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00773   delete pol1;
00774   delete pol2;
00775 }
00776 
00777 void QuadraticPlanarInterpTest::checkNonRegressionOmar0021()
00778 {
00779   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00780   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00781   double coords[16]={
00782     -0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
00783     -0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
00784   
00785   double coords2[16]={
00786     -1, -0.07999999999999999, -1.15, -0.07999999999999996, -0.55, -0.08, -0.7, -0.08,
00787     -1.075, -0.07999999999999997, -0.85, 0.22, -0.625, -0.08, -0.85, 0.06999999999999999 };
00788   
00789   int tab8[8]={
00790     0, 1, 2, 3, 4, 5, 6, 7 };
00791   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00792   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00793   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0311485,pol1->intersectWith(*pol2),1.e-7);
00794   delete pol1;
00795   delete pol2;
00796   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00797   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00798   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0311485,pol2->intersectWith(*pol1),1.e-7);
00799   delete pol1;
00800   delete pol2;
00801   //
00802   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00803   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00804   std::vector<double> val1,val2;
00805   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
00806   double test1_res[4]={0.162251,0.151523,0.,0.};
00807   double test2_res[4]={0.,0.311383,0.,0.0978193};
00808   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-6)));
00809   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
00810   delete pol1;
00811   delete pol2;
00812   std::vector<int> val3;
00813   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00814   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00815   pol1->intersectForPoint(*pol2,val3);
00816   int test3_res[4]={2,2,0,0};
00817   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00818   delete pol1;
00819   delete pol2;
00820 }
00821 void QuadraticPlanarInterpTest::checkNonRegressionOmar0022()
00822 {
00823   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00824   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00825   double coords[16]={
00826     -0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
00827     -0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
00828   
00829   double coords2[16]={
00830     0.15, -0.07999999999999999, 0, -0.07999999999999996, 0.6, -0.08, 0.45, -0.08,
00831     0.07500000000000001, -0.07999999999999997, 0.3, 0.22, 0.5249999999999999, -0.08, 0.3, 0.06999999999999999 };
00832   
00833   int tab8[8]={
00834     0, 1, 2, 3, 4, 5, 6, 7 };
00835   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00836   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00837   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00902229,pol1->intersectWith(*pol2),1.e-8);
00838   delete pol1;
00839   delete pol2;
00840   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00841   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00842   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00902229,pol2->intersectWith(*pol1),1.e-8);
00843   delete pol1;
00844   delete pol2;
00845 }
00846 
00847 void QuadraticPlanarInterpTest::checkNonRegressionOmar0023()
00848 {
00849   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00850   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00851   double coords[16]={
00852     -0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
00853     -0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5, };
00854   
00855   double coords2[16]={
00856     0.4156854249492381, 0.5656854249492381, 0.2656854249492381, 0.5656854249492381, 0.8656854249492381, 0.5656854249492381, 0.7156854249492381, 0.5656854249492381,
00857     0.3406854249492381, 0.5656854249492381, 0.5656854249492381, 0.8656854249492381, 0.7906854249492381, 0.5656854249492381, 0.5656854249492381, 0.7156854249492381 };
00858   
00859   int tab8[8]={
00860     0, 1, 2, 3, 4, 5, 6, 7 };
00861   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00862   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00863   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0215659,pol1->intersectWith(*pol2),1.e-7);
00864   delete pol1;
00865   delete pol2;
00866   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00867   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00868   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0215659,pol2->intersectWith(*pol1),1.e-7);
00869   delete pol1;
00870   delete pol2;
00871 }
00872 
00873 void QuadraticPlanarInterpTest::checkNonRegressionOmar0024()
00874 {
00875   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00876   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00877   double coords[16]={
00878     -0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
00879 -0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
00880   double coords2[16]={
00881     0.5656854249492381, 0.5656854249492381, 0.4156854249492382, 0.5656854249492381, 1.015685424949238, 0.5656854249492381, 0.8656854249492382, 0.5656854249492381,
00882 0.4906854249492382, 0.5656854249492381, 0.7156854249492381, 0.8656854249492381, 0.9406854249492381, 0.5656854249492381, 0.7156854249492381, 0.7156854249492381 };
00883   
00884   int tab8[8]={
00885     0, 1, 2, 3, 4, 5, 6, 7 };
00886   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00887   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00888   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00877657,pol1->intersectWith(*pol2),1.e-8);
00889   delete pol1;
00890   delete pol2;
00891   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00892   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00893   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00877657,pol2->intersectWith(*pol1),1.e-8);
00894   delete pol1;
00895   delete pol2;
00896 }
00897 
00898 void QuadraticPlanarInterpTest::checkNonRegressionOmar2524()
00899 {
00900   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00901   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00902   double coords[16]={
00903     -0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
00904 -0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
00905   double coords2[16]={
00906     0.4156854249492382, 0.5656854249492381, 1.015685424949238, 0.5656854249492381, 0.8656854249492382, 0.5656854249492381, 0.5656854249492381, 0.5656854249492381,
00907 0.7156854249492381, 0.8656854249492381, 0.9406854249492381, 0.5656854249492381, 0.7156854249492381, 0.7156854249492381, 0.4906854249492382, 0.5656854249492381 };
00908   
00909   int tab8[8]={
00910     0, 1, 2, 3, 4, 5, 6, 7 };
00911   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00912   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00913   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00877657,pol1->intersectWith(*pol2),1.e-8);
00914   delete pol1;
00915   delete pol2;
00916   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00917   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00918   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00877657,pol2->intersectWith(*pol1),1.e-8);
00919   delete pol1;
00920   delete pol2;
00921 }
00922 
00923 void QuadraticPlanarInterpTest::checkNonRegressionOmar0025()
00924 {
00925   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00926   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00927   double coords[16]={
00928     -0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
00929     -0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
00930   
00931   double coords2[16]={
00932     0.715685424949238, 0.5656854249492381, 0.565685424949238, 0.5656854249492381, 1.165685424949238, 0.5656854249492381, 1.015685424949238, 0.5656854249492381,
00933     0.6406854249492381, 0.5656854249492381, 0.8656854249492381, 0.8656854249492381, 1.090685424949238, 0.5656854249492381, 0.8656854249492381, 0.7156854249492381 };
00934 
00935   int tab8[8]={
00936     0, 1, 2, 3, 4, 5, 6, 7 };
00937   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00938   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00939   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00940   delete pol1;
00941   delete pol2;
00942   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00943   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00944   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00945   delete pol1;
00946   delete pol2;
00947   //
00948   std::vector<int> val3;
00949   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00950   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00951   pol1->intersectForPoint(*pol2,val3);
00952   int test3_res[4]={0,1,0,0};
00953   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00954   delete pol1;
00955   delete pol2;
00956 }
00957 
00958 void QuadraticPlanarInterpTest::checkNonRegressionOmar0026()
00959 {
00960   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00961   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00962   double coords[16]={
00963     -0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
00964     -0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
00965   
00966   double coords2[16]={
00967     0.1, 0.95, 0.2, 0.95, -0.2, 0.95, -0.1, 0.95,
00968     0.15, 0.95, 1.224606353822377e-17, 0.75, -0.15, 0.95, 6.123031769111886e-18, 0.85 };
00969   
00970   int tab8[8]={
00971     0, 1, 2, 3, 4, 5, 6, 7 };
00972   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00973   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00974   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
00975   delete pol1;
00976   delete pol2;
00977   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00978   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00979   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
00980   delete pol1;
00981   delete pol2;
00982   //
00983   std::vector<int> val3;
00984   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
00985   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
00986   pol1->intersectForPoint(*pol2,val3);
00987   int test3_res[4]={0,1,0,0};
00988   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
00989   delete pol1;
00990   delete pol2;
00991 }
00992 
00993 void QuadraticPlanarInterpTest::checkNonRegressionOmar0027()
00994 {
00995   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
00996   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
00997   double coords[16]={
00998     -0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
00999     -0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
01000   
01001   double coords2[16]={
01002     -0.1, 0.7, -0.2, 0.7, 0.2, 0.7, 0.1, 0.7,
01003     -0.15, 0.7, 1.224606353822377e-17, 0.8999999999999999, 0.15, 0.7, 6.123031769111886e-18, 0.7999999999999999 };
01004   
01005   int tab8[8]={
01006     0, 1, 2, 3, 4, 5, 6, 7 };
01007   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01008   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01009   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00712309,pol1->intersectWith(*pol2),1.e-8);
01010   delete pol1;
01011   delete pol2;
01012   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01013   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01014   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00712309,pol2->intersectWith(*pol1),1.e-8);
01015   delete pol1;
01016   delete pol2;
01017   //
01018   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01019   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01020   std::vector<double> val1,val2;
01021   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
01022   double test1_res[4]={0.,0.222704,0.,0.};
01023   double test2_res[4]={0.1,0.0465335,0.1,0.092554};
01024   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-6)));
01025   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
01026   delete pol1;
01027   delete pol2;
01028   std::vector<int> val3;
01029   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01030   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01031   pol1->intersectForPoint(*pol2,val3);
01032   int test3_res[4]={0,4,0,0};
01033   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
01034   delete pol1;
01035   delete pol2;
01036 }
01037 
01038 void QuadraticPlanarInterpTest::checkNonRegressionOmar0028()
01039 {
01040   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
01041   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
01042   double coords[16]={
01043     -0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
01044     -0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
01045   
01046   double coords2[16]={
01047     -0.07071067811865477, 0.4792893218813453, -0.1414213562373095, 0.4085786437626905, 0.1414213562373095, 0.6914213562373095, 0.07071067811865477, 0.6207106781186548,
01048     -0.1060660171779822, 0.4439339828220179, -0.1414213562373095, 0.6914213562373096, 0.1060660171779822, 0.6560660171779822, -0.07071067811865475, 0.6207106781186548 };
01049   
01050   int tab8[8]={
01051     0, 1, 2, 3, 4, 5, 6, 7 };
01052   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01053   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01054   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0471239,pol1->intersectWith(*pol2),1.e-7);
01055   delete pol1;
01056   delete pol2;
01057   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01058   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01059   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0471239,pol2->intersectWith(*pol1),1.e-7);
01060   delete pol1;
01061   delete pol2;
01062   //
01063   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01064   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01065   std::vector<double> val1,val2;
01066   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
01067   double test1_res[4]={0.,0.,0.,0.};
01068   double test2_res[4]={0.1,0.628319,0.1,0.314159};
01069   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-6)));
01070   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
01071   delete pol1;
01072   delete pol2;
01073   std::vector<int> val3;
01074   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01075   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01076   pol1->intersectForPoint(*pol2,val3);
01077   int test3_res[4]={0,1,0,0};
01078   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
01079   delete pol1;
01080   delete pol2;
01081 }
01082 
01083 void QuadraticPlanarInterpTest::checkNonRegressionOmar0029()
01084 {
01085   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
01086   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
01087   double coords[16]={
01088     -0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
01089     -0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
01090   
01091   double coords2[16]={
01092     -0.07071067811865477, 0.1292893218813453, -0.1414213562373095, 0.05857864376269051, 0.1414213562373095, 0.3414213562373095, 0.07071067811865477, 0.2707106781186548,
01093     -0.1060660171779822, 0.09393398282201787, -0.1414213562373095, 0.3414213562373095, 0.1060660171779822, 0.3060660171779822, -0.07071067811865475, 0.2707106781186548 };
01094   
01095   int tab8[8]={
01096     0, 1, 2, 3, 4, 5, 6, 7 };
01097   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01098   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01099   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol1->intersectWith(*pol2),1.e-13);
01100   delete pol1;
01101   delete pol2;
01102   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01103   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01104   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,pol2->intersectWith(*pol1),1.e-13);
01105   delete pol1;
01106   delete pol2;
01107   //
01108   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01109   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01110   std::vector<double> val1,val2;
01111   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
01112   double test1_res[4]={0.,0.,0.,0.};
01113   double test2_res[4]={0.,0.,0.,0.};
01114   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-13)));
01115   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
01116   delete pol1;
01117   delete pol2;
01118   std::vector<int> val3;
01119   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01120   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01121   pol1->intersectForPoint(*pol2,val3);
01122   int test3_res[4]={0,0,0,1};
01123   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
01124   delete pol1;
01125   delete pol2;
01126 }
01127 
01128 void QuadraticPlanarInterpTest::checkNonRegressionOmar0030()
01129 {
01130   INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
01131   INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
01132   double coords[16]={
01133     -0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
01134     -0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
01135   
01136   double coords2[16]={
01137     -0.4889087296526012, 0.3889087296526012, -0.5889087296526012, 0.3889087296526012, -0.1889087296526012, 0.3889087296526012, -0.2889087296526012, 0.3889087296526012,
01138     -0.5389087296526012, 0.3889087296526012, -0.3889087296526012, 0.5889087296526012, -0.2389087296526012, 0.3889087296526012, -0.3889087296526012, 0.4889087296526012 };
01139   
01140   int tab8[8]={
01141     0, 1, 2, 3, 4, 5, 6, 7 };
01142   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01143   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01144   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0471239,pol1->intersectWith(*pol2),1.e-7);
01145   delete pol1;
01146   delete pol2;
01147   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01148   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01149   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0471239,pol2->intersectWith(*pol1),1.e-7);
01150   delete pol1;
01151   delete pol2;
01152   //
01153   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01154   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01155   std::vector<double> val1,val2;
01156   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
01157   double test1_res[4]={0.,0.,0.,0.};
01158   double test2_res[4]={0.1,0.628319,0.1,0.314159};
01159   CPPUNIT_ASSERT(std::equal(val1.begin(),val1.end(),test1_res,DoubleEqual(1e-6)));
01160   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
01161   delete pol1;
01162   delete pol2;
01163   std::vector<int> val3;
01164   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
01165   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
01166   pol1->intersectForPoint(*pol2,val3);
01167   int test3_res[4]={0,1,0,0};
01168   CPPUNIT_ASSERT(std::equal(val3.begin(),val3.end(),test3_res));
01169   delete pol1;
01170   delete pol2;
01171 }
01172 
01173 }