From 0c5dd3c8e73849fa7fa096cbf26b8c1b5b4b3df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 14 Jan 2020 18:42:06 +0100 Subject: [PATCH] Doxygen: Document union bounding_box --- include/gds-render/geometric/bounding-box.h | 28 ++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/include/gds-render/geometric/bounding-box.h b/include/gds-render/geometric/bounding-box.h index 699c224..9cad7b1 100644 --- a/include/gds-render/geometric/bounding-box.h +++ b/include/gds-render/geometric/bounding-box.h @@ -35,12 +35,38 @@ #include #include +/** + * @brief Union describing a bounding box + * + * Two ways of accessing a bounding box are possible. + * + * Either, use the "named" vectors struct to specifically access the points + * @code + * lower_left = box.vectors.lower_left; + * upper right = box.vectors.upper_right; + * @endcode + * + * or use the iterable vector array: + * @code + * for (i = 0; i < 2; i++) + * box.vector_array[i] = points[i]; + * @endcode + */ union bounding_box { - /** Coordinate System is (y up | x right) */ + /** + * @brief Location vectors of upper right and lower left bounding box points + * @note Coordinate System is (y up | x right) + */ struct _vectors { + /** @brief Lower left point of the bounding box */ struct vector_2d lower_left; + /** @brief Upper right point of the bounding box */ struct vector_2d upper_right; } vectors; + /** + * @brief Array of vectors representing a bounding box + * @note This is more convenient for iterating + */ struct vector_2d vector_array[2]; };