-// 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 "EdgeArcCircle.hxx"
-#include "EdgeLin.hxx"
+#include "InterpKernelGeo2DQuadraticPolygon.hxx"
+#include "InterpKernelGeo2DEdgeArcCircle.hxx"
+#include "InterpKernelGeo2DEdgeLin.hxx"
#include <cmath>
#include <sstream>
#include <iostream>
-using namespace std;
using namespace INTERP_KERNEL;
+namespace INTERP_TEST
+{
+
static const double ADMISSIBLE_ERROR = 1.e-14;
void QuadraticPlanarInterpTest::IntersectArcCircleBase()
// ArcCArcCIntersector
//
TypeOfLocInEdge where1,where2;
- vector<Node *> v4;
+ std::vector<Node *> v4;
MergePoints v3;
EdgeArcCircle *e2;
ArcCArcCIntersector *intersector=0;
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),0.35587863972199624,1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),0.35587863972199624,1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),0.6793851523346941,1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),0.6793851523346941,1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.1195732971845034,btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.1195732971845034,btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(-3.0844420190512074,btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(-3.0844420190512074,btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v4.clear();
delete intersector; e2->decrRef(); e1->decrRef();
bool obvious,areOverlapped;
intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- vector<Node *> v4;
+ std::vector<Node *> v4;
MergePoints v3;
CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[0])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(4.3,(*v4[0])[1],1e-10);
QuadraticPolygon *QuadraticPlanarInterpTest::buildQuadraticPolygonCoarseInfo(const double *coords, const int *conn, int lgth)
{
- vector<INTERP_KERNEL::Node *> nodes;
+ std::vector<INTERP_KERNEL::Node *> nodes;
for(int i=0;i<lgth;i++)
nodes.push_back(new INTERP_KERNEL::Node(coords[2*conn[i]],coords[2*conn[i]+1]));
- return INTERP_KERNEL::QuadraticPolygon::buildArcCirclePolygon(nodes);
+ return INTERP_KERNEL::QuadraticPolygon::BuildArcCirclePolygon(nodes);
}
EdgeArcCircle *QuadraticPlanarInterpTest::buildArcOfCircle(const double *center, double radius, double alphaStart, double alphaEnd)
ret=-ret;
return ret;
}
+
+}