+ replace || operator in BoundBox2D with real function names

This commit is contained in:
wmayer 2015-10-14 18:45:13 +02:00
parent 409ee71087
commit 85994d17b8
4 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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; }

View File

@ -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);

View File

@ -71,7 +71,7 @@ void MeshTrimming::CheckFacets(const MeshFacetGrid& rclGrid, std::vector<unsigne
for (clGridIter.Init(); clGridIter.More(); clGridIter.Next()) {
clBBox3d = clGridIter.GetBoundBox();
clViewBBox = clBBox3d.ProjectBox(myProj);
if (clViewBBox || clPolyBBox) {
if (clViewBBox.Intersect(clPolyBBox)) {
// save all elements in AllElements
clGridIter.GetElements(aulAllElements);
}