Doxygen: Document union bounding_box

This commit is contained in:
Mario Hüttel 2020-01-14 18:42:06 +01:00
parent 77a3a0da5a
commit 0c5dd3c8e7
1 changed files with 27 additions and 1 deletions

View File

@ -35,12 +35,38 @@
#include <gds-render/geometric/vector-operations.h>
#include <stdbool.h>
/**
* @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];
};