From 7b67a2a49d5d30db3bb15f56b7350d8038ec44e4 Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 17 Jan 2019 17:13:42 +0100 Subject: [PATCH] Some cleanup : removing unused param --- .../InterpKernelGeo2DComposedEdge.cxx | 2 +- .../Geometric2D/InterpKernelGeo2DEdge.cxx | 14 ++-- .../Geometric2D/InterpKernelGeo2DEdge.hxx | 6 +- .../InterpKernelGeo2DEdgeArcCircle.cxx | 4 +- .../InterpKernelGeo2DEdgeArcCircle.hxx | 4 +- .../Geometric2D/InterpKernelGeo2DEdgeLin.cxx | 2 +- .../Geometric2D/InterpKernelGeo2DEdgeLin.hxx | 2 +- .../QuadraticPlanarInterpTest2.cxx | 74 +++++++++---------- 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx index 3d0f0a468..b5bc84f39 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx @@ -599,7 +599,7 @@ double ComposedEdge::isInOrOutAlg(Node *nodeToTest, const std::set& nodes Edge *e=val->getPtr(); std::auto_ptr intersc(Edge::BuildIntersectorWith(e1,e)); bool obviousNoIntersection,areOverlapped; - intersc->areOverlappedOrOnlyColinears(0,obviousNoIntersection,areOverlapped); // first parameter never used + intersc->areOverlappedOrOnlyColinears(obviousNoIntersection,areOverlapped); if(obviousNoIntersection) { continue; diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx index 08103e39e..3fa1eae4f 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx @@ -340,7 +340,7 @@ bool IntersectElement::isIncludedByBoth() const return _e1.isIn(_chararct_val_for_e1) && _e2.isIn(_chararct_val_for_e2); } -bool EdgeIntersector::intersect(const Bounds *whereToFind, std::vector& newNodes, bool& order, MergePoints& commonNode) +bool EdgeIntersector::intersect(std::vector& newNodes, bool& order, MergePoints& commonNode) { std::list< IntersectElement > listOfIntesc=getIntersectionsCharacteristicVal(); std::list< IntersectElement >::iterator iter; @@ -631,7 +631,7 @@ bool Edge::intersectWith(const Edge *other, MergePoints& commonNode, delete merge; merge=0; EdgeIntersector *intersector=BuildIntersectorWith(this,other); - ret=Intersect(this,other,intersector,merge,commonNode,outVal1,outVal2); + ret=Intersect(this,other,intersector,commonNode,outVal1,outVal2); delete intersector; return ret; } @@ -674,7 +674,7 @@ void Edge::Interpolate1DLin(const std::vector& distrib1, const std::vect ComposedEdge *f2=new ComposedEdge; SegSegIntersector inters(*e1,*e2); bool b1,b2; - inters.areOverlappedOrOnlyColinears(0,b1,b2); + inters.areOverlappedOrOnlyColinears(b1,b2); if(IntersectOverlapped(e1,e2,&inters,commonNode,*f1,*f2)) { result[i][j]=f1->getCommonLengthWith(*f2)/e1->getCurveLength(); @@ -734,19 +734,19 @@ void Edge::getMiddleOfPointsOriented(const double *p1, const double *p2, double return getMiddleOfPoints(p1, p2, mid); } -bool Edge::Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, const Bounds *whereToFind, MergePoints& commonNode, +bool Edge::Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, MergePoints& commonNode, ComposedEdge& outValForF1, ComposedEdge& outValForF2) { bool obviousNoIntersection; bool areOverlapped; - intersector->areOverlappedOrOnlyColinears(whereToFind,obviousNoIntersection,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obviousNoIntersection,areOverlapped); if(areOverlapped) return IntersectOverlapped(f1,f2,intersector,commonNode,outValForF1,outValForF2); if(obviousNoIntersection) return false; std::vector newNodes; bool order; - if(intersector->intersect(whereToFind,newNodes,order,commonNode)) + if(intersector->intersect(newNodes,order,commonNode)) { if(newNodes.empty()) throw Exception("Internal error occurred - error in intersector implementation!");// This case should never happen @@ -771,7 +771,7 @@ bool Edge::Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersecto } return true; } - else//no intersection inside whereToFind + else return false; } diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.hxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.hxx index c64267895..bd55fce09 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.hxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.hxx @@ -157,9 +157,9 @@ namespace INTERP_KERNEL //!to call only if 'areOverlapped' have been set to true when areOverlappedOrOnlyColinears was called virtual void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const = 0; //! When true is returned, newNodes should contains at least 1 element. All merging nodes betw _e1 and _e2 extremities must be done. - bool intersect(const Bounds *whereToFind, std::vector& newNodes, bool& order, MergePoints& commonNode); + bool intersect(std::vector& newNodes, bool& order, MergePoints& commonNode); //! Should be called only once per association. - virtual void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped) = 0; + virtual void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped) = 0; //! The size of returned vector is equal to number of potential intersections point. The values are so that their are interpretable by virtual Edge::isIn method. virtual std::list< IntersectElement > getIntersectionsCharacteristicVal() const = 0; protected: @@ -292,7 +292,7 @@ namespace INTERP_KERNEL Edge():_cnt(1),_loc(FULL_UNKNOWN),_start(0),_end(0) { } virtual ~Edge(); static int CombineCodes(TypeOfLocInEdge code1, TypeOfLocInEdge code2); - static bool Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, const Bounds *whereToFind, MergePoints& commonNode, + static bool Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, MergePoints& commonNode, ComposedEdge& outValForF1, ComposedEdge& outValForF2); //! The code 'code' is built by method combineCodes static bool SplitOverlappedEdges(const Edge *e1, const Edge *e2, Node *nS, Node *nE, bool direction, int code, diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx index 39c86ad43..cdf799e01 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx @@ -171,7 +171,7 @@ bool ArcCArcCIntersector::areArcsOverlapped(const EdgeArcCircle& a1, const EdgeA return Node::areDoubleEqualsWPRight(a,1.,2.); } -void ArcCArcCIntersector::areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped) +void ArcCArcCIntersector::areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped) { _dist=Node::distanceBtw2Pt(getE1().getCenter(),getE2().getCenter()); double radius1=getE1().getRadius(); double radius2=getE2().getRadius(); @@ -329,7 +329,7 @@ ArcCSegIntersector::ArcCSegIntersector(const EdgeArcCircle& e1, const EdgeLin& e See http://mathworld.wolfram.com/Circle-LineIntersection.html _cross is 'D', the computation is done with the translation to put back the circle at the origin.s */ -void ArcCSegIntersector::areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped) +void ArcCSegIntersector::areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped) { areOverlapped=false;//No overlapping by construction const double *center=getE1().getCenter(); diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.hxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.hxx index ee5e3bb42..c05e1d95c 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.hxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.hxx @@ -33,7 +33,7 @@ namespace INTERP_KERNEL bool haveTheySameDirection() const; bool areColinears() const; void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const; - void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped); + void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped); std::list< IntersectElement > getIntersectionsCharacteristicVal() const; private: //! return angle in ]-Pi;Pi[ - 'node' must be on curve of '_e1' @@ -57,7 +57,7 @@ namespace INTERP_KERNEL //virtual overloading bool areColinears() const; void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const; - void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped); + void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped); std::list< IntersectElement > getIntersectionsCharacteristicVal() const; private: const EdgeArcCircle& getE1() const { return (const EdgeArcCircle&)_e1; } diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.cxx index 44b99017f..bcd7cab48 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.cxx @@ -128,7 +128,7 @@ bool SegSegIntersector::areColinears() const * \param areOverlapped if colinearity if true, this parameter looks if e1 and e2 are overlapped, i.e. is they lie on the same line (= this is different from * a true intersection, two segments can be in "overlap" mode, without intersecting) */ -void SegSegIntersector::areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped) +void SegSegIntersector::areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped) { double determinant=_matrix[0]*_matrix[3]-_matrix[1]*_matrix[2]; Bounds b1, b2; diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.hxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.hxx index f76ba58f9..01036cf76 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.hxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.hxx @@ -34,7 +34,7 @@ namespace INTERP_KERNEL bool areColinears() const; bool haveTheySameDirection() const; void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const; - void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped); + void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped); std::list< IntersectElement > getIntersectionsCharacteristicVal() const; private: void getCurveAbscisse(Node *node, TypeOfLocInEdge& where, MergePoints& commonNode) const; diff --git a/src/INTERP_KERNELTest/QuadraticPlanarInterpTest2.cxx b/src/INTERP_KERNELTest/QuadraticPlanarInterpTest2.cxx index 320130acb..9280d3b4e 100644 --- a/src/INTERP_KERNELTest/QuadraticPlanarInterpTest2.cxx +++ b/src/INTERP_KERNELTest/QuadraticPlanarInterpTest2.cxx @@ -158,9 +158,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order); CPPUNIT_ASSERT_EQUAL(2,(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); @@ -183,9 +183,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(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); @@ -208,9 +208,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(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); @@ -233,9 +233,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order); CPPUNIT_ASSERT_EQUAL(2,(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); @@ -258,9 +258,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order); CPPUNIT_ASSERT_EQUAL(2,(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); @@ -283,9 +283,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(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); @@ -308,9 +308,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(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); @@ -333,9 +333,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order); CPPUNIT_ASSERT_EQUAL(2,(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); @@ -359,9 +359,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); // order has no sense here because v4.size() expected to 1 but for valgrind serenity test. + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); // order has no sense here because v4.size() expected to 1 but for valgrind serenity test. 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); @@ -381,9 +381,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(!intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT_EQUAL(0,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations()); + CPPUNIT_ASSERT(!intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT_EQUAL(0,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations()); CPPUNIT_ASSERT(e1->getStartNode()==e2->getEndNode()); CPPUNIT_ASSERT(e2->getStartNode()==e1->getEndNode()); v4.clear(); v3.clear(); delete intersector; e2->decrRef(); e1->decrRef(); @@ -397,9 +397,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(!intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT_EQUAL(0,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations()); + CPPUNIT_ASSERT(!intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT_EQUAL(0,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations()); CPPUNIT_ASSERT(e1->getStartNode()==e2->getStartNode()); CPPUNIT_ASSERT(e2->getEndNode()==e1->getEndNode()); v4.clear(); v3.clear(); delete intersector; e2->decrRef(); e1->decrRef(); @@ -414,9 +414,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations()); CPPUNIT_ASSERT(e1->getStartNode()==e2->getStartNode()); CPPUNIT_ASSERT(e1->getEndNode()==v4[0]); v4[0]->decrRef(); @@ -433,9 +433,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - 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(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations()); CPPUNIT_ASSERT(e1->getStartNode()==v4[0]); CPPUNIT_ASSERT(e1->getEndNode()==v4[1]); v4[0]->decrRef(); v4[1]->decrRef(); v4.clear(); v3.clear(); @@ -457,9 +457,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations()); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations()); CPPUNIT_ASSERT(e1->getStartNode()==v4[0]); v4[0]->decrRef(); v4.clear(); v3.clear(); @@ -481,9 +481,9 @@ void QuadraticPlanarInterpTest::IntersectArcCircleBase() intersector=new ArcCArcCIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - 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(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations()); CPPUNIT_ASSERT(e1->getStartNode()==v4[0]); v4[0]->decrRef(); v4[1]->decrRef(); v4.clear(); v3.clear(); @@ -609,33 +609,33 @@ void QuadraticPlanarInterpTest::IntersectArcCircleSegumentBase() EdgeIntersector *intersector=new ArcCSegIntersector(*e1,*e2); bool order; bool obvious,areOverlapped; - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); std::vector 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(intersector->intersect(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); CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.3,(*v4[1])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[1])[1],1e-10); v4[0]->decrRef(); v4[1]->decrRef(); e2->decrRef(); v3.clear(); v4.clear(); delete intersector; // e2=new EdgeLin(3.,5.3,-1.3,1.); intersector=new ArcCSegIntersector(*e1,*e2); - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - 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()); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); + CPPUNIT_ASSERT(intersector->intersect(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); CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.3,(*v4[1])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[1])[1],1e-10); v4[0]->decrRef(); v4[1]->decrRef(); e2->decrRef(); v3.clear(); v4.clear(); delete intersector; // tangent intersection e2=new EdgeLin(-1.,4.3,3.,4.3); intersector=new ArcCSegIntersector(*e1,*e2); - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); - CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations()); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped); + CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(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); v4[0]->decrRef(); e2->decrRef(); v3.clear(); delete intersector; // no intersection e2=new EdgeLin(-2.,-2.,-1.,-3.); intersector=new ArcCSegIntersector(*e1,*e2); - intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); CPPUNIT_ASSERT(obvious && !areOverlapped); + intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(obvious && !areOverlapped); e2->decrRef(); v3.clear(); delete intersector; // e1->decrRef(); -- 2.39.2