void QuadraticPlanarInterpTest::checkAssemblingBases2()
{
//The "most" basic test1
- /*Node *n1=new Node(0.,0.); Node *n4=new Node(0.,-0.3);
+ Node *n1=new Node(0.,0.); Node *n4=new Node(0.,-0.3);
Node *n2=new Node(1.,0.); Node *n5=new Node(1.,-0.3);
Node *n3=new Node(0.5,1.); Node *n6=new Node(0.5,0.7);
EdgeLin *e1_2=new EdgeLin(n1,n2); EdgeLin *e4_5=new EdgeLin(n4,n5);
CPPUNIT_ASSERT_EQUAL(5,pol1.recursiveSize());
CPPUNIT_ASSERT_EQUAL(5,pol2.recursiveSize());CPPUNIT_ASSERT_EQUAL(15,nbOfSplits);
checkBasicsOfPolygons(pol1,pol2,true);
- CPPUNIT_ASSERT((*pol2[1])[0]->getEndNode()==(*(*pol1[0])[0])[1]->getEndNode());
- CPPUNIT_ASSERT((*pol2[1])[0]->getEndNode()->getLoc()==ON_1);
- CPPUNIT_ASSERT((*pol2[2])[0]->getEndNode()==(*(*pol1[0])[0])[0]->getEndNode());
- CPPUNIT_ASSERT((*pol2[2])[0]->getEndNode()->getLoc()==ON_1);
+ CPPUNIT_ASSERT(pol2[1]->getEndNode()==pol1[1]->getEndNode());
+ CPPUNIT_ASSERT(pol2[1]->getEndNode()->getLoc()==ON_1);
+ CPPUNIT_ASSERT(pol2[3]->getEndNode()==pol1[0]->getEndNode());
+ CPPUNIT_ASSERT(pol2[3]->getEndNode()->getLoc()==ON_1);
cpyPol1.performLocatingOperation(pol2);
ElementaryEdge *tmp=dynamic_cast<ElementaryEdge *>(pol2[0]); CPPUNIT_ASSERT(tmp); CPPUNIT_ASSERT(tmp->getPtr()==e4_5);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_OUT_1);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_OUT_1);
- tmp=dynamic_cast<ElementaryEdge *>((*pol2[1])[0]); CPPUNIT_ASSERT(tmp);
+ tmp=dynamic_cast<ElementaryEdge *>(pol2[1]); CPPUNIT_ASSERT(tmp);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_OUT_1);
- tmp=dynamic_cast<ElementaryEdge *>((*pol2[1])[1]); CPPUNIT_ASSERT(tmp);
+ tmp=dynamic_cast<ElementaryEdge *>(pol2[2]); CPPUNIT_ASSERT(tmp);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_IN_1);
- tmp=dynamic_cast<ElementaryEdge *>((*pol2[2])[0]); CPPUNIT_ASSERT(tmp);
+ tmp=dynamic_cast<ElementaryEdge *>(pol2[3]); CPPUNIT_ASSERT(tmp);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_IN_1);
- tmp=dynamic_cast<ElementaryEdge *>((*pol2[2])[1]); CPPUNIT_ASSERT(tmp);
+ tmp=dynamic_cast<ElementaryEdge *>(pol2[4]); CPPUNIT_ASSERT(tmp);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_OUT_1);
//clean-up for test1
e1_2->decrRef(); e2_3->decrRef(); e3_1->decrRef(); e4_5->decrRef(); e5_6->decrRef(); e6_4->decrRef();
CPPUNIT_ASSERT_EQUAL(5,pol3.recursiveSize());
CPPUNIT_ASSERT_EQUAL(4,pol4.recursiveSize());CPPUNIT_ASSERT_EQUAL(16,nbOfSplits);
checkBasicsOfPolygons(pol3,pol4,true);
- CPPUNIT_ASSERT(pol4[0]->getStartNode()==(*pol3[0])[0]->getEndNode()); CPPUNIT_ASSERT(pol4[0]->getStartNode()==n5);
+ CPPUNIT_ASSERT(pol4[0]->getStartNode()==pol3[0]->getEndNode()); CPPUNIT_ASSERT(pol4[0]->getStartNode()==n5);
CPPUNIT_ASSERT(n5->getLoc()==ON_LIM_1);
- CPPUNIT_ASSERT(pol4[2]->getEndNode()==(*pol3[1])[0]->getEndNode()); CPPUNIT_ASSERT(pol4[2]->getEndNode()==n6);
+ CPPUNIT_ASSERT(pol4[2]->getEndNode()==pol3[2]->getEndNode()); CPPUNIT_ASSERT(pol4[2]->getEndNode()==n6);
CPPUNIT_ASSERT(n6->getLoc()==ON_LIM_1);
cpyPol3.performLocatingOperation(pol4);
tmp=dynamic_cast<ElementaryEdge *>(pol4[1]); CPPUNIT_ASSERT(tmp); CPPUNIT_ASSERT(tmp->getPtr()==e4_7);
CPPUNIT_ASSERT_EQUAL(4,pol5.recursiveSize());
CPPUNIT_ASSERT_EQUAL(4,pol6.recursiveSize()); CPPUNIT_ASSERT_EQUAL(13,nbOfSplits);
checkBasicsOfPolygons(pol5,pol6,false);
- CPPUNIT_ASSERT((*pol6[2])[0]->getStartNode()==(*pol5[0])[0]->getEndNode()); CPPUNIT_ASSERT((*pol6[2])[0]->getStartNode()==n6);
+ CPPUNIT_ASSERT(pol6[2]->getStartNode()==pol5[0]->getEndNode()); CPPUNIT_ASSERT(pol6[2]->getStartNode()==n6);
CPPUNIT_ASSERT(n6->getLoc()==ON_LIM_1);
- CPPUNIT_ASSERT((*pol6[2])[0]->getEndNode()==(*pol5[0])[0]->getStartNode()); CPPUNIT_ASSERT((*pol5[0])[0]->getStartNode()==n1);
+ CPPUNIT_ASSERT(pol6[2]->getEndNode()==pol5[0]->getStartNode()); CPPUNIT_ASSERT(pol5[0]->getStartNode()==n1);
CPPUNIT_ASSERT(n1->getLoc()==ON_LIM_1);
cpyPol5.performLocatingOperation(pol6);
tmp=dynamic_cast<ElementaryEdge *>(pol6[0]); CPPUNIT_ASSERT(tmp); CPPUNIT_ASSERT(tmp->getPtr()==e4_5);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_OUT_1);
tmp=dynamic_cast<ElementaryEdge *>(pol6[1]); CPPUNIT_ASSERT(tmp); CPPUNIT_ASSERT(tmp->getPtr()==e5_6);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_OUT_1);
- tmp=dynamic_cast<ElementaryEdge *>((*pol6[2])[0]); CPPUNIT_ASSERT(tmp);
+ tmp=dynamic_cast<ElementaryEdge *>(pol6[2]); CPPUNIT_ASSERT(tmp);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_ON_1);
- tmp=dynamic_cast<ElementaryEdge *>((*pol6[2])[1]); CPPUNIT_ASSERT(tmp);
+ tmp=dynamic_cast<ElementaryEdge *>(pol6[3]); CPPUNIT_ASSERT(tmp);
CPPUNIT_ASSERT(tmp->getLoc()==FULL_OUT_1);
//clean-up test3
e1_2->decrRef(); e2_3->decrRef(); e3_1->decrRef(); e4_5->decrRef(); e5_6->decrRef(); e6_4->decrRef();
CPPUNIT_ASSERT(tmp->getLoc()==FULL_ON_1);
//clean-up test4
e1_2->decrRef(); e2_3->decrRef(); e3_1->decrRef(); e4_5->decrRef(); e5_6->decrRef(); e6_4->decrRef();
- n1->decrRef(); n2->decrRef(); n3->decrRef(); n4->decrRef(); n5->decrRef(); n6->decrRef();*/
+ n1->decrRef(); n2->decrRef(); n3->decrRef(); n4->decrRef(); n5->decrRef(); n6->decrRef();
}
void QuadraticPlanarInterpTest::checkBasicsOfPolygons(QuadraticPolygon& pol1, QuadraticPolygon& pol2, bool checkDirection)