Skip to content

Commit 550b35a

Browse files
committed
Document AxisAlignedBoundingBox
1 parent 713deef commit 550b35a

File tree

1 file changed

+58
-7
lines changed

1 file changed

+58
-7
lines changed

source/pbat/geometry/AxisAlignedBoundingBox.h

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
1+
/**
2+
* @file AxisAlignedBoundingBox.h
3+
* @author Quoc-Minh Ton-That ([email protected])
4+
* @brief Axis-aligned bounding box class
5+
* @version 0.1
6+
* @date 2025-02-12
7+
*
8+
* @copyright Copyright (c) 2025
9+
*
10+
*/
211
#ifndef PBAT_GEOMETRY_AXISALIGNEDBOUNDINGBOX_H
312
#define PBAT_GEOMETRY_AXISALIGNEDBOUNDINGBOX_H
413

@@ -13,30 +22,72 @@
1322
namespace pbat {
1423
namespace geometry {
1524

25+
/**
26+
* @brief Axis-aligned bounding box class
27+
*
28+
* @note This class is a thin wrapper around Eigen::AlignedBox
29+
*
30+
* @tparam Dims Number of dimensions
31+
*/
1632
template <int Dims>
1733
class AxisAlignedBoundingBox : public Eigen::AlignedBox<Scalar, Dims>
1834
{
1935
public:
20-
using BaseType = Eigen::AlignedBox<Scalar, Dims>;
21-
using SelfType = AxisAlignedBoundingBox;
36+
using BaseType = Eigen::AlignedBox<Scalar, Dims>; ///< Base type
37+
using SelfType = AxisAlignedBoundingBox; ///< Self type
2238

23-
static auto constexpr kDims = Dims;
39+
static auto constexpr kDims = Dims; ///< Number of dimensions
2440

2541
AxisAlignedBoundingBox() = default;
2642

43+
/**
44+
* @brief Copy construct AxisAlignedBoundingBox from Eigen::AlignedBox
45+
* @param box Eigen::AlignedBox
46+
*/
2747
AxisAlignedBoundingBox(BaseType const& box);
48+
/**
49+
* @brief Move construct AxisAlignedBoundingBox from Eigen::AlignedBox
50+
* @param box Eigen::AlignedBox
51+
*/
2852
AxisAlignedBoundingBox(BaseType&& box);
53+
/**
54+
* @brief Copy assign AxisAlignedBoundingBox from Eigen::AlignedBox
55+
* @param box Eigen::AlignedBox
56+
* @return AxisAlignedBoundingBox& Reference to this
57+
*/
2958
AxisAlignedBoundingBox& operator=(BaseType const& box);
59+
/**
60+
* @brief Move assign AxisAlignedBoundingBox from Eigen::AlignedBox
61+
* @param box Eigen::AlignedBox
62+
* @return AxisAlignedBoundingBox& Reference to this
63+
*/
3064
AxisAlignedBoundingBox& operator=(BaseType&& box);
31-
65+
/**
66+
* @brief Construct AxisAlignedBoundingBox from min and max endpoints
67+
* @tparam TDerivedMin Eigen dense expression type
68+
* @tparam TDerivedMax Eigen dense expression type
69+
* @param min Min endpoint
70+
* @param max Max endpoint
71+
* @pre `min.rows() == Dims` and `max.rows() == Dims`
72+
*/
3273
template <class TDerivedMin, class TDerivedMax>
3374
AxisAlignedBoundingBox(
3475
Eigen::DenseBase<TDerivedMin> const& min,
3576
Eigen::DenseBase<TDerivedMax> const& max);
36-
77+
/**
78+
* @brief Construct AxisAlignedBoundingBox over a set of points
79+
* @tparam TDerived Eigen dense expression type
80+
* @param P Points
81+
* @pre `P.rows() == Dims`
82+
*/
3783
template <class TDerived>
3884
AxisAlignedBoundingBox(Eigen::DenseBase<TDerived> const& P);
39-
85+
/**
86+
* @brief Get indices of points in P contained in the bounding box
87+
* @tparam TDerived Eigen dense expression type
88+
* @param P Points
89+
* @return std::vector<Index> Indices of points in P contained in the bounding box
90+
*/
4091
template <class TDerived>
4192
std::vector<Index> contained(Eigen::MatrixBase<TDerived> const& P) const;
4293
};

0 commit comments

Comments
 (0)