QuadraticPolygon pol1; pol1.pushBack(e1_2); pol1.pushBack(e2_3); pol1.pushBack(e3_1);
QuadraticPolygon pol2; pol2.pushBack(e4_5); pol2.pushBack(e5_6); pol2.pushBack(e6_4);
QuadraticPolygon cpyPol1(pol1); int nbOfSplits=0;
- cpyPol1.splitPolygonsEachOther(pol1,pol2,nbOfSplits);
+ cpyPol1.SplitPolygonsEachOther(pol1,pol2,nbOfSplits);
CPPUNIT_ASSERT_EQUAL(5,pol1.recursiveSize());
CPPUNIT_ASSERT_EQUAL(5,pol2.recursiveSize());CPPUNIT_ASSERT_EQUAL(15,nbOfSplits);
checkBasicsOfPolygons(pol1,pol2,true);
QuadraticPolygon pol3; pol3.pushBack(e1_2); pol3.pushBack(e2_3); pol3.pushBack(e3_1);
QuadraticPolygon pol4; pol4.pushBack(e5_4); pol4.pushBack(e4_7); pol4.pushBack(e7_6); pol4.pushBack(e6_5);
QuadraticPolygon cpyPol3(pol3); nbOfSplits=0;
- cpyPol3.splitPolygonsEachOther(pol3,pol4,nbOfSplits);
+ cpyPol3.SplitPolygonsEachOther(pol3,pol4,nbOfSplits);
CPPUNIT_ASSERT_EQUAL(5,pol3.recursiveSize());
CPPUNIT_ASSERT_EQUAL(4,pol4.recursiveSize());CPPUNIT_ASSERT_EQUAL(16,nbOfSplits);
checkBasicsOfPolygons(pol3,pol4,true);
QuadraticPolygon pol5; pol5.pushBack(e1_2); pol5.pushBack(e2_3); pol5.pushBack(e3_1);
QuadraticPolygon pol6; pol6.pushBack(e4_5); pol6.pushBack(e5_6); pol6.pushBack(e6_4);
QuadraticPolygon cpyPol5(pol5); nbOfSplits=0;
- cpyPol5.splitPolygonsEachOther(pol5,pol6,nbOfSplits);
+ cpyPol5.SplitPolygonsEachOther(pol5,pol6,nbOfSplits);
CPPUNIT_ASSERT_EQUAL(4,pol5.recursiveSize());
CPPUNIT_ASSERT_EQUAL(4,pol6.recursiveSize()); CPPUNIT_ASSERT_EQUAL(13,nbOfSplits);
checkBasicsOfPolygons(pol5,pol6,false);
QuadraticPolygon pol7; pol7.pushBack(e1_2); pol7.pushBack(e2_3); pol7.pushBack(e3_1);
QuadraticPolygon pol8; pol8.pushBack(e4_5); pol8.pushBack(e5_6); pol8.pushBack(e6_4);
QuadraticPolygon cpyPol7(pol7); nbOfSplits=0;
- cpyPol7.splitPolygonsEachOther(pol7,pol8,nbOfSplits);
+ cpyPol7.SplitPolygonsEachOther(pol7,pol8,nbOfSplits);
tmp=dynamic_cast<ElementaryEdge *>(pol8[0]); CPPUNIT_ASSERT(tmp); CPPUNIT_ASSERT(tmp->getPtr()==e1_2);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_ON_1);
tmp=dynamic_cast<ElementaryEdge *>(pol8[1]); CPPUNIT_ASSERT(tmp); CPPUNIT_ASSERT(tmp->getPtr()==e2_3);
nodes.push_back(new Node(coords+6));
nodes.push_back(new Node(coords+8));
nodes.push_back(new Node(coords+10));
- QuadraticPolygon *pol=QuadraticPolygon::buildArcCirclePolygon(nodes);
+ QuadraticPolygon *pol=QuadraticPolygon::BuildArcCirclePolygon(nodes);
CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.04719755,pol->getArea(),1e-5);
CPPUNIT_ASSERT_EQUAL(3,pol->size());
ElementaryEdge *e0=dynamic_cast<ElementaryEdge *>((*pol)[0]);
nodes.push_back(new Node(coords+10));
nodes.push_back(new Node(coords+8));
nodes.push_back(new Node(coords+6));
- pol=QuadraticPolygon::buildArcCirclePolygon(nodes);
+ pol=QuadraticPolygon::BuildArcCirclePolygon(nodes);
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.04719755,pol->getArea(),1e-5);
CPPUNIT_ASSERT_EQUAL(3,pol->size());
e0=dynamic_cast<ElementaryEdge *>((*pol)[0]);
nodes.push_back(new Node(coords2+2));
nodes.push_back(new Node(coords2+4));
nodes.push_back(new Node(coords2+6));
- pol=QuadraticPolygon::buildLinearPolygon(nodes);
+ pol=QuadraticPolygon::BuildLinearPolygon(nodes);
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.5,pol->getArea(),1e-12);
double tmp[2],tmp2;
pol->getBarycenter(tmp,tmp2);
nodes.push_back(new Node(coords3+10));
nodes.push_back(new Node(coords3+12));
nodes.push_back(new Node(coords3+14));
- pol=QuadraticPolygon::buildArcCirclePolygon(nodes);
+ pol=QuadraticPolygon::BuildArcCirclePolygon(nodes);
pol->getBarycenter(tmp,tmp2);
delete pol;
QUADRATIC_PLANAR::setPrecision(1e-14);
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00173945,v[0]->getArea(),1e-7);
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00164773941455998,v[0]->getArea(),1e-7);
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(0,(int)v.size());
//CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00164773941455998,v[0]->getArea(),1e-7);
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(v[0]->getArea(),0.0150659,1e-7);
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.121795,v[0]->getArea(),1.e-6);
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.598232,v[0]->getArea(),1.e-6);
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(0,(int)v.size());
delete pol1;
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.28973e-06,v[0]->getArea(),1.e-11);
nodes1.push_back(new Node(coords1+10));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
- QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
+ QuadraticPolygon *pol1=QuadraticPolygon::BuildArcCirclePolygon(nodes1);
std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+10));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
- QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
+ QuadraticPolygon *pol2=QuadraticPolygon::BuildArcCirclePolygon(nodes2);
std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,v[0]->getArea(),1.e-6);