Salome HOME
Merge from V6_main 01/04/2013
[tools/medcoupling.git] / src / INTERP_KERNELTest / QuadraticPlanarInterpTest5.cxx
index 88b70d2e0feafd919fb5da44bed36da7132bab1d..23210afa5032e604331621515bd5aabac3d49421 100644 (file)
@@ -1,35 +1,39 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013  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
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// 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.
 //
-//  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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// Author : Anthony Geay (CEA/DEN)
+
 #include "QuadraticPlanarInterpTest.hxx"
-#include "QuadraticPolygon.hxx"
-#include "ElementaryEdge.hxx"
-#include "EdgeArcCircle.hxx"
-#include "EdgeLin.hxx"
+#include "InterpKernelGeo2DQuadraticPolygon.hxx"
+#include "InterpKernelGeo2DElementaryEdge.hxx"
+#include "InterpKernelGeo2DEdgeArcCircle.hxx"
+#include "InterpKernelGeo2DEdgeLin.hxx"
 
 #include <cmath>
 #include <sstream>
 #include <iostream>
 #include <iterator>
 
-using namespace std;
 using namespace INTERP_KERNEL;
 
+namespace INTERP_TEST
+{
+
 class DoubleEqual
 {
 public:
@@ -211,7 +215,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0006()
     0, 1, 2, 3, 4, 5, 6, 7 };
   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.366519,0.,0.};
   double test2_res[4]={0.,0.,0.,0.366519};
@@ -237,7 +241,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0007()
     0, 1, 2, 3, 4, 5, 6, 7 };
   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.366519,0.,0.};
   double test2_res[4]={0.,0.,0.,0.366519};
@@ -263,7 +267,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0008()
     0, 1, 2, 3, 4, 5, 6, 7 };
   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.18326,0.,0.};
   double test2_res[4]={0.,0.,0.,0.18326};
@@ -344,7 +348,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0011()
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val1,1.e-13);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val2,1.e-13);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val3,1.e-13);
-  vector<double> val4,val5;
+  std::vector<double> val4,val5;
   pol1->intersectForPerimeterAdvanced(*pol2,val4,val5);
   double test1_res[4]={0.,0.,0.,0.};
   CPPUNIT_ASSERT(std::equal(val4.begin(),val4.end(),test1_res,DoubleEqual(1e-13)));
@@ -388,7 +392,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar2511()
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val1,1.e-13);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val2,1.e-13);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val3,1.e-13);
-  vector<double> val4,val5;
+  std::vector<double> val4,val5;
   pol1->intersectForPerimeterAdvanced(*pol2,val4,val5);
   double test1_res[4]={0.,0.,0.,0.};
   CPPUNIT_ASSERT(std::equal(val4.begin(),val4.end(),test1_res,DoubleEqual(1e-13)));
@@ -426,7 +430,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0012()
     0, 1, 2, 3, 4, 5, 6, 7 };
   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.05,0.};
   double test2_res[4]={0.,0.,0.05,0.};
@@ -434,7 +438,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0012()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -460,7 +464,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0013()
     0, 1, 2, 3, 4, 5, 6, 7 };
   QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.1,0.};
   double test2_res[4]={0.,0.,0.1,0.};
@@ -468,7 +472,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0013()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -504,7 +508,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0014()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.15,0.};
   double test2_res[4]={0.05,0.,0.1,0.};
@@ -512,7 +516,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0014()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -548,7 +552,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0015()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.2,0.};
   double test2_res[4]={0.1,0.,0.1,0.};
@@ -556,7 +560,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0015()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -592,7 +596,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0016()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.15,0.};
   double test2_res[4]={0.1,0.,0.05,0.};
@@ -600,7 +604,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0016()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -637,7 +641,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0017()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.1,0.};
   double test2_res[4]={0.1,0.,0.,0.};
@@ -645,7 +649,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0017()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -682,7 +686,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0018()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.05,0.};
   double test2_res[4]={0.05,0.,0.,0.};
@@ -690,7 +694,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0018()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -753,7 +757,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0020()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.,0.};
   double test2_res[4]={0.,0.,0.,0.};
@@ -761,7 +765,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0020()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -798,7 +802,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0021()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.162251,0.151523,0.,0.};
   double test2_res[4]={0.,0.311383,0.,0.0978193};
@@ -806,7 +810,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0021()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -942,7 +946,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0025()
   delete pol1;
   delete pol2;
   //
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -977,7 +981,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0026()
   delete pol1;
   delete pol2;
   //
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -1014,7 +1018,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0027()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.222704,0.,0.};
   double test2_res[4]={0.1,0.0465335,0.1,0.092554};
@@ -1022,7 +1026,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0027()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -1059,7 +1063,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0028()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.,0.};
   double test2_res[4]={0.1,0.628319,0.1,0.314159};
@@ -1067,7 +1071,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0028()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -1104,7 +1108,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0029()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.,0.};
   double test2_res[4]={0.,0.,0.,0.};
@@ -1112,7 +1116,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0029()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -1149,7 +1153,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0030()
   //
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
-  vector<double> val1,val2;
+  std::vector<double> val1,val2;
   pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
   double test1_res[4]={0.,0.,0.,0.};
   double test2_res[4]={0.1,0.628319,0.1,0.314159};
@@ -1157,7 +1161,7 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0030()
   CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
   delete pol1;
   delete pol2;
-  vector<int> val3;
+  std::vector<int> val3;
   pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
   pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
   pol1->intersectForPoint(*pol2,val3);
@@ -1166,3 +1170,5 @@ void QuadraticPlanarInterpTest::checkNonRegressionOmar0030()
   delete pol1;
   delete pol2;
 }
+
+}