-// 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:
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};
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};
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};
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)));
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)));
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.};
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);
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.};
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);
//
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.};
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);
//
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.};
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);
//
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.};
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);
//
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.};
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);
//
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.};
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);
//
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.};
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);
//
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};
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);
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);
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);
//
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};
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);
//
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};
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);
//
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.};
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);
//
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};
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);
delete pol1;
delete pol2;
}
+
+}