21 #ifndef bempp_bounding_box_helpers_hpp
22 #define bempp_bounding_box_helpers_hpp
25 #include "armadillo_fwd.hpp"
26 #include "bounding_box.hpp"
40 template <
typename CoordinateType>
42 const arma::Mat<CoordinateType>& points)
44 assert(points.n_rows == 3);
45 for (
size_t j = 0; j < points.n_cols; ++j) {
47 std::min(bbox.
lbound.x, points(0, j));
49 std::min(bbox.
lbound.y, points(1, j));
51 std::min(bbox.
lbound.z, points(2, j));
53 std::max(bbox.
ubound.x, points(0, j));
55 std::max(bbox.
ubound.y, points(1, j));
57 std::max(bbox.
ubound.z, points(2, j));
66 template <
typename CoordinateType>
68 const arma::Col<CoordinateType>& point)
70 assert(point.n_rows == 3);
Point3D< CoordinateType > ubound
Upper bound.
Definition: bounding_box.hpp:20
Point3D< CoordinateType > lbound
Lower bound.
Definition: bounding_box.hpp:18
Point3D< CoordinateType > reference
Reference point.
Definition: bounding_box.hpp:16
Bounding box with a reference point.
Definition: bounding_box.hpp:13
void extendBoundingBox(BoundingBox< CoordinateType > &bbox, const arma::Mat< CoordinateType > &points)
Extend the bounding box bbox to include all points contained in the columns of points.
Definition: bounding_box_helpers.hpp:41
void setBoundingBoxReference(BoundingBox< CoordinateType > &bbox, const arma::Col< CoordinateType > &point)
Set the reference point of the bounding box bbox to point.
Definition: bounding_box_helpers.hpp:67