From 85994d17b8daf30bccdd11b0dde452f70af69fe9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 14 Oct 2015 18:45:13 +0200 Subject: [PATCH] + replace || operator in BoundBox2D with real function names --- src/Base/Tools2D.cpp | 8 ++++---- src/Base/Tools2D.h | 6 +++--- src/Mod/Mesh/App/Core/Algorithm.cpp | 2 +- src/Mod/Mesh/App/Core/Trim.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Base/Tools2D.cpp b/src/Base/Tools2D.cpp index c67d715ad..e65871756 100644 --- a/src/Base/Tools2D.cpp +++ b/src/Base/Tools2D.cpp @@ -67,7 +67,7 @@ void Vector2D::ProjToLine (const Vector2D &rclPt, const Vector2D &rclLine) /********************************************************/ /** BOUNDBOX2D ********************************************/ -bool BoundBox2D::operator|| (const Line2D &rclLine) const +bool BoundBox2D::Intersect(const Line2D &rclLine) const { Line2D clThisLine; Vector2D clVct; @@ -104,7 +104,7 @@ bool BoundBox2D::operator|| (const Line2D &rclLine) const return false; } -bool BoundBox2D::operator|| (const BoundBox2D &rclBB) const +bool BoundBox2D::Intersect(const BoundBox2D &rclBB) const { //// compare bb2-points to this //if (Contains (Vector2D (rclBB.fMinX, rclBB.fMinY))) return TRUE; @@ -127,7 +127,7 @@ bool BoundBox2D::operator|| (const BoundBox2D &rclBB) const return false; } -bool BoundBox2D::operator|| (const Polygon2D &rclPoly) const +bool BoundBox2D::Intersect(const Polygon2D &rclPoly) const { unsigned long i; Line2D clLine; @@ -158,7 +158,7 @@ bool BoundBox2D::operator|| (const Polygon2D &rclPoly) const clLine.clV1 = rclPoly[i]; clLine.clV2 = rclPoly[i + 1]; } - if (*this || clLine) + if (Intersect(clLine)) return true; /***** RETURN INTERSECTION *********/ } // no intersection diff --git a/src/Base/Tools2D.h b/src/Base/Tools2D.h index 7f56d2dfc..062e7a58f 100644 --- a/src/Base/Tools2D.h +++ b/src/Base/Tools2D.h @@ -89,9 +89,9 @@ public: // operators inline BoundBox2D& operator= (const BoundBox2D& rclBB); inline bool operator== (const BoundBox2D& rclBB) const; - bool operator|| (const Line2D &rclLine) const; - bool operator|| (const BoundBox2D &rclBB) const; - bool operator|| (const Polygon2D &rclPoly) const; + bool Intersect(const Line2D &rclLine) const; + bool Intersect(const BoundBox2D &rclBB) const; + bool Intersect(const Polygon2D &rclPoly) const; inline void Add(const Vector2D &rclVct); void SetVoid (void) { fMinX = fMinY = DOUBLE_MAX; fMaxX = fMaxY = -DOUBLE_MAX; } diff --git a/src/Mod/Mesh/App/Core/Algorithm.cpp b/src/Mod/Mesh/App/Core/Algorithm.cpp index 35d3710e2..f822dccfe 100644 --- a/src/Mod/Mesh/App/Core/Algorithm.cpp +++ b/src/Mod/Mesh/App/Core/Algorithm.cpp @@ -1103,7 +1103,7 @@ void MeshAlgorithm::CheckFacets(const MeshFacetGrid& rclGrid, const Base::ViewPr { clBBox3d = clGridIter.GetBoundBox(); clViewBBox = clBBox3d.ProjectBox(pclProj); - if (clViewBBox || clPolyBBox) + if (clViewBBox.Intersect(clPolyBBox)) { // alle Elemente in AllElements sammeln clGridIter.GetElements(aulAllElements); diff --git a/src/Mod/Mesh/App/Core/Trim.cpp b/src/Mod/Mesh/App/Core/Trim.cpp index 88e049472..3d22d2e5d 100644 --- a/src/Mod/Mesh/App/Core/Trim.cpp +++ b/src/Mod/Mesh/App/Core/Trim.cpp @@ -71,7 +71,7 @@ void MeshTrimming::CheckFacets(const MeshFacetGrid& rclGrid, std::vector