-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016 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, or (at your option) any later version.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// 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:
void QuadraticPlanarInterpTest::checkNonRegressionOmar0000()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.383022221559489, 0.3213938048432697, -0.5745333323392334, 0.4820907072649046, 0.5745333323392335, 0.4820907072649044, 0.383022221559489, 0.3213938048432696,
-0.4787777769493612, 0.4017422560540872, 4.592273826833915e-17, 0.75, 0.4787777769493612, 0.401742256054087, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0001()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.383022221559489, 0.3213938048432697, -0.5745333323392334, 0.4820907072649046, 0.5745333323392335, 0.4820907072649044, 0.383022221559489, 0.3213938048432696,
-0.4787777769493612, 0.4017422560540872, 4.592273826833915e-17, 0.75, 0.4787777769493612, 0.401742256054087, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0002()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.383022221559489, 0.3213938048432697, -0.5745333323392334, 0.4820907072649046, 0.5745333323392335, 0.4820907072649044, 0.383022221559489, 0.3213938048432696,
-0.4787777769493612, 0.4017422560540872, 4.592273826833915e-17, 0.75, 0.4787777769493612, 0.401742256054087, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0003()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.3535533905932737, 0.3535533905932738, -0.5303300858899106, 0.5303300858899107, 0.5303300858899107, 0.5303300858899106, 0.3535533905932738, 0.3535533905932737,
-0.4419417382415922, 0.4419417382415922, 4.592273826833915e-17, 0.75, 0.4419417382415922, 0.4419417382415922, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0004()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.4596194077712559, 0.4596194077712559, -0.5303300858899106, 0.5303300858899107, 0.5303300858899107, 0.5303300858899106, 0.4596194077712559, 0.4596194077712559,
-0.4949747468305832, 0.4949747468305833, 4.592273826833915e-17, 0.75, 0.4949747468305833, 0.4949747468305832, 3.979970649922726e-17, 0.65 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0005()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.383022221559489, 0.3213938048432697, -0.6128355544951823, 0.5142300877492316, 0.6128355544951825, 0.5142300877492314, 0.383022221559489, 0.3213938048432696,
-0.4979288880273356, 0.4178119462962507, 4.898425415289509e-17, 0.8, 0.4979288880273357, 0.4178119462962505, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0006()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.383022221559489, 0.3213938048432697, -0.5362311101832845, 0.4499513267805776, 0.5362311101832846, 0.4499513267805774, 0.383022221559489, 0.3213938048432696,
-0.4596266658713867, 0.3856725658119237, 4.28612223837832e-17, 0.7, 0.4596266658713868, 0.3856725658119236, 3.061515884555943e-17, 0.5 };
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};
void QuadraticPlanarInterpTest::checkNonRegressionOmar0007()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.383022221559489, 0.3213938048432697, -0.5362311101832845, 0.4499513267805776, 0.5362311101832846, 0.4499513267805774, 0.383022221559489, 0.3213938048432696,
-0.4596266658713867, 0.3856725658119237, 4.28612223837832e-17, 0.7, 0.4596266658713868, 0.3856725658119236, 3.061515884555943e-17, 0.5 };
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};
void QuadraticPlanarInterpTest::checkNonRegressionOmar0008()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.383022221559489, 0.3213938048432697, -0.5362311101832845, 0.4499513267805776, 0.5362311101832846, 0.4499513267805774, 0.383022221559489, 0.3213938048432696,
-0.4596266658713867, 0.3856725658119237, 4.28612223837832e-17, 0.7, 0.4596266658713868, 0.3856725658119236, 3.061515884555943e-17, 0.5 };
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};
void QuadraticPlanarInterpTest::checkNonRegressionOmar0009()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.3863703305156274, -0.1035276180410081, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512604, 0.3863703305156274, -0.1035276180410083,
-0.4346666218300808, -0.1164685702961342, 1.416374613080751e-16, 0.5, 0.4346666218300808, -0.1164685702961343, 1.133099690464601e-16, 0.4 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0010()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.3863703305156274, -0.1035276180410081, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512604, 0.3863703305156274, -0.1035276180410083,
-0.4346666218300808, -0.1164685702961342, 1.416374613080751e-16, 0.5, 0.4346666218300808, -0.1164685702961343, 1.133099690464601e-16, 0.4 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0011()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.3863703305156274, -0.1035276180410081, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512604, 0.3863703305156274, -0.1035276180410083,
-0.4346666218300808, -0.1164685702961342, 1.416374613080751e-16, 0.5, 0.4346666218300808, -0.1164685702961343, 1.133099690464601e-16, 0.4 };
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)));
void QuadraticPlanarInterpTest::checkNonRegressionOmar2511()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.3863703305156274, -0.1035276180410081, -0.4829629131445342, -0.1294095225512602, 0.4829629131445342, -0.1294095225512604, 0.3863703305156274, -0.1035276180410083,
-0.4346666218300808, -0.1164685702961342, 1.416374613080751e-16, 0.5, 0.4346666218300808, -0.1164685702961343, 1.133099690464601e-16, 0.4, };
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)));
void QuadraticPlanarInterpTest::checkNonRegressionOmar0012()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
-1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0013()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
-1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0014()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
-1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0015()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
-1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0016()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
-1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0017()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
-1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0018()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-1, 1.224606353822377e-16, -1.6, 1.959370166115804e-16, 9.796850830579018e-17, 1.6, 6.123031769111886e-17, 1,
-1.3, 1.591988259969091e-16, -1.131370849898476, 1.131370849898476, 7.959941299845453e-17, 1.3, -0.7071067811865475, 0.7071067811865476 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0019()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
-0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0020()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
-0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0021()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
-0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
//
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);
}
void QuadraticPlanarInterpTest::checkNonRegressionOmar0022()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
-0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0023()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
-0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5, };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0024()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
-0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar2524()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
-0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
void QuadraticPlanarInterpTest::checkNonRegressionOmar0025()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.5, 6.123031769111886e-17, -0.8, 9.796850830579018e-17, 0.8, 0, 0.5, 0,
-0.65, 7.959941299845453e-17, 4.898425415289509e-17, 0.8, 0.65, 0, 3.061515884555943e-17, 0.5 };
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0026()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
-0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0027()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
-0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0028()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
-0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0029()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
-0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
//
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);
void QuadraticPlanarInterpTest::checkNonRegressionOmar0030()
{
- INTERP_KERNEL::QUADRATIC_PLANAR::setPrecision(1e-7);
- INTERP_KERNEL::QUADRATIC_PLANAR::setArcDetectionPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarPrecision::setPrecision(1e-7);
+ INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision::setArcDetectionPrecision(1e-7);
double coords[16]={
-0.4, 4.898425415289509e-17, -0.75, 9.184547653667829e-17, 0.75, 0, 0.4, 0,
-0.575, 7.041486534478669e-17, 4.592273826833915e-17, 0.75, 0.575, 0, 2.449212707644755e-17, 0.4 };
//
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;
}
+
+void QuadraticPlanarInterpTest::checkIsInOrOut()
+{
+ double coords[8]={ 0.30662641093707971, -0.47819928619088981,
+ -0.47819928619088964, 0.30662641093707987,
+ 0.0, 0.0,
+ 0.4, 0.4
+ };
+ coords[4] = (coords[0] + coords[2]) / 2.0;
+ coords[5] = (coords[1] + coords[3]) / 2.0;
+
+ int tab4[4]={ 0, 1, 2, 3};
+ QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab4,4);
+ Node * n = new Node(0.3175267678416348, -0.4890996430954449);
+
+ CPPUNIT_ASSERT(! pol1->isInOrOut(n)); // node should be out
+ n->decrRef();
+ delete pol1;
+}
+
+void QuadraticPlanarInterpTest::checkGetMiddleOfPoints()
+{
+ { // from testIntersect2DMeshWith1DLine6()
+ double p1[] = {0.51641754716735844, 2.0};
+ double p2[] = {0.0, 1.0};
+ double e_center[] = {-0.71, 2.0};
+ double mid[] = {0.0,0.0}; // out
+ double mide[] = {0.0,0.0}; // expected
+
+ Node * start = new Node(0.,0.); Node * end = new Node(0.,0.); // unused
+ // start, end, center_x, center_y, radius, angle0, angle
+ EdgeArcCircle e(start, end, e_center, 1.2264175471673588, -0.9533904350433241, 0.95339043504332388);
+
+ e.getMiddleOfPoints(p1, p2, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.37969180470645592, mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.4372640310451197, mid[1], 1.e-7);
+
+ e.getMiddleOfPoints(p2, p1, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.37969180470645592, mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.4372640310451197, mid[1], 1.e-7);
+
+ start->decrRef(); end->decrRef();
+ }
+ { // from testSwig2Intersect2DMeshWith1DLine11()
+ double p1[] = {-1., 0.23453685964236054};
+ double p2[] = {-0.23453685964235979, 1.0};
+ double e_center[] = {-4.85, 4.85};
+ double mid[] = {0.0,0.0}; // out
+
+ Node * start = new Node(0.,0.); Node * end = new Node(0.,0.); // unused
+ // start, end, center_x, center_y, radius, angle0, angle
+ EdgeArcCircle e(start, end, e_center, 6.0104076400856474, -0.69522150912422953, -0.18035330854643861);
+
+ e.getMiddleOfPoints(p1, p2, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.6, mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.6, mid[1], 1.e-7);
+
+ e.getMiddleOfPoints(p2, p1, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.6, mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.6, mid[1], 1.e-7);
+
+ start->decrRef(); end->decrRef();
+ }
+ { // from testSwig2Intersect2DMeshWith1DLine11()
+ double p1[] = {-0.1303327636866019, -1.0};
+ double p2[] = {-1.0, -0.1303327636866019};
+ double e_center[] = {-1.9833333333333298, -1.9833333333333298};
+ double mid[] = {0.0,0.0}; // out
+
+ Node * start = new Node(0.,0.); Node * end = new Node(0.,0.); // unused
+ // start, end, center_x, center_y, radius, angle0, angle
+ EdgeArcCircle e(start, end, e_center, 2.0977501175200861, 1.0829141821052615, -0.59503203741562627);
+
+ e.getMiddleOfPoints(p1, p2, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.5, mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.5, mid[1], 1.e-7);
+
+ e.getMiddleOfPoints(p2, p1, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.5, mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.5, mid[1], 1.e-7);
+
+ start->decrRef(); end->decrRef();
+ }
+}
+
+void QuadraticPlanarInterpTest::checkGetMiddleOfPointsOriented()
+{
+ { // from testSwig2Colinearize2D3()
+ double p1[] = {-0.70710678118654746, 0.70710678118654757};
+ double p2[] = {-0.70710678118654768, -0.70710678118654746};
+ double e_center[] = {0., 0.};
+ double mid[] = {0.0,0.0}; // out
+
+ Node * start = new Node(0.,0.); Node * end = new Node(0.,0.); // unused
+ // start, end, center_x, center_y, radius, angle0, angle
+ EdgeArcCircle e(start, end, e_center, 1.0, -0.7853981633974485, -1.5707963267948966);
+
+ e.getMiddleOfPointsOriented(p1, p2, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1., mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0., mid[1], 1.e-7);
+
+ e.getMiddleOfPoints(p1, p2, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-1., mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0., mid[1], 1.e-7);
+
+ e.getMiddleOfPointsOriented(p2, p1, mid);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-1., mid[0], 1.e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0., mid[1], 1.e-7);
+
+ start->decrRef(); end->decrRef();
+ }
+}
+
+}