Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'xs/src/libslic3r/BoundingBox.cpp')
-rw-r--r--xs/src/libslic3r/BoundingBox.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/xs/src/libslic3r/BoundingBox.cpp b/xs/src/libslic3r/BoundingBox.cpp
index c16d92f4e..2b3f00df1 100644
--- a/xs/src/libslic3r/BoundingBox.cpp
+++ b/xs/src/libslic3r/BoundingBox.cpp
@@ -259,4 +259,21 @@ BoundingBox3Base<PointClass>::center() const
}
template Pointf3 BoundingBox3Base<Pointf3>::center() const;
+template <class PointClass> bool
+BoundingBoxBase<PointClass>::contains(const PointClass &point) const
+{
+ return point.x >= this->min.x && point.x <= this->max.x
+ && point.y >= this->min.y && point.y <= this->max.y;
+}
+template bool BoundingBoxBase<Point>::contains(const Point &point) const;
+template bool BoundingBoxBase<Pointf>::contains(const Pointf &point) const;
+
+template <class PointClass> bool
+BoundingBoxBase<PointClass>::overlap(const BoundingBoxBase<PointClass> &other) const
+{
+ return this->contains(other.min) || other.contains(this->min);
+}
+template bool BoundingBoxBase<Point>::overlap(const BoundingBoxBase<Point> &point) const;
+template bool BoundingBoxBase<Pointf>::overlap(const BoundingBoxBase<Pointf> &point) const;
+
}