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]; };