3 #pragma GCC diagnostic push 4 #if defined __GNUC__ && (__GNUC__ >= 6) 5 #pragma GCC diagnostic ignored "-Wignored-attributes" 6 #pragma GCC diagnostic ignored "-Wint-in-bool-context" 8 #include <Eigen/Geometry> 12 #pragma GCC diagnostic pop 72 template <
typename OtherVectorType1,
typename OtherVectorType2>
76 template <
typename Derived>
99 min_.setConstant(ScalarTraits::highest());
100 max_.setConstant(ScalarTraits::lowest());
144 if ((mult & corner) != 0) {
159 template <
typename Derived>
160 inline bool contains(
const Eigen::MatrixBase<Derived>&
p)
const {
166 return (
min_.array() <= (b.
min)().array()).all() && ((b.
max)().array() <=
max_.array()).all();
172 return (
min_.array() <= (b.
max)().array()).all() && ((b.
min)().array() <=
max_.array()).all();
177 template <
typename Derived>
179 auto pN(p.derived().eval());
180 min_ = min_.cwiseMin(pN);
215 template <
typename Derived>
217 const auto t(aT.derived().eval());
227 template <
typename Derived>
237 using EigenBox = Eigen::AlignedBox<double, 2>;
238 return EigenBox(
min_,
max_).squaredExteriorDistance(EigenBox(b.
min_, b.
max_));
245 template <
typename Derived>
260 template <
typename OtherScalarType>
261 inline explicit BoundingBox2d(
const Eigen::AlignedBox<OtherScalarType, AmbientDimAtCompileTime>& other) {
262 min_ = (other.min)().template cast<Scalar>();
263 max_ = (other.max)().template cast<Scalar>();
BoundingBox2d merged(const BoundingBox2d &b) const
bool intersects(const BoundingBox2d &b) const
VectorType sample() const
bool contains(const Eigen::MatrixBase< Derived > &p) const
Eigen::NumTraits< Scalar > ScalarTraits
BoundingBox2d & extend(const BoundingBox2d &b)
bool contains(const BoundingBox2d &b) const
ScalarTraits::NonInteger NonInteger
BoundingBox2d(const Eigen::AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other)
BoundingBox2d & clamp(const BoundingBox2d &b)
const VectorType &() min() const
Scalar squaredExteriorDistance(const Eigen::MatrixBase< Derived > &p) const
BasicPoint2d center() const
Identifies RegulatoryElementPrimitives.
Scalar squaredExteriorDistance(const BoundingBox2d &b) const
ScalarTraits::Real RealScalar
Eigen::AlignedBox3d BoundingBox3d
Convenience type for an axis aligned bounding box in 3d.
NonInteger exteriorDistance(const BoundingBox2d &b) const
const VectorType &() max() const
bool isApprox(const BoundingBox2d &other, const RealScalar &prec=ScalarTraits::dummy_precision()) const
Identifies PointPrimitives.
BoundingBox2d(const Eigen::MatrixBase< Derived > &p)
BoundingBox2d intersection(const BoundingBox2d &b) const
VectorType corner(CornerType corner) const
NonInteger exteriorDistance(const Eigen::MatrixBase< Derived > &p) const
Axis-Aligned bounding box in 2d.
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > BasicPoint2d
a simple 2d-point
BasicPoint2d sizes() const
BasicPoint2d diagonal() const
BoundingBox2d & translate(const Eigen::MatrixBase< Derived > &aT)
BoundingBox2d to2D(const BoundingBox3d &primitive)
BoundingBox3d to3D(const BoundingBox2d &primitive)
BoundingBox2d & extend(const Eigen::MatrixBase< Derived > &p)
BoundingBox2d(const Eigen::AlignedBox< double, 2 > &other)
BoundingBox3d MutableType
BoundingBox2d(OtherVectorType1 min, OtherVectorType2 max)