@@ -54,9 +54,6 @@ class SubGrid : public BaseIterator<SubGrid>
54
54
* @param min_y Minimum index (y coordinate)
55
55
* @param width Number of indexes in the x direction
56
56
* @param height Number of indexes in the y direction
57
- *
58
- * @note No bounds checking is done for any of the coordinates. Assumes (min_x, min_y) and
59
- * (min_x + width - 1, min_y + height - 1) are valid in the grid.
60
57
*/
61
58
SubGrid (const nav_grid::NavGridInfo* info, unsigned int min_x, unsigned int min_y,
62
59
unsigned int width, unsigned int height)
@@ -78,13 +75,18 @@ class SubGrid : public BaseIterator<SubGrid>
78
75
* @param min_y Minimum index (y coordinate)
79
76
* @param width Number of indexes in the x direction
80
77
* @param height Number of indexes in the y direction
81
- *
82
- * @note No bounds checking is done for any of the coordinates. Assumes (min_x, min_y) and
83
- * (min_x + width - 1, min_y + height - 1) are valid in the grid.
84
78
*/
85
79
SubGrid (const nav_grid::NavGridInfo* info, const nav_grid::Index& index, unsigned int min_x, unsigned int min_y,
86
- unsigned int width, unsigned int height)
87
- : BaseIterator(info, index), min_x_(min_x), min_y_(min_y), width_(width), height_(height) {}
80
+ unsigned int width, unsigned int height);
81
+
82
+ /* *
83
+ * @brief Public constructor using UIntBounds object that takes in an arbitrary index
84
+ * @param info NavGridInfo for the grid to iterate over
85
+ * @param index Initial index
86
+ * @param bounds UIntBounds
87
+ */
88
+ SubGrid (const nav_grid::NavGridInfo* info, const nav_grid::Index& index, const nav_core2::UIntBounds& bounds)
89
+ : SubGrid(info, index, bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight()) {}
88
90
89
91
/* *@name Standard BaseIterator Interface */
90
92
/* *@{*/
0 commit comments